@pie-element/graphing 10.1.1-next.1 → 10.1.1-next.29

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 (233) hide show
  1. package/CHANGELOG.json +652 -0
  2. package/CHANGELOG.md +2039 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +1 -0
  5. package/configure/CHANGELOG.json +382 -0
  6. package/configure/CHANGELOG.md +1830 -0
  7. package/configure/lib/configure.js +328 -0
  8. package/configure/lib/configure.js.map +1 -0
  9. package/configure/lib/correct-response.js +484 -0
  10. package/configure/lib/correct-response.js.map +1 -0
  11. package/configure/lib/defaults.js +448 -0
  12. package/configure/lib/defaults.js.map +1 -0
  13. package/configure/lib/graphing-config.js +388 -0
  14. package/configure/lib/graphing-config.js.map +1 -0
  15. package/configure/lib/index.js +173 -0
  16. package/configure/lib/index.js.map +1 -0
  17. package/configure/lib/utils.js +122 -0
  18. package/configure/lib/utils.js.map +1 -0
  19. package/configure/package.json +30 -0
  20. package/controller/CHANGELOG.json +412 -0
  21. package/controller/CHANGELOG.md +1263 -0
  22. package/controller/lib/defaults.js +64 -0
  23. package/controller/lib/defaults.js.map +1 -0
  24. package/controller/lib/index.js +459 -0
  25. package/controller/lib/index.js.map +1 -0
  26. package/controller/lib/utils.js +451 -0
  27. package/controller/lib/utils.js.map +1 -0
  28. package/controller/package.json +24 -0
  29. package/docs/config-schema.json +3164 -0
  30. package/docs/config-schema.json.md +2293 -0
  31. package/docs/demo/config.js +8 -0
  32. package/docs/demo/generate.js +200 -0
  33. package/docs/demo/index.html +1 -0
  34. package/docs/demo/session.js +20 -0
  35. package/docs/pie-schema.json +3495 -0
  36. package/docs/pie-schema.json.md +1345 -0
  37. package/lib/index.js +69 -0
  38. package/lib/index.js.map +1 -0
  39. package/lib/main.js +161 -0
  40. package/lib/main.js.map +1 -0
  41. package/lib/utils.js +24 -0
  42. package/lib/utils.js.map +1 -0
  43. package/package.json +21 -60
  44. package/dist/author/configure.d.ts +0 -26
  45. package/dist/author/configure.js +0 -208
  46. package/dist/author/correct-response.d.ts +0 -54
  47. package/dist/author/correct-response.js +0 -304
  48. package/dist/author/defaults.d.ts +0 -294
  49. package/dist/author/defaults.js +0 -415
  50. package/dist/author/graphing-config.d.ts +0 -34
  51. package/dist/author/graphing-config.js +0 -244
  52. package/dist/author/index.d.ts +0 -59
  53. package/dist/author/index.js +0 -96
  54. package/dist/author/utils.d.ts +0 -43
  55. package/dist/author/utils.js +0 -260
  56. package/dist/controller/defaults.d.ts +0 -59
  57. package/dist/controller/defaults.js +0 -61
  58. package/dist/controller/index.d.ts +0 -34
  59. package/dist/controller/index.js +0 -181
  60. package/dist/controller/utils.d.ts +0 -37
  61. package/dist/controller/utils.js +0 -114
  62. package/dist/delivery/index.d.ts +0 -21
  63. package/dist/delivery/index.js +0 -43
  64. package/dist/delivery/main.d.ts +0 -23
  65. package/dist/delivery/main.js +0 -107
  66. package/dist/delivery/utils.d.ts +0 -22
  67. package/dist/graphing.css +0 -2
  68. package/dist/index.d.ts +0 -1
  69. package/dist/index.iife.d.ts +0 -8
  70. package/dist/index.iife.js +0 -375
  71. package/dist/index.js +0 -2
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludes.js +0 -7
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayIncludesWith.js +0 -7
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseDifference.js +0 -23
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFindIndex.js +0 -7
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.js +0 -13
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIndexOf.js +0 -9
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIntersection.js +0 -29
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNaN.js +0 -6
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js +0 -22
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUniq.js +0 -27
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castArrayLikeObject.js +0 -7
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createSet.js +0 -9
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.js +0 -10
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_strictIndexOf.js +0 -7
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/differenceWith.js +0 -12
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/intersection.js +0 -11
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  220. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  221. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  222. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  223. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  224. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  225. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/last.js +0 -7
  226. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  227. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/noop.js +0 -4
  228. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/set.js +0 -7
  229. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  230. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  231. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
  232. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniq.js +0 -7
  233. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/uniqWith.js +0 -7
@@ -1,375 +0,0 @@
1
- this.GraphingElement=(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e),f=s((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P={current:null},F={transition:null},ee={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};function te(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,e.act=te,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},e.unstable_act=te,e.useCallback=function(e,t){return P.current.useCallback(e,t)},e.useContext=function(e){return P.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return P.current.useDeferredValue(e)},e.useEffect=function(e,t){return P.current.useEffect(e,t)},e.useId=function(){return P.current.useId()},e.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return P.current.useMemo(e,t)},e.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},e.useRef=function(e){return P.current.useRef(e)},e.useState=function(e){return P.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return P.current.useTransition()},e.version=`18.3.1`})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p(),n=h();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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][: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\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function m(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,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`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(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`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?m(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),F=Symbol.for(`react.lazy`),ee=Symbol.for(`react.offscreen`),te=Symbol.iterator;function I(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Object.assign,re;function ie(e){if(re===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||``}return`
2
- `+re+e}var L=!1;function R(e,t){if(!e||L)return``;L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
3
- `),a=r.stack.split(`
4
- `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
5
- `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{L=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ie(e):``}function ae(e){switch(e.tag){case 5:return ie(e.type);case 16:return ie(`Lazy`);case 13:return ie(`Suspense`);case 19:return ie(`SuspenseList`);case 0:case 2:case 15:return e=R(e.type,!1),e;case 11:return e=R(e.type.render,!1),e;case 1:return e=R(e.type,!0),e;default:return``}}function z(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?z(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return z(e(t))}catch{}}return null}function B(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return z(t);case 8:return t===D?`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 t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function oe(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function se(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ce(e){var t=se(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function V(e){e._valueTracker||=ce(e)}function le(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=se(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ue(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function de(e,t){var n=t.checked;return ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function H(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=oe(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function fe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function pe(e,t){fe(e,t);var n=oe(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?he(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&he(e,t.type,oe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function me(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function he(e,t,n){(t!==`number`||ue(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var ge=Array.isArray;function U(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+oe(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function _e(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return ne({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function ve(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(ge(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:oe(n)}}function ye(e,t){var n=oe(t.value),r=oe(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function be(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function xe(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function Se(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?xe(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Ce,we=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Ce||=document.createElement(`div`),Ce.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Te(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ee={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},De=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Ee).forEach(function(e){De.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ee[t]=Ee[e]})});function Oe(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Ee.hasOwnProperty(e)&&Ee[e]?(``+t).trim():t+`px`}function ke(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Oe(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ae=ne({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function je(e,t){if(t){if(Ae[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Me(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 Ne=null;function Pe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fe=null,Ie=null,Le=null;function Re(e){if(e=Ii(e)){if(typeof Fe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ri(t),Fe(e.stateNode,e.type,t))}}function ze(e){Ie?Le?Le.push(e):Le=[e]:Ie=e}function Be(){if(Ie){var e=Ie,t=Le;if(Le=Ie=null,Re(e),t)for(e=0;e<t.length;e++)Re(t[e])}}function Ve(e,t){return e(t)}function He(){}var Ue=!1;function We(e,t,n){if(Ue)return e(t,n);Ue=!0;try{return Ve(e,t,n)}finally{Ue=!1,(Ie!==null||Le!==null)&&(He(),Be())}}function Ge(e,t){var n=e.stateNode;if(n===null)return null;var i=Ri(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var Ke=!1;if(c)try{var qe={};Object.defineProperty(qe,`passive`,{get:function(){Ke=!0}}),window.addEventListener(`test`,qe,qe),window.removeEventListener(`test`,qe,qe)}catch{Ke=!1}function Je(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Ye=!1,Xe=null,Ze=!1,Qe=null,$e={onError:function(e){Ye=!0,Xe=e}};function et(e,t,n,r,i,a,o,s,c){Ye=!1,Xe=null,Je.apply($e,arguments)}function tt(e,t,n,i,a,o,s,c,l){if(et.apply(this,arguments),Ye){if(Ye){var u=Xe;Ye=!1,Xe=null}else throw Error(r(198));Ze||(Ze=!0,Qe=u)}}function nt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function rt(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function it(e){if(nt(e)!==e)throw Error(r(188))}function at(e){var t=e.alternate;if(!t){if(t=nt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return it(a),e;if(o===i)return it(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function ot(e){return e=at(e),e===null?null:st(e)}function st(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=st(e);if(t!==null)return t;e=e.sibling}return null}var ct=n.unstable_scheduleCallback,lt=n.unstable_cancelCallback,ut=n.unstable_shouldYield,dt=n.unstable_requestPaint,ft=n.unstable_now,pt=n.unstable_getCurrentPriorityLevel,mt=n.unstable_ImmediatePriority,ht=n.unstable_UserBlockingPriority,gt=n.unstable_NormalPriority,_t=n.unstable_LowPriority,vt=n.unstable_IdlePriority,yt=null,bt=null;function xt(e){if(bt&&typeof bt.onCommitFiberRoot==`function`)try{bt.onCommitFiberRoot(yt,e,void 0,(e.current.flags&128)==128)}catch{}}var St=Math.clz32?Math.clz32:Tt,Ct=Math.log,wt=Math.LN2;function Tt(e){return e>>>=0,e===0?32:31-(Ct(e)/wt|0)|0}var Et=64,Dt=4194304;function Ot(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function W(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Ot(a))):r=Ot(s)}else o=n&~i,o===0?a!==0&&(r=Ot(a)):r=Ot(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-St(t),i=1<<n,r|=e[n],t&=~i;return r}function kt(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 At(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-St(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=kt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function jt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Mt(){var e=Et;return Et<<=1,!(Et&4194240)&&(Et=64),e}function Nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function Ft(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-St(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function It(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-St(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Lt=0;function Rt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zt,Bt,Vt,Ht,Ut,Wt=!1,Gt=[],Kt=null,qt=null,Jt=null,Yt=new Map,Xt=new Map,Zt=[],Qt=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function $t(e,t){switch(e){case`focusin`:case`focusout`:Kt=null;break;case`dragenter`:case`dragleave`:qt=null;break;case`mouseover`:case`mouseout`:Jt=null;break;case`pointerover`:case`pointerout`:Yt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Xt.delete(t.pointerId)}}function en(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ii(t),t!==null&&Bt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function tn(e,t,n,r,i){switch(t){case`focusin`:return Kt=en(Kt,e,t,n,r,i),!0;case`dragenter`:return qt=en(qt,e,t,n,r,i),!0;case`mouseover`:return Jt=en(Jt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Yt.set(a,en(Yt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Xt.set(a,en(Xt.get(a)||null,e,t,n,r,i)),!0}return!1}function nn(e){var t=Fi(e.target);if(t!==null){var n=nt(t);if(n!==null){if(t=n.tag,t===13){if(t=rt(n),t!==null){e.blockedOn=t,Ut(e.priority,function(){Vt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function rn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ne=r,n.target.dispatchEvent(r),Ne=null}else return t=Ii(n),t!==null&&Bt(t),e.blockedOn=n,!1;t.shift()}return!0}function an(e,t,n){rn(e)&&n.delete(t)}function on(){Wt=!1,Kt!==null&&rn(Kt)&&(Kt=null),qt!==null&&rn(qt)&&(qt=null),Jt!==null&&rn(Jt)&&(Jt=null),Yt.forEach(an),Xt.forEach(an)}function G(e,t){e.blockedOn===t&&(e.blockedOn=null,Wt||(Wt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,on)))}function sn(e){function t(t){return G(t,e)}if(0<Gt.length){G(Gt[0],e);for(var n=1;n<Gt.length;n++){var r=Gt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Kt!==null&&G(Kt,e),qt!==null&&G(qt,e),Jt!==null&&G(Jt,e),Yt.forEach(t),Xt.forEach(t),n=0;n<Zt.length;n++)r=Zt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Zt.length&&(n=Zt[0],n.blockedOn===null);)nn(n),n.blockedOn===null&&Zt.shift()}var cn=C.ReactCurrentBatchConfig,ln=!0;function un(e,t,n,r){var i=Lt,a=cn.transition;cn.transition=null;try{Lt=1,fn(e,t,n,r)}finally{Lt=i,cn.transition=a}}function dn(e,t,n,r){var i=Lt,a=cn.transition;cn.transition=null;try{Lt=4,fn(e,t,n,r)}finally{Lt=i,cn.transition=a}}function fn(e,t,n,r){if(ln){var i=mn(e,t,n,r);if(i===null)si(e,t,r,pn,n),$t(e,r);else if(tn(i,e,t,n,r))r.stopPropagation();else if($t(e,r),t&4&&-1<Qt.indexOf(e)){for(;i!==null;){var a=Ii(i);if(a!==null&&zt(a),a=mn(e,t,n,r),a===null&&si(e,t,r,pn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else si(e,t,r,null,n)}}var pn=null;function mn(e,t,n,r){if(pn=null,e=Pe(r),e=Fi(e),e!==null)if(t=nt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=rt(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return pn=e,null}function hn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(pt()){case mt:return 1;case ht:return 4;case gt:case _t:return 16;case vt:return 536870912;default:return 16}default:return 16}}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return vn=i.slice(e,1<r?1-r:void 0)}function bn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function xn(){return!0}function Sn(){return!1}function Cn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?xn:Sn,this.isPropagationStopped=Sn,this}return ne(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),t}var wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tn=Cn(wn),En=ne({},wn,{view:0,detail:0}),Dn=Cn(En),On,kn,An,jn=ne({},En,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==An&&(An&&e.type===`mousemove`?(On=e.screenX-An.screenX,kn=e.screenY-An.screenY):kn=On=0,An=e),On)},movementY:function(e){return`movementY`in e?e.movementY:kn}}),Mn=Cn(jn),Nn=Cn(ne({},jn,{dataTransfer:0})),Pn=Cn(ne({},En,{relatedTarget:0})),Fn=Cn(ne({},wn,{animationName:0,elapsedTime:0,pseudoElement:0})),In=Cn(ne({},wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Ln=Cn(ne({},wn,{data:0})),Rn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},zn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Bn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Vn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bn[e])?!!t[e]:!1}function Hn(){return Vn}var Un=Cn(ne({},En,{key:function(e){if(e.key){var t=Rn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hn,charCode:function(e){return e.type===`keypress`?bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Wn=Cn(ne({},jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Gn=Cn(ne({},En,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hn})),Kn=Cn(ne({},wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),qn=Cn(ne({},jn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Jn=[9,13,27,32],Yn=c&&`CompositionEvent`in window,Xn=null;c&&`documentMode`in document&&(Xn=document.documentMode);var Zn=c&&`TextEvent`in window&&!Xn,Qn=c&&(!Yn||Xn&&8<Xn&&11>=Xn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Yn&&tr(e,t)?(e=yn(),vn=_n=gn=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Qn&&t.locale!==`ko`?null:t.data;default:return null}}var or={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){ze(r),t=li(t,`onChange`),0<t.length&&(n=new Tn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,ur=null;function dr(e){ti(e,0)}function fr(e){if(le(Li(e)))return e}function pr(e,t){if(e===`change`)return t}var mr=!1;if(c){var hr;if(c){var gr=`oninput`in document;if(!gr){var _r=document.createElement(`div`);_r.setAttribute(`oninput`,`return;`),gr=typeof _r.oninput==`function`}hr=gr}else hr=!1;mr=hr&&(!document.documentMode||9<document.documentMode)}function vr(){lr&&(lr.detachEvent(`onpropertychange`,yr),ur=lr=null)}function yr(e){if(e.propertyName===`value`&&fr(ur)){var t=[];cr(t,ur,e,Pe(e)),We(dr,t)}}function br(e,t,n){e===`focusin`?(vr(),lr=t,ur=n,lr.attachEvent(`onpropertychange`,yr)):e===`focusout`&&vr()}function xr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return fr(ur)}function Sr(e,t){if(e===`click`)return fr(t)}function Cr(e,t){if(e===`input`||e===`change`)return fr(t)}function wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Tr=typeof Object.is==`function`?Object.is:wr;function Er(e,t){if(Tr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Tr(e[i],t[i]))return!1}return!0}function Dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Or(e,t){var n=Dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(){for(var e=window,t=ue();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ue(e.document)}return t}function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Mr(e){var t=Ar(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kr(n.ownerDocument.documentElement,n)){if(r!==null&&jr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Or(n,a);var o=Or(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Nr=c&&`documentMode`in document&&11>=document.documentMode,Pr=null,Fr=null,Ir=null,Lr=!1;function Rr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lr||Pr==null||Pr!==ue(r)||(r=Pr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ir&&Er(Ir,r)||(Ir=r,r=li(Fr,`onSelect`),0<r.length&&(t=new Tn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Pr)))}function zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Br={animationend:zr(`Animation`,`AnimationEnd`),animationiteration:zr(`Animation`,`AnimationIteration`),animationstart:zr(`Animation`,`AnimationStart`),transitionend:zr(`Transition`,`TransitionEnd`)},Vr={},Hr={};c&&(Hr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Br.animationend.animation,delete Br.animationiteration.animation,delete Br.animationstart.animation),`TransitionEvent`in window||delete Br.transitionend.transition);function Ur(e){if(Vr[e])return Vr[e];if(!Br[e])return e;var t=Br[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hr)return Vr[e]=t[n];return e}var Wr=Ur(`animationend`),Gr=Ur(`animationiteration`),Kr=Ur(`animationstart`),qr=Ur(`transitionend`),Jr=new Map,Yr=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function Xr(e,t){Jr.set(e,t),o(t,[e])}for(var K=0;K<Yr.length;K++){var Zr=Yr[K];Xr(Zr.toLowerCase(),`on`+(Zr[0].toUpperCase()+Zr.slice(1)))}Xr(Wr,`onAnimationEnd`),Xr(Gr,`onAnimationIteration`),Xr(Kr,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(qr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Qr=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),$r=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(Qr));function ei(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,tt(r,t,void 0,e),e.currentTarget=null}function ti(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ei(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ei(i,s,l),a=c}}}if(Ze)throw e=Qe,Ze=!1,Qe=null,e}function ni(e,t){var n=t[Mi];n===void 0&&(n=t[Mi]=new Set);var r=e+`__bubble`;n.has(r)||(oi(t,e,2,!1),n.add(r))}function ri(e,t,n){var r=0;t&&(r|=4),oi(n,e,r,t)}var ii=`_reactListening`+Math.random().toString(36).slice(2);function ai(e){if(!e[ii]){e[ii]=!0,i.forEach(function(t){t!==`selectionchange`&&($r.has(t)||ri(t,!1,e),ri(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ii]||(t[ii]=!0,ri(`selectionchange`,!1,t))}}function oi(e,t,n,r){switch(hn(t)){case 1:var i=un;break;case 4:i=dn;break;default:i=fn}n=i.bind(null,t,n,e),i=void 0,!Ke||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function si(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Fi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}We(function(){var r=a,i=Pe(n),o=[];a:{var s=Jr.get(e);if(s!==void 0){var c=Tn,l=e;switch(e){case`keypress`:if(bn(n)===0)break a;case`keydown`:case`keyup`:c=Un;break;case`focusin`:l=`focus`,c=Pn;break;case`focusout`:l=`blur`,c=Pn;break;case`beforeblur`:case`afterblur`:c=Pn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Mn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Nn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Gn;break;case Wr:case Gr:case Kr:c=Fn;break;case qr:c=Kn;break;case`scroll`:c=Dn;break;case`wheel`:c=qn;break;case`copy`:case`cut`:case`paste`:c=In;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Wn}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=Ge(p,f),h!=null&&u.push(ci(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Ne&&(l=n.relatedTarget||n.fromElement)&&(Fi(l)||l[ji]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Fi(l):null,l!==null&&(d=nt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Mn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Wn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Li(c),m=l==null?s:Li(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Fi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=ui(m))p++;for(m=0,h=f;h;h=ui(h))m++;for(;0<p-m;)u=ui(u),p--;for(;0<m-p;)f=ui(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=ui(u),f=ui(f)}u=null}else u=null;c!==null&&di(o,s,c,u,!1),l!==null&&d!==null&&di(o,d,l,u,!0)}}a:{if(s=r?Li(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=pr;else if(sr(s))if(mr)g=Cr;else{g=xr;var _=br}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Sr);if(g&&=g(e,r)){cr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&he(s,`number`,s.value)}switch(_=r?Li(r):window,e){case`focusin`:(sr(_)||_.contentEditable===`true`)&&(Pr=_,Fr=r,Ir=null);break;case`focusout`:Ir=Fr=Pr=null;break;case`mousedown`:Lr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Lr=!1,Rr(o,n,i);break;case`selectionchange`:if(Nr)break;case`keydown`:case`keyup`:Rr(o,n,i)}var v;if(Yn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else rr?tr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(Qn&&n.locale!==`ko`&&(rr||y!==`onCompositionStart`?y===`onCompositionEnd`&&rr&&(v=yn()):(gn=i,_n=`value`in gn?gn.value:gn.textContent,rr=!0)),_=li(r,y),0<_.length&&(y=new Ln(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=nr(n),v!==null&&(y.data=v)))),(v=Zn?ir(e,n):ar(e,n))&&(r=li(r,`onBeforeInput`),0<r.length&&(i=new Ln(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ti(o,t)})}function ci(e,t,n){return{instance:e,listener:t,currentTarget:n}}function li(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Ge(e,n),a!=null&&r.unshift(ci(e,a,i)),a=Ge(e,t),a!=null&&r.push(ci(e,a,i))),e=e.return}return r}function ui(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function di(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=Ge(n,a),c!=null&&o.unshift(ci(n,c,s))):i||(c=Ge(n,a),c!=null&&o.push(ci(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var fi=/\r\n?/g,pi=/\u0000|\uFFFD/g;function mi(e){return(typeof e==`string`?e:``+e).replace(fi,`
6
- `).replace(pi,``)}function hi(e,t,n){if(t=mi(t),mi(e)!==t&&n)throw Error(r(425))}function gi(){}var _i=null,vi=null;function yi(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bi=typeof setTimeout==`function`?setTimeout:void 0,xi=typeof clearTimeout==`function`?clearTimeout:void 0,Si=typeof Promise==`function`?Promise:void 0,Ci=typeof queueMicrotask==`function`?queueMicrotask:Si===void 0?bi:function(e){return Si.resolve(null).then(e).catch(wi)};function wi(e){setTimeout(function(){throw e})}function Ti(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),sn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);sn(t)}function Ei(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Di(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Oi=Math.random().toString(36).slice(2),ki=`__reactFiber$`+Oi,Ai=`__reactProps$`+Oi,ji=`__reactContainer$`+Oi,Mi=`__reactEvents$`+Oi,Ni=`__reactListeners$`+Oi,Pi=`__reactHandles$`+Oi;function Fi(e){var t=e[ki];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ji]||n[ki]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Di(e);e!==null;){if(n=e[ki])return n;e=Di(e)}return t}e=n,n=e.parentNode}return null}function Ii(e){return e=e[ki]||e[ji],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Li(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ri(e){return e[Ai]||null}var zi=[],Bi=-1;function Vi(e){return{current:e}}function Hi(e){0>Bi||(e.current=zi[Bi],zi[Bi]=null,Bi--)}function Ui(e,t){Bi++,zi[Bi]=e.current,e.current=t}var Wi={},Gi=Vi(Wi),Ki=Vi(!1),qi=Wi;function Ji(e,t){var n=e.type.contextTypes;if(!n)return Wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yi(e){return e=e.childContextTypes,e!=null}function Xi(){Hi(Ki),Hi(Gi)}function Zi(e,t,n){if(Gi.current!==Wi)throw Error(r(168));Ui(Gi,t),Ui(Ki,n)}function Qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,B(e)||`Unknown`,a));return ne({},n,i)}function $i(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wi,qi=Gi.current,Ui(Gi,e),Ui(Ki,Ki.current),!0}function ea(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Qi(e,t,qi),i.__reactInternalMemoizedMergedChildContext=e,Hi(Ki),Hi(Gi),Ui(Gi,e)):Hi(Ki),Ui(Ki,n)}var ta=null,na=!1,ra=!1;function ia(e){ta===null?ta=[e]:ta.push(e)}function aa(e){na=!0,ia(e)}function oa(){if(!ra&&ta!==null){ra=!0;var e=0,t=Lt;try{var n=ta;for(Lt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ta=null,na=!1}catch(t){throw ta!==null&&(ta=ta.slice(e+1)),ct(mt,oa),t}finally{Lt=t,ra=!1}}return null}var sa=[],ca=0,la=null,ua=0,da=[],fa=0,pa=null,ma=1,ha=``;function ga(e,t){sa[ca++]=ua,sa[ca++]=la,la=e,ua=t}function _a(e,t,n){da[fa++]=ma,da[fa++]=ha,da[fa++]=pa,pa=e;var r=ma;e=ha;var i=32-St(r)-1;r&=~(1<<i),n+=1;var a=32-St(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ma=1<<32-St(t)+i|n<<i|r,ha=a+e}else ma=1<<a|n<<i|r,ha=e}function va(e){e.return!==null&&(ga(e,1),_a(e,1,0))}function ya(e){for(;e===la;)la=sa[--ca],sa[ca]=null,ua=sa[--ca],sa[ca]=null;for(;e===pa;)pa=da[--fa],da[fa]=null,ha=da[--fa],da[fa]=null,ma=da[--fa],da[fa]=null}var ba=null,xa=null,Sa=!1,Ca=null;function wa(e,t){var n=Zl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ta(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,ba=e,xa=Ei(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,ba=e,xa=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=pa===null?null:{id:ma,overflow:ha},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Zl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ba=e,xa=null,!0);default:return!1}}function Ea(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Da(e){if(Sa){var t=xa;if(t){var n=t;if(!Ta(e,t)){if(Ea(e))throw Error(r(418));t=Ei(n.nextSibling);var i=ba;t&&Ta(e,t)?wa(i,n):(e.flags=e.flags&-4097|2,Sa=!1,ba=e)}}else{if(Ea(e))throw Error(r(418));e.flags=e.flags&-4097|2,Sa=!1,ba=e}}}function Oa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ba=e}function ka(e){if(e!==ba)return!1;if(!Sa)return Oa(e),Sa=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!yi(e.type,e.memoizedProps)),t&&=xa){if(Ea(e))throw Aa(),Error(r(418));for(;t;)wa(e,t),t=Ei(t.nextSibling)}if(Oa(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){xa=Ei(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}xa=null}}else xa=ba?Ei(e.stateNode.nextSibling):null;return!0}function Aa(){for(var e=xa;e;)e=Ei(e.nextSibling)}function ja(){xa=ba=null,Sa=!1}function Ma(e){Ca===null?Ca=[e]:Ca.push(e)}var Na=C.ReactCurrentBatchConfig;function Pa(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Fa(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Ia(e){var t=e._init;return t(e._payload)}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=eu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=iu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===F&&Ia(i)===t.type)?(r=a(t,n.props),r.ref=Pa(e,t,n),r.return=e,r):(r=tu(n.type,n.key,n.props,null,e.mode,r),r.ref=Pa(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=au(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=nu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=iu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=tu(t.type,t.key,t.props,null,e.mode,n),n.ref=Pa(e,null,t),n.return=e,n;case T:return t=au(t,e.mode,n),t.return=e,t;case F:var r=t._init;return f(e,r(t._payload),n)}if(ge(t)||I(t))return t=nu(t,e.mode,n,null),t.return=e,t;Fa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case F:return i=n._init,p(e,t,i(n._payload),r)}if(ge(n)||I(n))return i===null?d(e,t,n,r,null):null;Fa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case F:var a=r._init;return m(e,t,n,a(r._payload),i)}if(ge(r)||I(r))return e=e.get(n)||null,d(t,e,r,i,null);Fa(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Sa&&ga(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Sa&&ga(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Sa&&ga(r,h),l}function g(a,s,c,l){var u=I(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Sa&&ga(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Sa&&ga(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Sa&&ga(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&Ia(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Pa(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=nu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=tu(i.type,i.key,i.props,null,e.mode,o),o.ref=Pa(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=au(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(ge(i))return h(e,r,i,o);if(I(i))return g(e,r,i,o);Fa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=iu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ra=La(!0),za=La(!1),Ba=Vi(null),Va=null,Ha=null,Ua=null;function Wa(){Ua=Ha=Va=null}function Ga(e){var t=Ba.current;Hi(Ba),e._currentValue=t}function Ka(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qa(e,t){Va=e,Ua=Ha=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Is=!0),e.firstContext=null)}function Ja(e){var t=e._currentValue;if(Ua!==e)if(e={context:e,memoizedValue:t,next:null},Ha===null){if(Va===null)throw Error(r(308));Ha=e,Va.dependencies={lanes:0,firstContext:e}}else Ha=Ha.next=e;return t}var Ya=null;function Xa(e){Ya===null?Ya=[e]:Ya.push(e)}function Za(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Xa(t)):(n.next=i.next,i.next=n),t.interleaved=n,Qa(e,r)}function Qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var $a=!1;function eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function to(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function no(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ro(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Gc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Xa(r)):(t.next=i.next,i.next=t),r.interleaved=t,Qa(e,n)}function io(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,It(e,n)}}function ao(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function oo(e,t,n,r){var i=e.updateQueue;$a=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=ne({},d,f);break a;case 2:$a=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);$c|=o,e.lanes=o,e.memoizedState=d}}function so(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var co={},lo=Vi(co),uo=Vi(co),fo=Vi(co);function po(e){if(e===co)throw Error(r(174));return e}function mo(e,t){switch(Ui(fo,t),Ui(uo,e),Ui(lo,co),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Se(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Se(t,e)}Hi(lo),Ui(lo,t)}function ho(){Hi(lo),Hi(uo),Hi(fo)}function go(e){po(fo.current);var t=po(lo.current),n=Se(t,e.type);t!==n&&(Ui(uo,e),Ui(lo,n))}function _o(e){uo.current===e&&(Hi(lo),Hi(uo))}var vo=Vi(0);function yo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bo=[];function xo(){for(var e=0;e<bo.length;e++)bo[e]._workInProgressVersionPrimary=null;bo.length=0}var So=C.ReactCurrentDispatcher,q=C.ReactCurrentBatchConfig,Co=0,wo=null,To=null,Eo=null,Do=!1,Oo=!1,ko=0,Ao=0;function jo(){throw Error(r(321))}function Mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tr(e[n],t[n]))return!1;return!0}function No(e,t,n,i,a,o){if(Co=o,wo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,So.current=e===null||e.memoizedState===null?gs:_s,e=n(i,a),Oo){o=0;do{if(Oo=!1,ko=0,25<=o)throw Error(r(301));o+=1,Eo=To=null,t.updateQueue=null,So.current=vs,e=n(i,a)}while(Oo)}if(So.current=hs,t=To!==null&&To.next!==null,Co=0,Eo=To=wo=null,Do=!1,t)throw Error(r(300));return e}function Po(){var e=ko!==0;return ko=0,e}function Fo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Eo===null?wo.memoizedState=Eo=e:Eo=Eo.next=e,Eo}function J(){if(To===null){var e=wo.alternate;e=e===null?null:e.memoizedState}else e=To.next;var t=Eo===null?wo.memoizedState:Eo.next;if(t!==null)Eo=t,To=e;else{if(e===null)throw Error(r(310));To=e,e={memoizedState:To.memoizedState,baseState:To.baseState,baseQueue:To.baseQueue,queue:To.queue,next:null},Eo===null?wo.memoizedState=Eo=e:Eo=Eo.next=e}return Eo}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){var t=J(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=To,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Co&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,wo.lanes|=d,$c|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Tr(i,t.memoizedState)||(Is=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,wo.lanes|=o,$c|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ro(e){var t=J(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Tr(o,t.memoizedState)||(Is=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function zo(){}function Bo(e,t){var n=wo,i=J(),a=t(),o=!Tr(i.memoizedState,a);if(o&&(i.memoizedState=a,Is=!0),i=i.queue,Qo(Uo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Eo!==null&&Eo.memoizedState.tag&1){if(n.flags|=2048,qo(9,Ho.bind(null,n,i,a,t),void 0,null),Kc===null)throw Error(r(349));Co&30||Vo(n,t,a)}return a}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=wo.updateQueue,t===null?(t={lastEffect:null,stores:null},wo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tr(e,n)}catch{return!0}}function Go(e){var t=Qa(e,1);t!==null&&yl(t,e,1,-1)}function Ko(e){var t=Fo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t.queue=e,e=e.dispatch=ds.bind(null,wo,e),[t.memoizedState,e]}function qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=wo.updateQueue,t===null?(t={lastEffect:null,stores:null},wo.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Jo(){return J().memoizedState}function Yo(e,t,n,r){var i=Fo();wo.flags|=e,i.memoizedState=qo(1|t,n,void 0,r===void 0?null:r)}function Xo(e,t,n,r){var i=J();r=r===void 0?null:r;var a=void 0;if(To!==null){var o=To.memoizedState;if(a=o.destroy,r!==null&&Mo(r,o.deps)){i.memoizedState=qo(t,n,a,r);return}}wo.flags|=e,i.memoizedState=qo(1|t,n,a,r)}function Zo(e,t){return Yo(8390656,8,e,t)}function Qo(e,t){return Xo(2048,8,e,t)}function $o(e,t){return Xo(4,2,e,t)}function es(e,t){return Xo(4,4,e,t)}function ts(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ns(e,t,n){return n=n==null?null:n.concat([e]),Xo(4,4,ts.bind(null,t,e),n)}function rs(){}function is(e,t){var n=J();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function as(e,t){var n=J();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ss(e,t,n){return Co&21?(Tr(n,t)||(n=Mt(),wo.lanes|=n,$c|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Is=!0),e.memoizedState=n)}function cs(e,t){var n=Lt;Lt=n!==0&&4>n?n:4,e(!0);var r=q.transition;q.transition={};try{e(!1),t()}finally{Lt=n,q.transition=r}}function ls(){return J().memoizedState}function us(e,t,n){var r=vl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fs(e))ps(t,n);else if(n=Za(e,t,n,r),n!==null){var i=_l();yl(n,e,r,i),ms(n,t,r)}}function ds(e,t,n){var r=vl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fs(e))ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o)){var c=t.interleaved;c===null?(i.next=i,Xa(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Za(e,t,i,r),n!==null&&(i=_l(),yl(n,e,r,i),ms(n,t,r))}}function fs(e){var t=e.alternate;return e===wo||t!==null&&t===wo}function ps(e,t){Oo=Do=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ms(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,It(e,n)}}var hs={readContext:Ja,useCallback:jo,useContext:jo,useEffect:jo,useImperativeHandle:jo,useInsertionEffect:jo,useLayoutEffect:jo,useMemo:jo,useReducer:jo,useRef:jo,useState:jo,useDebugValue:jo,useDeferredValue:jo,useTransition:jo,useMutableSource:jo,useSyncExternalStore:jo,useId:jo,unstable_isNewReconciler:!1},gs={readContext:Ja,useCallback:function(e,t){return Fo().memoizedState=[e,t===void 0?null:t],e},useContext:Ja,useEffect:Zo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Yo(4194308,4,ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yo(4,2,e,t)},useMemo:function(e,t){var n=Fo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=us.bind(null,wo,e),[r.memoizedState,e]},useRef:function(e){var t=Fo();return e={current:e},t.memoizedState=e},useState:Ko,useDebugValue:rs,useDeferredValue:function(e){return Fo().memoizedState=e},useTransition:function(){var e=Ko(!1),t=e[0];return e=cs.bind(null,e[1]),Fo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=wo,a=Fo();if(Sa){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Kc===null)throw Error(r(349));Co&30||Vo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Zo(Uo.bind(null,i,o,e),[e]),i.flags|=2048,qo(9,Ho.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Fo(),t=Kc.identifierPrefix;if(Sa){var n=ha,r=ma;n=(r&~(1<<32-St(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=ko++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Ao++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},_s={readContext:Ja,useCallback:is,useContext:Ja,useEffect:Qo,useImperativeHandle:ns,useInsertionEffect:$o,useLayoutEffect:es,useMemo:as,useReducer:Lo,useRef:Jo,useState:function(){return Lo(Io)},useDebugValue:rs,useDeferredValue:function(e){return ss(J(),To.memoizedState,e)},useTransition:function(){return[Lo(Io)[0],J().memoizedState]},useMutableSource:zo,useSyncExternalStore:Bo,useId:ls,unstable_isNewReconciler:!1},vs={readContext:Ja,useCallback:is,useContext:Ja,useEffect:Qo,useImperativeHandle:ns,useInsertionEffect:$o,useLayoutEffect:es,useMemo:as,useReducer:Ro,useRef:Jo,useState:function(){return Ro(Io)},useDebugValue:rs,useDeferredValue:function(e){var t=J();return To===null?t.memoizedState=e:ss(t,To.memoizedState,e)},useTransition:function(){return[Ro(Io)[0],J().memoizedState]},useMutableSource:zo,useSyncExternalStore:Bo,useId:ls,unstable_isNewReconciler:!1};function ys(e,t){if(e&&e.defaultProps){for(var n in t=ne({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ne({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xs={isMounted:function(e){return(e=e._reactInternals)?nt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_l(),i=vl(e),a=no(r,i);a.payload=t,n!=null&&(a.callback=n),t=ro(e,a,i),t!==null&&(yl(t,e,i,r),io(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_l(),i=vl(e),a=no(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ro(e,a,i),t!==null&&(yl(t,e,i,r),io(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_l(),r=vl(e),i=no(n,r);i.tag=2,t!=null&&(i.callback=t),t=ro(e,i,r),t!==null&&(yl(t,e,r,n),io(t,e,r))}};function Ss(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Er(n,r)||!Er(i,a):!0}function Cs(e,t,n){var r=!1,i=Wi,a=t.contextType;return typeof a==`object`&&a?a=Ja(a):(i=Yi(t)?qi:Gi.current,r=t.contextTypes,a=(r=r!=null)?Ji(e,i):Wi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ws(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xs.enqueueReplaceState(t,t.state,null)}function Ts(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},eo(e);var a=t.contextType;typeof a==`object`&&a?i.context=Ja(a):(a=Yi(t)?qi:Gi.current,i.context=Ji(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(bs(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&xs.enqueueReplaceState(i,i.state,null),oo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Es(e,t){try{var n=``,r=t;do n+=ae(r),r=r.return;while(r);var i=n}catch(e){i=`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ds(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Os(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var ks=typeof WeakMap==`function`?WeakMap:Map;function As(e,t,n){n=no(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){sl||(sl=!0,cl=r),Os(e,t)},n}function js(e,t,n){n=no(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Os(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Os(e,t),typeof r!=`function`&&(ll===null?ll=new Set([this]):ll.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ms(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ks;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Wl.bind(null,e,t,n),t.then(e,e))}function Ns(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ps(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=no(-1,1),t.tag=2,ro(n,t,1))),n.lanes|=1),e)}var Fs=C.ReactCurrentOwner,Is=!1;function Ls(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function Rs(e,t,n,r,i){n=n.render;var a=t.ref;return qa(t,i),r=No(e,t,n,r,a,i),n=Po(),e!==null&&!Is?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ic(e,t,i)):(Sa&&n&&va(t),t.flags|=1,Ls(e,t,r,i),t.child)}function zs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ql(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Bs(e,t,a,r,i)):(e=tu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return ic(e,t,i)}return t.flags|=1,e=eu(a,r),e.ref=t.ref,e.return=t,t.child=e}function Bs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref)if(Is=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Is=!0);else return t.lanes=e.lanes,ic(e,t,i)}return Us(e,t,n,r,i)}function Vs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ui(Xc,Yc),Yc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ui(Xc,Yc),Yc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ui(Xc,Yc),Yc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ui(Xc,Yc),Yc|=r;return Ls(e,t,i,n),t.child}function Hs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Us(e,t,n,r,i){var a=Yi(n)?qi:Gi.current;return a=Ji(t,a),qa(t,i),n=No(e,t,n,r,a,i),r=Po(),e!==null&&!Is?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ic(e,t,i)):(Sa&&r&&va(t),t.flags|=1,Ls(e,t,n,i),t.child)}function Ws(e,t,n,r,i){if(Yi(n)){var a=!0;$i(t)}else a=!1;if(qa(t,i),t.stateNode===null)rc(e,t),Cs(t,n,r),Ts(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ja(l):(l=Yi(n)?qi:Gi.current,l=Ji(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&ws(t,o,r,l),$a=!1;var f=t.memoizedState;o.state=f,oo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Ki.current||$a?(typeof u==`function`&&(bs(t,n,u,r),c=t.memoizedState),(s=$a||Ss(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,to(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:ys(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ja(c):(c=Yi(n)?qi:Gi.current,c=Ji(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&ws(t,o,r,c),$a=!1,f=t.memoizedState,o.state=f,oo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Ki.current||$a?(typeof p==`function`&&(bs(t,n,p,r),m=t.memoizedState),(l=$a||Ss(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Gs(e,t,n,r,a,i)}function Gs(e,t,n,r,i,a){Hs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&ea(t,n,!1),ic(e,t,a);r=t.stateNode,Fs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ra(t,e.child,null,a),t.child=Ra(t,null,s,a)):Ls(e,t,s,a),t.memoizedState=r.state,i&&ea(t,n,!0),t.child}function Ks(e){var t=e.stateNode;t.pendingContext?Zi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Zi(e,t.context,!1),mo(e,t.containerInfo)}function qs(e,t,n,r,i){return ja(),Ma(i),t.flags|=256,Ls(e,t,n,r),t.child}var Js={dehydrated:null,treeContext:null,retryLane:0};function Ys(e){return{baseLanes:e,cachePool:null,transitions:null}}function Xs(e,t,n){var r=t.pendingProps,i=vo.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ui(vo,i&1),e===null)return Da(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=ru(o,r,0,null),e=nu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ys(n),t.memoizedState=Js,e):Zs(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return $s(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=eu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=nu(a,o,n,null),a.flags|=2):a=eu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Ys(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Js,r}return a=e.child,e=a.sibling,r=eu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Zs(e,t){return t=ru({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Qs(e,t,n,r){return r!==null&&Ma(r),Ra(t,e.child,null,n),e=Zs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $s(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ds(Error(r(422))),Qs(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=ru({mode:`visible`,children:i.children},a,0,null),o=nu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ra(t,e.child,null,s),t.child.memoizedState=Ys(s),t.memoizedState=Js,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Qs(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Ds(o,i,void 0),Qs(e,t,s,i)}if(c=(s&e.childLanes)!==0,Is||c){if(i=Kc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,Qa(e,a),yl(i,e,a,-1))}return Nl(),i=Ds(Error(r(421))),Qs(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Kl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,xa=Ei(a.nextSibling),ba=t,Sa=!0,Ca=null,e!==null&&(da[fa++]=ma,da[fa++]=ha,da[fa++]=pa,ma=e.id,ha=e.overflow,pa=t),t=Zs(t,i.children),t.flags|=4096,t)}function ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ka(e.return,t,n)}function tc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function nc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ls(e,t,r.children,n),r=vo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ec(e,n,t);else if(e.tag===19)ec(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ui(vo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&yo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&yo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tc(t,!0,n,null,a);break;case`together`:tc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ic(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$c|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=eu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=eu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ac(e,t,n){switch(t.tag){case 3:Ks(t),ja();break;case 5:go(t);break;case 1:Yi(t.type)&&$i(t);break;case 4:mo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ui(Ba,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ui(vo,vo.current&1),e=ic(e,t,n),e===null?null:e.sibling):Xs(e,t,n):(Ui(vo,vo.current&1),t.flags|=128,null);Ui(vo,vo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return nc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ui(vo,vo.current),r)break;return null;case 22:case 23:return t.lanes=0,Vs(e,t,n)}return ic(e,t,n)}var oc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},sc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,po(lo.current);var o=null;switch(n){case`input`:i=de(e,i),r=de(e,r),o=[];break;case`select`:i=ne({},i,{value:void 0}),r=ne({},r,{value:void 0}),o=[];break;case`textarea`:i=_e(e,i),r=_e(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=gi)}je(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ni(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},cc=function(e,t,n,r){n!==r&&(t.flags|=4)};function lc(e,t){if(!Sa)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function uc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function dc(e,t,n){var i=t.pendingProps;switch(ya(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return uc(t),null;case 1:return Yi(t.type)&&Xi(),uc(t),null;case 3:return i=t.stateNode,ho(),Hi(Ki),Hi(Gi),xo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ka(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ca!==null&&(Cl(Ca),Ca=null))),uc(t),null;case 5:_o(t);var o=po(fo.current);if(n=t.type,e!==null&&t.stateNode!=null)sc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return uc(t),null}if(e=po(lo.current),ka(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[ki]=t,i[Ai]=s,e=(t.mode&1)!=0,n){case`dialog`:ni(`cancel`,i),ni(`close`,i);break;case`iframe`:case`object`:case`embed`:ni(`load`,i);break;case`video`:case`audio`:for(o=0;o<Qr.length;o++)ni(Qr[o],i);break;case`source`:ni(`error`,i);break;case`img`:case`image`:case`link`:ni(`error`,i),ni(`load`,i);break;case`details`:ni(`toggle`,i);break;case`input`:H(i,s),ni(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},ni(`invalid`,i);break;case`textarea`:ve(i,s),ni(`invalid`,i)}for(var c in je(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&hi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&hi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ni(`scroll`,i)}switch(n){case`input`:V(i),me(i,s,!0);break;case`textarea`:V(i),be(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=gi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=xe(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[ki]=t,e[Ai]=i,oc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Me(n,i),n){case`dialog`:ni(`cancel`,e),ni(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:ni(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<Qr.length;o++)ni(Qr[o],e);o=i;break;case`source`:ni(`error`,e),o=i;break;case`img`:case`image`:case`link`:ni(`error`,e),ni(`load`,e),o=i;break;case`details`:ni(`toggle`,e),o=i;break;case`input`:H(e,i),o=de(e,i),ni(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=ne({},i,{value:void 0}),ni(`invalid`,e);break;case`textarea`:ve(e,i),o=_e(e,i),ni(`invalid`,e);break;default:o=i}for(s in je(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?ke(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&we(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Te(e,u):typeof u==`number`&&Te(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&ni(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:V(e),me(e,i,!1);break;case`textarea`:V(e),be(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+oe(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&U(e,!!i.multiple,i.defaultValue,!0):U(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=gi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return uc(t),null;case 6:if(e&&t.stateNode!=null)cc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=po(fo.current),po(lo.current),ka(t)){if(i=t.stateNode,n=t.memoizedProps,i[ki]=t,(s=i.nodeValue!==n)&&(e=ba,e!==null))switch(e.tag){case 3:hi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&hi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[ki]=t,t.stateNode=i}return uc(t),null;case 13:if(Hi(vo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Sa&&xa!==null&&t.mode&1&&!(t.flags&128))Aa(),ja(),t.flags|=98560,s=!1;else if(s=ka(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[ki]=t}else ja(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;uc(t),s=!1}else Ca!==null&&(Cl(Ca),Ca=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||vo.current&1?Zc===0&&(Zc=3):Nl())),t.updateQueue!==null&&(t.flags|=4),uc(t),null);case 4:return ho(),e===null&&ai(t.stateNode.containerInfo),uc(t),null;case 10:return Ga(t.type._context),uc(t),null;case 17:return Yi(t.type)&&Xi(),uc(t),null;case 19:if(Hi(vo),s=t.memoizedState,s===null)return uc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)lc(s,!1);else{if(Zc!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=yo(e),c!==null){for(t.flags|=128,lc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ui(vo,vo.current&1|2),t.child}e=e.sibling}s.tail!==null&&ft()>al&&(t.flags|=128,i=!0,lc(s,!1),t.lanes=4194304)}else{if(!i)if(e=yo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Sa)return uc(t),null}else 2*ft()-s.renderingStartTime>al&&n!==1073741824&&(t.flags|=128,i=!0,lc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(uc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ft(),t.sibling=null,n=vo.current,Ui(vo,i?n&1|2:n&1),t);case 22:case 23:return kl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Yc&1073741824&&(uc(t),t.subtreeFlags&6&&(t.flags|=8192)):uc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function fc(e,t){switch(ya(t),t.tag){case 1:return Yi(t.type)&&Xi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ho(),Hi(Ki),Hi(Gi),xo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _o(t),null;case 13:if(Hi(vo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Hi(vo),null;case 4:return ho(),null;case 10:return Ga(t.type._context),null;case 22:case 23:return kl(),null;case 24:return null;default:return null}}var pc=!1,mc=!1,hc=typeof WeakSet==`function`?WeakSet:Set,Y=null;function gc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Ul(e,t,n)}else n.current=null}function _c(e,t,n){try{n()}catch(n){Ul(e,t,n)}}var vc=!1;function yc(e,t){if(_i=ln,e=Ar(),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(vi={focusedElem:e,selectionRange:n},ln=!1,Y=t;Y!==null;)if(t=Y,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ys(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Ul(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return h=vc,vc=!1,h}function bc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&_c(t,n,a)}i=i.next}while(i!==r)}}function xc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Sc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Cc(e){var t=e.alternate;t!==null&&(e.alternate=null,Cc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ki],delete t[Ai],delete t[Mi],delete t[Ni],delete t[Pi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function wc(e){return e.tag===5||e.tag===3||e.tag===4}function Tc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gi));else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}function Dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Dc(e,t,n),e=e.sibling;e!==null;)Dc(e,t,n),e=e.sibling}var Oc=null,kc=!1;function Ac(e,t,n){for(n=n.child;n!==null;)jc(e,t,n),n=n.sibling}function jc(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount==`function`)try{bt.onCommitFiberUnmount(yt,n)}catch{}switch(n.tag){case 5:mc||gc(n,t);case 6:var r=Oc,i=kc;Oc=null,Ac(e,t,n),Oc=r,kc=i,Oc!==null&&(kc?(e=Oc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oc.removeChild(n.stateNode));break;case 18:Oc!==null&&(kc?(e=Oc,n=n.stateNode,e.nodeType===8?Ti(e.parentNode,n):e.nodeType===1&&Ti(e,n),sn(e)):Ti(Oc,n.stateNode));break;case 4:r=Oc,i=kc,Oc=n.stateNode.containerInfo,kc=!0,Ac(e,t,n),Oc=r,kc=i;break;case 0:case 11:case 14:case 15:if(!mc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&_c(n,t,o),i=i.next}while(i!==r)}Ac(e,t,n);break;case 1:if(!mc&&(gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Ul(n,t,e)}Ac(e,t,n);break;case 21:Ac(e,t,n);break;case 22:n.mode&1?(mc=(r=mc)||n.memoizedState!==null,Ac(e,t,n),mc=r):Ac(e,t,n);break;default:Ac(e,t,n)}}function Mc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hc),t.forEach(function(t){var r=ql.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Nc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Oc=c.stateNode,kc=!1;break a;case 3:Oc=c.stateNode.containerInfo,kc=!0;break a;case 4:Oc=c.stateNode.containerInfo,kc=!0;break a}c=c.return}if(Oc===null)throw Error(r(160));jc(o,s,a),Oc=null,kc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Ul(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Pc(t,e),t=t.sibling}function Pc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nc(t,e),Fc(e),i&4){try{bc(3,e,e.return),xc(3,e)}catch(t){Ul(e,e.return,t)}try{bc(5,e,e.return)}catch(t){Ul(e,e.return,t)}}break;case 1:Nc(t,e),Fc(e),i&512&&n!==null&&gc(n,n.return);break;case 5:if(Nc(t,e),Fc(e),i&512&&n!==null&&gc(n,n.return),e.flags&32){var a=e.stateNode;try{Te(a,``)}catch(t){Ul(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&fe(a,o),Me(c,s);var u=Me(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?ke(a,f):d===`dangerouslySetInnerHTML`?we(a,f):d===`children`?Te(a,f):S(a,d,f,u)}switch(c){case`input`:pe(a,o);break;case`textarea`:ye(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?U(a,!!o.multiple,o.multiple?[]:``,!1):U(a,!!o.multiple,o.defaultValue,!0)):U(a,!!o.multiple,m,!1)}a[Ai]=o}catch(t){Ul(e,e.return,t)}}break;case 6:if(Nc(t,e),Fc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Ul(e,e.return,t)}}break;case 3:if(Nc(t,e),Fc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{sn(t.containerInfo)}catch(t){Ul(e,e.return,t)}break;case 4:Nc(t,e),Fc(e);break;case 13:Nc(t,e),Fc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(il=ft())),i&4&&Mc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(mc=(u=mc)||d,Nc(t,e),mc=u):Nc(t,e),Fc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Y=e,d=e.child;d!==null;){for(f=Y=d;Y!==null;){switch(p=Y,m=p.child,p.tag){case 0:case 11:case 14:case 15:bc(4,p,p.return);break;case 1:gc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Ul(i,n,e)}}break;case 5:gc(p,p.return);break;case 22:if(p.memoizedState!==null){zc(f);continue}}m===null?zc(f):(m.return=p,Y=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Oe(`display`,s))}catch(t){Ul(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Ul(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Nc(t,e),Fc(e),i&4&&Mc(e);break;case 21:break;default:Nc(t,e),Fc(e)}}function Fc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(wc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Te(a,``),i.flags&=-33),Dc(e,Tc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Ec(e,Tc(e),o);break;default:throw Error(r(161))}}catch(t){Ul(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ic(e,t,n){Y=e,Lc(e,t,n)}function Lc(e,t,n){for(var r=(e.mode&1)!=0;Y!==null;){var i=Y,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||pc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||mc;s=pc;var l=mc;if(pc=o,(mc=c)&&!l)for(Y=i;Y!==null;)o=Y,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Bc(i):(c.return=o,Y=c);for(;a!==null;)Y=a,Lc(a,t,n),a=a.sibling;Y=i,pc=s,mc=l}Rc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Y=a):Rc(e,t,n)}}function Rc(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mc||xc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!mc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:ys(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&so(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}so(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&sn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}mc||t.flags&512&&Sc(t)}catch(e){Ul(t,t.return,e)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function zc(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Bc(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{xc(4,t)}catch(e){Ul(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Ul(t,i,e)}}var a=t.return;try{Sc(t)}catch(e){Ul(t,a,e)}break;case 5:var o=t.return;try{Sc(t)}catch(e){Ul(t,o,e)}}}catch(e){Ul(t,t.return,e)}if(t===e){Y=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Y=s;break}Y=t.return}}var Vc=Math.ceil,Hc=C.ReactCurrentDispatcher,Uc=C.ReactCurrentOwner,Wc=C.ReactCurrentBatchConfig,Gc=0,Kc=null,qc=null,Jc=0,Yc=0,Xc=Vi(0),Zc=0,Qc=null,$c=0,el=0,tl=0,nl=null,rl=null,il=0,al=1/0,ol=null,sl=!1,cl=null,ll=null,ul=!1,dl=null,fl=0,pl=0,ml=null,hl=-1,gl=0;function _l(){return Gc&6?ft():hl===-1?hl=ft():hl}function vl(e){return e.mode&1?Gc&2&&Jc!==0?Jc&-Jc:Na.transition===null?(e=Lt,e===0?(e=window.event,e=e===void 0?16:hn(e.type),e):e):(gl===0&&(gl=Mt()),gl):1}function yl(e,t,n,i){if(50<pl)throw pl=0,ml=null,Error(r(185));Pt(e,n,i),(!(Gc&2)||e!==Kc)&&(e===Kc&&(!(Gc&2)&&(el|=n),Zc===4&&Tl(e,Jc)),bl(e,i),n===1&&Gc===0&&!(t.mode&1)&&(al=ft()+500,na&&oa()))}function bl(e,t){var n=e.callbackNode;At(e,t);var r=W(e,e===Kc?Jc:0);if(r===0)n!==null&&lt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&lt(n),t===1)e.tag===0?aa(El.bind(null,e)):ia(El.bind(null,e)),Ci(function(){!(Gc&6)&&oa()}),n=null;else{switch(Rt(r)){case 1:n=mt;break;case 4:n=ht;break;case 16:n=gt;break;case 536870912:n=vt;break;default:n=gt}n=Yl(n,xl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function xl(e,t){if(hl=-1,gl=0,Gc&6)throw Error(r(327));var n=e.callbackNode;if(Vl()&&e.callbackNode!==n)return null;var i=W(e,e===Kc?Jc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Pl(e,i);else{t=i;var a=Gc;Gc|=2;var o=Ml();(Kc!==e||Jc!==t)&&(ol=null,al=ft()+500,Al(e,t));do try{Il();break}catch(t){jl(e,t)}while(1);Wa(),Hc.current=o,Gc=a,qc===null?(Kc=null,Jc=0,t=Zc):t=0}if(t!==0){if(t===2&&(a=jt(e),a!==0&&(i=a,t=Sl(e,a))),t===1)throw n=Qc,Al(e,0),Tl(e,i),bl(e,ft()),n;if(t===6)Tl(e,i);else{if(a=e.current.alternate,!(i&30)&&!wl(a)&&(t=Pl(e,i),t===2&&(o=jt(e),o!==0&&(i=o,t=Sl(e,o))),t===1))throw n=Qc,Al(e,0),Tl(e,i),bl(e,ft()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:zl(e,rl,ol);break;case 3:if(Tl(e,i),(i&130023424)===i&&(t=il+500-ft(),10<t)){if(W(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){_l(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=bi(zl.bind(null,e,rl,ol),t);break}zl(e,rl,ol);break;case 4:if(Tl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-St(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=ft()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Vc(i/1960))-i,10<i){e.timeoutHandle=bi(zl.bind(null,e,rl,ol),i);break}zl(e,rl,ol);break;case 5:zl(e,rl,ol);break;default:throw Error(r(329))}}}return bl(e,ft()),e.callbackNode===n?xl.bind(null,e):null}function Sl(e,t){var n=nl;return e.current.memoizedState.isDehydrated&&(Al(e,t).flags|=256),e=Pl(e,t),e!==2&&(t=rl,rl=n,t!==null&&Cl(t)),e}function Cl(e){rl===null?rl=e:rl.push.apply(rl,e)}function wl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Tr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tl(e,t){for(t&=~tl,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),r=1<<n;e[n]=-1,t&=~r}}function El(e){if(Gc&6)throw Error(r(327));Vl();var t=W(e,0);if(!(t&1))return bl(e,ft()),null;var n=Pl(e,t);if(e.tag!==0&&n===2){var i=jt(e);i!==0&&(t=i,n=Sl(e,i))}if(n===1)throw n=Qc,Al(e,0),Tl(e,t),bl(e,ft()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zl(e,rl,ol),bl(e,ft()),null}function Dl(e,t){var n=Gc;Gc|=1;try{return e(t)}finally{Gc=n,Gc===0&&(al=ft()+500,na&&oa())}}function Ol(e){dl!==null&&dl.tag===0&&!(Gc&6)&&Vl();var t=Gc;Gc|=1;var n=Wc.transition,r=Lt;try{if(Wc.transition=null,Lt=1,e)return e()}finally{Lt=r,Wc.transition=n,Gc=t,!(Gc&6)&&oa()}}function kl(){Yc=Xc.current,Hi(Xc)}function Al(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,xi(n)),qc!==null)for(n=qc.return;n!==null;){var r=n;switch(ya(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Xi();break;case 3:ho(),Hi(Ki),Hi(Gi),xo();break;case 5:_o(r);break;case 4:ho();break;case 13:Hi(vo);break;case 19:Hi(vo);break;case 10:Ga(r.type._context);break;case 22:case 23:kl()}n=n.return}if(Kc=e,qc=e=eu(e.current,null),Jc=Yc=t,Zc=0,Qc=null,tl=el=$c=0,rl=nl=null,Ya!==null){for(t=0;t<Ya.length;t++)if(n=Ya[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Ya=null}return e}function jl(e,t){do{var n=qc;try{if(Wa(),So.current=hs,Do){for(var i=wo.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Do=!1}if(Co=0,Eo=To=wo=null,Oo=!1,ko=0,Uc.current=null,n===null||n.return===null){Zc=1,Qc=t,qc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Jc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ns(s);if(m!==null){m.flags&=-257,Ps(m,s,c,o,t),m.mode&1&&Ms(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){Ms(o,u,t),Nl();break a}l=Error(r(426))}}else if(Sa&&c.mode&1){var _=Ns(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ps(_,s,c,o,t),Ma(Es(l,c));break a}}o=l=Es(l,c),Zc!==4&&(Zc=2),nl===null?nl=[o]:nl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=As(o,l,t);ao(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(ll===null||!ll.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=js(o,c,t);ao(o,x);break a}}o=o.return}while(o!==null)}Rl(n)}catch(e){t=e,qc===n&&n!==null&&(qc=n=n.return);continue}break}while(1)}function Ml(){var e=Hc.current;return Hc.current=hs,e===null?hs:e}function Nl(){(Zc===0||Zc===3||Zc===2)&&(Zc=4),Kc===null||!($c&268435455)&&!(el&268435455)||Tl(Kc,Jc)}function Pl(e,t){var n=Gc;Gc|=2;var i=Ml();(Kc!==e||Jc!==t)&&(ol=null,Al(e,t));do try{Fl();break}catch(t){jl(e,t)}while(1);if(Wa(),Gc=n,Hc.current=i,qc!==null)throw Error(r(261));return Kc=null,Jc=0,Zc}function Fl(){for(;qc!==null;)Ll(qc)}function Il(){for(;qc!==null&&!ut();)Ll(qc)}function Ll(e){var t=Jl(e.alternate,e,Yc);e.memoizedProps=e.pendingProps,t===null?Rl(e):qc=t,Uc.current=null}function Rl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=fc(n,t),n!==null){n.flags&=32767,qc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Zc=6,qc=null;return}}else if(n=dc(n,t,Yc),n!==null){qc=n;return}if(t=t.sibling,t!==null){qc=t;return}qc=t=e}while(t!==null);Zc===0&&(Zc=5)}function zl(e,t,n){var r=Lt,i=Wc.transition;try{Wc.transition=null,Lt=1,Bl(e,t,n,r)}finally{Wc.transition=i,Lt=r}return null}function Bl(e,t,n,i){do Vl();while(dl!==null);if(Gc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Ft(e,o),e===Kc&&(qc=Kc=null,Jc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ul||(ul=!0,Yl(gt,function(){return Vl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Wc.transition,Wc.transition=null;var s=Lt;Lt=1;var c=Gc;Gc|=4,Uc.current=null,yc(e,n),Pc(n,e),Mr(vi),ln=!!_i,vi=_i=null,e.current=n,Ic(n,e,a),dt(),Gc=c,Lt=s,Wc.transition=o}else e.current=n;if(ul&&(ul=!1,dl=e,fl=a),o=e.pendingLanes,o===0&&(ll=null),xt(n.stateNode,i),bl(e,ft()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(sl)throw sl=!1,e=cl,cl=null,e;return fl&1&&e.tag!==0&&Vl(),o=e.pendingLanes,o&1?e===ml?pl++:(pl=0,ml=e):pl=0,oa(),null}function Vl(){if(dl!==null){var e=Rt(fl),t=Wc.transition,n=Lt;try{if(Wc.transition=null,Lt=16>e?16:e,dl===null)var i=!1;else{if(e=dl,dl=null,fl=0,Gc&6)throw Error(r(331));var a=Gc;for(Gc|=4,Y=e.current;Y!==null;){var o=Y,s=o.child;if(Y.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(Y=u;Y!==null;){var d=Y;switch(d.tag){case 0:case 11:case 15:bc(8,d,o)}var f=d.child;if(f!==null)f.return=d,Y=f;else for(;Y!==null;){d=Y;var p=d.sibling,m=d.return;if(Cc(d),d===u){Y=null;break}if(p!==null){p.return=m,Y=p;break}Y=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}Y=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Y=s;else b:for(;Y!==null;){if(o=Y,o.flags&2048)switch(o.tag){case 0:case 11:case 15:bc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,Y=v;break b}Y=o.return}}var y=e.current;for(Y=y;Y!==null;){s=Y;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Y=b;else b:for(s=y;Y!==null;){if(c=Y,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:xc(9,c)}}catch(e){Ul(c,c.return,e)}if(c===s){Y=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,Y=x;break b}Y=c.return}}if(Gc=a,oa(),bt&&typeof bt.onPostCommitFiberRoot==`function`)try{bt.onPostCommitFiberRoot(yt,e)}catch{}i=!0}return i}finally{Lt=n,Wc.transition=t}}return!1}function Hl(e,t,n){t=Es(n,t),t=As(e,t,1),e=ro(e,t,1),t=_l(),e!==null&&(Pt(e,1,t),bl(e,t))}function Ul(e,t,n){if(e.tag===3)Hl(e,e,n);else for(;t!==null;){if(t.tag===3){Hl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ll===null||!ll.has(r))){e=Es(n,e),e=js(t,e,1),t=ro(t,e,1),e=_l(),t!==null&&(Pt(t,1,e),bl(t,e));break}}t=t.return}}function Wl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_l(),e.pingedLanes|=e.suspendedLanes&n,Kc===e&&(Jc&n)===n&&(Zc===4||Zc===3&&(Jc&130023424)===Jc&&500>ft()-il?Al(e,0):tl|=n),bl(e,t)}function Gl(e,t){t===0&&(e.mode&1?(t=Dt,Dt<<=1,!(Dt&130023424)&&(Dt=4194304)):t=1);var n=_l();e=Qa(e,t),e!==null&&(Pt(e,t,n),bl(e,n))}function Kl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gl(e,n)}function ql(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Gl(e,n)}var Jl=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ki.current)Is=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Is=!1,ac(e,t,n);Is=!!(e.flags&131072)}else Is=!1,Sa&&t.flags&1048576&&_a(t,ua,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;rc(e,t),e=t.pendingProps;var a=Ji(t,Gi.current);qa(t,n),a=No(null,t,i,e,a,n);var o=Po();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yi(i)?(o=!0,$i(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,eo(t),a.updater=xs,t.stateNode=a,a._reactInternals=t,Ts(t,i,e,n),t=Gs(null,t,i,!0,o,n)):(t.tag=0,Sa&&o&&va(t),Ls(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(rc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=$l(i),e=ys(i,e),a){case 0:t=Us(null,t,i,e,n);break a;case 1:t=Ws(null,t,i,e,n);break a;case 11:t=Rs(null,t,i,e,n);break a;case 14:t=zs(null,t,i,ys(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ys(i,a),Us(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ys(i,a),Ws(e,t,i,a,n);case 3:a:{if(Ks(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,to(e,t),oo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Es(Error(r(423)),t),t=qs(e,t,i,n,a);break a}else if(i!==a){a=Es(Error(r(424)),t),t=qs(e,t,i,n,a);break a}else for(xa=Ei(t.stateNode.containerInfo.firstChild),ba=t,Sa=!0,Ca=null,n=za(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ja(),i===a){t=ic(e,t,n);break a}Ls(e,t,i,n)}t=t.child}return t;case 5:return go(t),e===null&&Da(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,yi(i,a)?s=null:o!==null&&yi(i,o)&&(t.flags|=32),Hs(e,t),Ls(e,t,s,n),t.child;case 6:return e===null&&Da(t),null;case 13:return Xs(e,t,n);case 4:return mo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ra(t,null,i,n):Ls(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ys(i,a),Rs(e,t,i,a,n);case 7:return Ls(e,t,t.pendingProps,n),t.child;case 8:return Ls(e,t,t.pendingProps.children,n),t.child;case 12:return Ls(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ui(Ba,i._currentValue),i._currentValue=s,o!==null)if(Tr(o.value,s)){if(o.children===a.children&&!Ki.current){t=ic(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=no(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ka(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ka(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ls(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,qa(t,n),a=Ja(a),i=i(a),t.flags|=1,Ls(e,t,i,n),t.child;case 14:return i=t.type,a=ys(i,t.pendingProps),a=ys(i.type,a),zs(e,t,i,a,n);case 15:return Bs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ys(i,a),rc(e,t),t.tag=1,Yi(i)?(e=!0,$i(t)):e=!1,qa(t,n),Cs(t,i,a),Ts(t,i,a,n),Gs(null,t,i,!0,e,n);case 19:return nc(e,t,n);case 22:return Vs(e,t,n)}throw Error(r(156,t.tag))};function Yl(e,t){return ct(e,t)}function Xl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zl(e,t,n,r){return new Xl(e,t,n,r)}function Ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $l(e){if(typeof e==`function`)return+!!Ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function eu(e,t){var n=e.alternate;return n===null?(n=Zl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function tu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)Ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return nu(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Zl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Zl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Zl(19,n,t,a),e.elementType=N,e.lanes=o,e;case ee:return ru(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Zl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function nu(e,t,n,r){return e=Zl(7,e,r,t),e.lanes=n,e}function ru(e,t,n,r){return e=Zl(22,e,r,t),e.elementType=ee,e.lanes=n,e.stateNode={isHidden:!1},e}function iu(e,t,n){return e=Zl(6,e,null,t),e.lanes=n,e}function au(e,t,n){return t=Zl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ou(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nt(0),this.expirationTimes=Nt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function su(e,t,n,r,i,a,o,s,c){return e=new ou(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Zl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},eo(a),e}function cu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function lu(e){if(!e)return Wi;e=e._reactInternals;a:{if(nt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Yi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Yi(n))return Qi(e,n,t)}return t}function uu(e,t,n,r,i,a,o,s,c){return e=su(n,r,!0,e,i,a,o,s,c),e.context=lu(null),n=e.current,r=_l(),i=vl(n),a=no(r,i),a.callback=t??null,ro(n,a,i),e.current.lanes=i,Pt(e,i,r),bl(e,r),e}function du(e,t,n,r){var i=t.current,a=_l(),o=vl(i);return n=lu(n),t.context===null?t.context=n:t.pendingContext=n,t=no(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ro(i,t,o),e!==null&&(yl(e,i,o,a),io(e,i,o)),o}function fu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function pu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mu(e,t){pu(e,t),(e=e.alternate)&&pu(e,t)}function hu(){return null}var gu=typeof reportError==`function`?reportError:function(e){console.error(e)};function _u(e){this._internalRoot=e}vu.prototype.render=_u.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));du(e,t,null,null)},vu.prototype.unmount=_u.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ol(function(){du(null,e,null,null)}),t[ji]=null}};function vu(e){this._internalRoot=e}vu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ht();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Zt.length&&t!==0&&t<Zt[n].priority;n++);Zt.splice(n,0,e),n===0&&nn(e)}};function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function xu(){}function Su(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=fu(o);a.call(e)}}var o=uu(t,r,e,0,null,!1,!1,``,xu);return e._reactRootContainer=o,e[ji]=o.current,ai(e.nodeType===8?e.parentNode:e),Ol(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=fu(c);s.call(e)}}var c=su(e,0,!1,null,null,!1,!1,``,xu);return e._reactRootContainer=c,e[ji]=c.current,ai(e.nodeType===8?e.parentNode:e),Ol(function(){du(t,c,n,r)}),c}function Cu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=fu(o);s.call(e)}}du(t,o,e,i)}else o=Su(n,t,e,i,r);return fu(o)}zt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ot(t.pendingLanes);n!==0&&(It(t,n|1),bl(t,ft()),!(Gc&6)&&(al=ft()+500,oa()))}break;case 13:Ol(function(){var t=Qa(e,1);t!==null&&yl(t,e,1,_l())}),mu(e,1)}},Bt=function(e){if(e.tag===13){var t=Qa(e,134217728);t!==null&&yl(t,e,134217728,_l()),mu(e,134217728)}},Vt=function(e){if(e.tag===13){var t=vl(e),n=Qa(e,t);n!==null&&yl(n,e,t,_l()),mu(e,t)}},Ht=function(){return Lt},Ut=function(e,t){var n=Lt;try{return Lt=e,t()}finally{Lt=n}},Fe=function(e,t,n){switch(t){case`input`:if(pe(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Ri(i);if(!a)throw Error(r(90));le(i),pe(i,a)}}}break;case`textarea`:ye(e,n);break;case`select`:t=n.value,t!=null&&U(e,!!n.multiple,t,!1)}},Ve=Dl,He=Ol;var wu={usingClientEntryPoint:!1,Events:[Ii,Li,Ri,ze,Be,Dl]},Tu={findFiberByHostInstance:Fi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Eu={bundleType:Tu.bundleType,version:Tu.version,rendererPackageName:Tu.rendererPackageName,rendererConfig:Tu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ot(e),e===null?null:e.stateNode},findFiberByHostInstance:Tu.findFiberByHostInstance||hu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Du.isDisabled&&Du.supportsFiber)try{yt=Du.inject(Eu),bt=Du}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yu(t))throw Error(r(200));return cu(e,t,null,n)},e.createRoot=function(e,t){if(!yu(e))throw Error(r(299));var n=!1,i=``,a=gu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=su(e,1,!1,null,null,n,!1,i,a),e[ji]=t.current,ai(e.nodeType===8?e.parentNode:e),new _u(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=ot(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Ol(e)},e.hydrate=function(e,t,n){if(!bu(t))throw Error(r(200));return Cu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!yu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=gu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=uu(t,null,e,1,n??null,a,!1,o,s),e[ji]=t.current,ai(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new vu(t)},e.render=function(e,t,n){if(!bu(t))throw Error(r(200));return Cu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!bu(e))throw Error(r(40));return e._reactRootContainer?(Ol(function(){Cu(null,null,e,!1,function(){e._reactRootContainer=null,e[ji]=null})}),!0):!1},e.unstable_batchedUpdates=Dl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!bu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Cu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=_();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}));(class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}});var y=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},b=`https://cdn.jsdelivr.net/npm/mathjax@4/tex-chtml.js`,x=null;function S(e){return typeof window>`u`||window.MathJax?.version?Promise.resolve():x||(x=new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s={loader:{load:i?[`a11y/assistive-mml`]:[]},tex:{packages:[`base`,`ams`,`autoload`],macros:{parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`}},options:{enableMenu:i,enableExplorer:i,enableAssistiveMml:i},startup:{ready:()=>{window.MathJax?.startup.defaultReady&&(window.MathJax.startup.defaultReady(),t())},defaultReady:()=>{}}};r&&s.tex&&(s.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],s.tex.processEscapes=!0),a||(s.chtml={fontURL:``}),window.MathJax=s;let c=document.createElement(`script`);c.src=o||b,c.async=!0,c.onload=()=>{setTimeout(t,100)},c.onerror=()=>{n(Error(`Failed to load MathJax`))},document.head.appendChild(c)}),x)}function C(){let e=window.MathJax?.startup?.document;if(typeof e?.assistiveMml==`function`)try{e.assistiveMml().updateDocument?.()}catch(e){console.warn(`[mathjax-renderer] Failed to attach assistive MathML:`,e)}}function w(e={}){return async t=>{if(await S(e),!window.MathJax?.typesetPromise){console.warn(`[mathjax-renderer] MathJax not loaded or missing typesetPromise.`);return}await window.MathJax.typesetPromise([t]),C()}}var T=null;function E(){return T||=w({accessibility:!0,useSingleDollar:!0}),T}var D=async e=>{if(typeof window>`u`)return;let t=typeof e==`string`,n;return t?(n=document.createElement(`div`),n.innerHTML=e):n=e||document.body,await E()(n),t?n.innerHTML:void 0},O=e=>e,k=c({default:()=>j}),A,j,M=o((()=>{A=()=>null,j=new Proxy(A,{get:()=>A})}));function N(e,...t){let n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Minified MUI error #${e}; visit ${n} for the full message.`}var P=`$$material`;function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F.apply(null,arguments)}var ee=!1;function te(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function I(e){var t=document.createElement(`style`);return t.setAttribute(`data-emotion`,e.key),e.nonce!==void 0&&t.setAttribute(`nonce`,e.nonce),t.appendChild(document.createTextNode(``)),t.setAttribute(`data-s`,``),t}var ne=function(){function e(e){var t=this;this._insertTag=function(e){var n=t.tags.length===0?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling;t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=e.speedy===void 0?!ee:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(I(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=te(t);try{n.insertRule(e,n.cssRules.length)}catch{}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode?.removeChild(e)}),this.tags=[],this.ctr=0},e}(),re=`-ms-`,ie=`-moz-`,L=`-webkit-`,R=`comm`,ae=`rule`,z=`decl`,B=`@import`,oe=`@keyframes`,se=`@layer`,ce=Math.abs,V=String.fromCharCode,le=Object.assign;function ue(e,t){return me(e,0)^45?(((t<<2^me(e,0))<<2^me(e,1))<<2^me(e,2))<<2^me(e,3):0}function de(e){return e.trim()}function H(e,t){return(e=t.exec(e))?e[0]:e}function fe(e,t,n){return e.replace(t,n)}function pe(e,t){return e.indexOf(t)}function me(e,t){return e.charCodeAt(t)|0}function he(e,t,n){return e.slice(t,n)}function ge(e){return e.length}function U(e){return e.length}function _e(e,t){return t.push(e),e}function ve(e,t){return e.map(t).join(``)}var ye=1,be=1,xe=0,Se=0,Ce=0,we=``;function Te(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:ye,column:be,length:o,return:``}}function Ee(e,t){return le(Te(``,null,null,``,null,null,0),e,{length:-e.length},t)}function De(){return Ce}function Oe(){return Ce=Se>0?me(we,--Se):0,be--,Ce===10&&(be=1,ye--),Ce}function ke(){return Ce=Se<xe?me(we,Se++):0,be++,Ce===10&&(be=1,ye++),Ce}function Ae(){return me(we,Se)}function je(){return Se}function Me(e,t){return he(we,e,t)}function Ne(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Pe(e){return ye=be=1,xe=ge(we=e),Se=0,[]}function Fe(e){return we=``,e}function Ie(e){return de(Me(Se-1,ze(e===91?e+2:e===40?e+1:e)))}function Le(e){for(;(Ce=Ae())&&Ce<33;)ke();return Ne(e)>2||Ne(Ce)>3?``:` `}function Re(e,t){for(;--t&&ke()&&!(Ce<48||Ce>102||Ce>57&&Ce<65||Ce>70&&Ce<97););return Me(e,je()+(t<6&&Ae()==32&&ke()==32))}function ze(e){for(;ke();)switch(Ce){case e:return Se;case 34:case 39:e!==34&&e!==39&&ze(Ce);break;case 40:e===41&&ze(e);break;case 92:ke();break}return Se}function Be(e,t){for(;ke()&&e+Ce!==57&&!(e+Ce===84&&Ae()===47););return`/*`+Me(t,Se-1)+`*`+V(e===47?e:ke())}function Ve(e){for(;!Ne(Ae());)ke();return Me(e,Se)}function He(e){return Fe(Ue(``,null,null,null,[``],e=Pe(e),0,[0],e))}function Ue(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=ke()){case 40:if(m!=108&&me(C,d-1)==58){pe(C+=fe(Ie(v),`&`,`&\f`),`&\f`)!=-1&&(_=-1);break}case 34:case 39:case 91:C+=Ie(v);break;case 9:case 10:case 13:case 32:C+=Le(m);break;case 92:C+=Re(je()-1,7);continue;case 47:switch(Ae()){case 42:case 47:_e(Ge(Be(ke(),je()),t,n),c);break;default:C+=`/`}break;case 123*h:s[l++]=ge(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=fe(C,/\f/g,``)),p>0&&ge(C)-d&&_e(p>32?Ke(C+`;`,r,n,d-1):Ke(fe(C,` `,``)+`;`,r,n,d-2),c);break;case 59:C+=`;`;default:if(_e(S=We(C,t,n,l,u,i,s,y,b=[],x=[],d),a),v===123)if(u===0)Ue(C,t,S,S,b,a,d,s,x);else switch(f===99&&me(C,3)===110?100:f){case 100:case 108:case 109:case 115:Ue(e,S,S,r&&_e(We(e,S,S,0,0,i,s,y,i,b=[],d),x),i,x,d,s,r?b:x);break;default:Ue(C,S,S,S,[``],x,0,s,x)}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+ge(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&Oe()==125)continue}switch(C+=V(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(ge(C)-1)*_,_=1;break;case 64:Ae()===45&&(C+=Ie(ke())),f=Ae(),u=d=ge(y=C+=Ve(je())),v++;break;case 45:m===45&&ge(C)==2&&(h=0)}}return a}function We(e,t,n,r,i,a,o,s,c,l,u){for(var d=i-1,f=i===0?a:[``],p=U(f),m=0,h=0,g=0;m<r;++m)for(var _=0,v=he(e,d+1,d=ce(h=o[m])),y=e;_<p;++_)(y=de(h>0?f[_]+` `+v:fe(v,/&\f/g,f[_])))&&(c[g++]=y);return Te(e,t,n,i===0?ae:s,c,l,u)}function Ge(e,t,n){return Te(e,t,n,R,V(De()),he(e,2,-2),0)}function Ke(e,t,n,r){return Te(e,t,n,z,he(e,0,r),he(e,r+1,-1),r)}function qe(e,t){for(var n=``,r=U(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||``;return n}function Je(e,t,n,r){switch(e.type){case se:if(e.children.length)break;case B:case z:return e.return=e.return||e.value;case R:return``;case oe:return e.return=e.value+`{`+qe(e.children,r)+`}`;case ae:e.value=e.props.join(`,`)}return ge(n=qe(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Ye(e){var t=U(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}function Xe(e){return function(t){t.root||(t=t.return)&&e(t)}}function Ze(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Qe=function(e,t,n){for(var r=0,i=0;r=i,i=Ae(),r===38&&i===12&&(t[n]=1),!Ne(i);)ke();return Me(e,Se)},$e=function(e,t){var n=-1,r=44;do switch(Ne(r)){case 0:r===38&&Ae()===12&&(t[n]=1),e[n]+=Qe(Se-1,t,n);break;case 2:e[n]+=Ie(r);break;case 4:if(r===44){e[++n]=Ae()===58?`&\f`:``,t[n]=e[n].length;break}default:e[n]+=V(r)}while(r=ke());return e},et=function(e,t){return Fe($e(Pe(e),t))},tt=new WeakMap,nt=function(e){if(!(e.type!==`rule`||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!==`rule`;)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!tt.get(n))&&!r){tt.set(e,!0);for(var i=[],a=et(t,i),o=n.props,s=0,c=0;s<a.length;s++)for(var l=0;l<o.length;l++,c++)e.props[c]=i[s]?a[s].replace(/&\f/g,o[l]):o[l]+` `+a[s]}}},rt=function(e){if(e.type===`decl`){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return=``,e.value=``)}};function it(e,t){switch(ue(e,t)){case 5103:return L+`print-`+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return L+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return L+e+ie+e+re+e+e;case 6828:case 4268:return L+e+re+e+e;case 6165:return L+e+re+`flex-`+e+e;case 5187:return L+e+fe(e,/(\w+).+(:[^]+)/,L+`box-$1$2`+re+`flex-$1$2`)+e;case 5443:return L+e+re+`flex-item-`+fe(e,/flex-|-self/,``)+e;case 4675:return L+e+re+`flex-line-pack`+fe(e,/align-content|flex-|-self/,``)+e;case 5548:return L+e+re+fe(e,`shrink`,`negative`)+e;case 5292:return L+e+re+fe(e,`basis`,`preferred-size`)+e;case 6060:return L+`box-`+fe(e,`-grow`,``)+L+e+re+fe(e,`grow`,`positive`)+e;case 4554:return L+fe(e,/([^-])(transform)/g,`$1`+L+`$2`)+e;case 6187:return fe(fe(fe(e,/(zoom-|grab)/,L+`$1`),/(image-set)/,L+`$1`),e,``)+e;case 5495:case 3959:return fe(e,/(image-set\([^]*)/,L+"$1$`$1");case 4968:return fe(fe(e,/(.+:)(flex-)?(.*)/,L+`box-pack:$3`+re+`flex-pack:$3`),/s.+-b[^;]+/,`justify`)+L+e+e;case 4095:case 3583:case 4068:case 2532:return fe(e,/(.+)-inline(.+)/,L+`$1$2`)+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ge(e)-1-t>6)switch(me(e,t+1)){case 109:if(me(e,t+4)!==45)break;case 102:return fe(e,/(.+:)(.+)-([^]+)/,`$1`+L+`$2-$3$1`+ie+(me(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~pe(e,`stretch`)?it(fe(e,`stretch`,`fill-available`),t)+e:e}break;case 4949:if(me(e,t+1)!==115)break;case 6444:switch(me(e,ge(e)-3-(~pe(e,`!important`)&&10))){case 107:return fe(e,`:`,`:`+L)+e;case 101:return fe(e,/(.+:)([^;!]+)(;|!.+)?/,`$1`+L+(me(e,14)===45?`inline-`:``)+`box$3$1`+L+`$2$3$1`+re+`$2box$3`)+e}break;case 5936:switch(me(e,t+11)){case 114:return L+e+re+fe(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return L+e+re+fe(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return L+e+re+fe(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}return L+e+re+e+e}return e}var at=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case z:e.return=it(e.value,e.length);break;case oe:return qe([Ee(e,{value:fe(e.value,`@`,`@`+L)})],r);case ae:if(e.length)return ve(e.props,function(t){switch(H(t,/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:return qe([Ee(e,{props:[fe(t,/:(read-\w+)/,`:`+ie+`$1`)]})],r);case`::placeholder`:return qe([Ee(e,{props:[fe(t,/:(plac\w+)/,`:`+L+`input-$1`)]}),Ee(e,{props:[fe(t,/:(plac\w+)/,`:`+ie+`$1`)]}),Ee(e,{props:[fe(t,/:(plac\w+)/,re+`input-$1`)]})],r)}return``})}}],ot=function(e){var t=e.key;if(t===`css`){var n=document.querySelectorAll(`style[data-emotion]:not([data-s])`);Array.prototype.forEach.call(n,function(e){e.getAttribute(`data-emotion`).indexOf(` `)!==-1&&(document.head.appendChild(e),e.setAttribute(`data-s`,``))})}var r=e.stylisPlugins||at,i={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll(`style[data-emotion^="`+t+` "]`),function(e){for(var t=e.getAttribute(`data-emotion`).split(` `),n=1;n<t.length;n++)i[t[n]]=!0;o.push(e)});var s,c=[nt,rt],l,u=[Je,Xe(function(e){l.insert(e)})],d=Ye(c.concat(r,u)),f=function(e){return qe(He(e),d)};s=function(e,t,n,r){l=n,f(e?e+`{`+t.styles+`}`:t.styles),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new ne({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return p.sheet.hydrate(o),p},st=s((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),ct=s(((e,t)=>{t.exports=st()})),lt=s(((e,t)=>{var n=ct(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=a,s[n.Memo]=o;function c(e){return n.isMemo(e)?o:s[e.$$typeof]||r}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function h(e,t,n){if(typeof t!=`string`){if(m){var r=p(t);r&&r!==m&&h(e,r,n)}var a=u(t);d&&(a=a.concat(d(t)));for(var o=c(e),s=c(t),g=0;g<a.length;++g){var _=a[g];if(!i[_]&&!(n&&n[_])&&!(s&&s[_])&&!(o&&o[_])){var v=f(t,_);try{l(e,_,v)}catch{}}}}return e}t.exports=h})),ut=!0;function dt(e,t,n){var r=``;return n.split(` `).forEach(function(n){e[n]===void 0?n&&(r+=n+` `):t.push(e[n]+`;`)}),r}var ft=function(e,t,n){var r=e.key+`-`+t.name;(n===!1||ut===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},pt=function(e,t,n){ft(e,t,n);var r=e.key+`-`+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?`.`+r:``,i,e.sheet,!0),i=i.next;while(i!==void 0)}};function mt(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var ht={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},gt=!1,_t=/[A-Z]|^ms/g,vt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,yt=function(e){return e.charCodeAt(1)===45},bt=function(e){return e!=null&&typeof e!=`boolean`},xt=Ze(function(e){return yt(e)?e:e.replace(_t,`-$&`).toLowerCase()}),St=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(vt,function(e,t,n){return Dt={name:t,styles:n,next:Dt},t})}return ht[e]!==1&&!yt(e)&&typeof t==`number`&&t!==0?t+`px`:t},Ct=`Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.`;function wt(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return Dt={name:i.name,styles:i.styles,next:Dt},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Dt={name:o.name,styles:o.styles,next:Dt},o=o.next;return a.styles+`;`}return Tt(e,t,n);case`function`:if(e!==void 0){var s=Dt,c=n(e);return Dt=s,wt(e,t,c)}break}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function Tt(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=wt(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:bt(s)&&(r+=xt(a)+`:`+St(a,s)+`;`)}else{if(a===`NO_COMPONENT_SELECTOR`&&gt)throw Error(Ct);if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)bt(o[c])&&(r+=xt(a)+`:`+St(a,o[c])+`;`);else{var l=wt(e,t,o);switch(a){case`animation`:case`animationName`:r+=xt(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}}return r}var Et=/label:\s*([^\s;{]+)\s*(;|$)/g,Dt;function Ot(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;Dt=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=wt(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=wt(n,t,e[o]),r&&(i+=a[o]);Et.lastIndex=0;for(var s=``,c;(c=Et.exec(i))!==null;)s+=`-`+c[1];return{name:mt(i)+s,styles:i,next:Dt}}var W=u(p()),kt=function(e){return e()},At=W.useInsertionEffect?W.useInsertionEffect:!1,jt=At||kt,Mt=At||W.useLayoutEffect,Nt=W.createContext(typeof HTMLElement<`u`?ot({key:`css`}):null),Pt=Nt.Provider,Ft=function(e){return(0,W.forwardRef)(function(t,n){return e(t,(0,W.useContext)(Nt),n)})},It=W.createContext({}),Lt={}.hasOwnProperty,Rt=`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`,zt=function(e,t){var n={};for(var r in t)Lt.call(t,r)&&(n[r]=t[r]);return n[Rt]=e,n},Bt=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ft(t,n,r),jt(function(){return pt(t,n,r)}),null},Vt=Ft(function(e,t,n){var r=e.css;typeof r==`string`&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[Rt],a=[r],o=``;typeof e.className==`string`?o=dt(t.registered,a,e.className):e.className!=null&&(o=e.className+` `);var s=Ot(a,void 0,W.useContext(It));o+=t.key+`-`+s.name;var c={};for(var l in e)Lt.call(e,l)&&l!==`css`&&l!==Rt&&(c[l]=e[l]);return c.className=o,n&&(c.ref=n),W.createElement(W.Fragment,null,W.createElement(Bt,{cache:t,serialized:s,isStringTag:typeof i==`string`}),W.createElement(i,c))}),Ht=u(lt()),Ut=function(e,t){var n=arguments;if(t==null||!Lt.call(t,`css`))return W.createElement.apply(void 0,n);var r=n.length,i=Array(r);i[0]=Vt,i[1]=zt(e,t);for(var a=2;a<r;a++)i[a]=n[a];return W.createElement.apply(null,i)};(function(e){var t;(function(e){})(t||=e.JSX||={})})(Ut||={});var Wt=Ft(function(e,t){var n=e.styles,r=Ot([n],void 0,W.useContext(It)),i=W.useRef();return Mt(function(){var e=t.key+`-global`,n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,o=document.querySelector(`style[data-emotion="`+e+` `+r.name+`"]`);return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),o!==null&&(a=!0,o.setAttribute(`data-emotion`,e),n.hydrate([o])),i.current=[n,a],function(){n.flush()}},[t]),Mt(function(){var e=i.current,n=e[0];if(e[1]){e[1]=!1;return}r.next!==void 0&&pt(t,r.next,!0),n.tags.length&&(n.before=n.tags[n.tags.length-1].nextElementSibling,n.flush()),t.insert(``,r,n,!1)},[t,r.name]),null});function Gt(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ot(t)}function Kt(){var e=Gt.apply(void 0,arguments),t=`animation-`+e.name;return{name:t,styles:`@keyframes `+t+`{`+e.styles+`}`,anim:1,toString:function(){return`_EMO_`+this.name+`_`+this.styles+`_EMO_`}}}var qt=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Jt=Ze(function(e){return qt.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Yt=!1,Xt=Jt,Zt=function(e){return e!==`theme`},Qt=function(e){return typeof e==`string`&&e.charCodeAt(0)>96?Xt:Zt},$t=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return typeof r!=`function`&&n&&(r=e.__emotion_forwardProp),r},en=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ft(t,n,r),jt(function(){return pt(t,n,r)}),null},tn=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var s=$t(t,n,r),c=s||Qt(i),l=!c(`as`);return function(){var u=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&d.push(`label:`+a+`;`),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{var f=u[0];d.push(f[0]);for(var p=u.length,m=1;m<p;m++)d.push(u[m],f[m])}var h=Ft(function(e,t,n){var r=l&&e.as||i,a=``,u=[],f=e;if(e.theme==null){for(var p in f={},e)f[p]=e[p];f.theme=W.useContext(It)}typeof e.className==`string`?a=dt(t.registered,u,e.className):e.className!=null&&(a=e.className+` `);var m=Ot(d.concat(u),t.registered,f);a+=t.key+`-`+m.name,o!==void 0&&(a+=` `+o);var h=l&&s===void 0?Qt(r):c,g={};for(var _ in e)l&&_===`as`||h(_)&&(g[_]=e[_]);return g.className=a,n&&(g.ref=n),W.createElement(W.Fragment,null,W.createElement(en,{cache:t,serialized:m,isStringTag:typeof r==`string`}),W.createElement(r,g))});return h.displayName=a===void 0?`Styled(`+(typeof i==`string`?i:i.displayName||i.name||`Component`)+`)`:a,h.defaultProps=t.defaultProps,h.__emotion_real=h,h.__emotion_base=i,h.__emotion_styles=d,h.__emotion_forwardProp=s,Object.defineProperty(h,`toString`,{value:function(){return o===void 0&&Yt?`NO_COMPONENT_SELECTOR`:`.`+o}}),h.withComponent=function(t,r){return e(t,F({},n,r,{shouldForwardProp:$t(h,r,!0)})).apply(void 0,d)},h}},nn=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.big.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.marquee.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.foreignObject.g.image.line.linearGradient.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.text.tspan`.split(`.`),rn=tn.bind(null);nn.forEach(function(e){rn[e]=rn(e)});var an=s((e=>{var t=p(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),on=s(((e,t)=>{t.exports=an()}));M();var G=on(),sn=new Map,cn={insert:void 0},ln=(e,t)=>{let n=ot(e);return n.sheet=new t({key:n.key,nonce:n.sheet.nonce,container:n.sheet.container,speedy:n.sheet.isSpeedy,prepend:n.sheet.prepend,insertionPoint:n.sheet.insertionPoint}),n},un;if(typeof document==`object`&&(un=document.querySelector(`[name="emotion-insertion-point"]`),!un)){un=document.createElement(`meta`),un.setAttribute(`name`,`emotion-insertion-point`),un.setAttribute(`content`,``);let e=document.querySelector(`head`);e&&e.prepend(un)}function dn(e,t){if(e||t){class n extends ne{insert(e,t){return cn.insert?cn.insert(e,t):(this.key&&this.key.endsWith(`global`)&&(this.before=un),super.insert(e,t))}}let r=ln({key:`css`,insertionPoint:e?un:void 0},n);if(t){let e=r.insert;r.insert=(...t)=>(t[1].styles.match(/^@layer\s+[^{]*$/)||(t[1].styles=`@layer mui {${t[1].styles}}`),e(...t))}return r}}function fn(e){let{injectFirst:t,enableCssLayer:n,children:r}=e,i=W.useMemo(()=>{let e=`${t}-${n}`;if(typeof document==`object`&&sn.has(e))return sn.get(e);let r=dn(t,n);return sn.set(e,r),r},[t,n]);return i?(0,G.jsx)(Pt,{value:i,children:r}):r}M();function pn(e){return e==null||Object.keys(e).length===0}function mn(e){let{styles:t,defaultTheme:n={}}=e;return(0,G.jsx)(Wt,{styles:typeof t==`function`?e=>t(pn(e)?n:e):t})}function hn(e,t){return rn(e,t)}function gn(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}var _n=[];function vn(e){return _n[0]=e,Ot(_n)}var yn=s((e=>{var t=Symbol.for(`react.fragment`),n=Symbol.for(`react.strict_mode`),r=Symbol.for(`react.profiler`),i=Symbol.for(`react.consumer`),a=Symbol.for(`react.context`),o=Symbol.for(`react.forward_ref`),s=Symbol.for(`react.suspense`),c=Symbol.for(`react.suspense_list`),l=Symbol.for(`react.memo`),u=Symbol.for(`react.lazy`),d=Symbol.for(`react.client.reference`);e.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===t||e===r||e===n||e===s||e===c||typeof e==`object`&&e&&(e.$$typeof===u||e.$$typeof===l||e.$$typeof===a||e.$$typeof===i||e.$$typeof===o||e.$$typeof===d||e.getModuleId!==void 0))}})),bn=s(((e,t)=>{t.exports=yn()}))();function xn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Sn(e){if(W.isValidElement(e)||(0,bn.isValidElementType)(e)||!xn(e))return e;let t={};return Object.keys(e).forEach(n=>{t[n]=Sn(e[n])}),t}function Cn(e,t,n={clone:!0}){let r=n.clone?{...e}:e;return xn(e)&&xn(t)&&Object.keys(t).forEach(i=>{W.isValidElement(t[i])||(0,bn.isValidElementType)(t[i])?r[i]=t[i]:xn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&xn(e[i])?r[i]=Cn(e[i],t[i],n):n.clone?r[i]=xn(t[i])?Sn(t[i]):t[i]:r[i]=t[i]}),r}var wn=e=>{let t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>({...e,[t.key]:t.val}),{})};function Tn(e){let{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n=`px`,step:r=5,...i}=e,a=wn(t),o=Object.keys(a);function s(e){return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n})`}function c(e){return`@media (max-width:${(typeof t[e]==`number`?t[e]:e)-r/100}${n})`}function l(e,i){let a=o.indexOf(i);return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n}) and (max-width:${(a!==-1&&typeof t[o[a]]==`number`?t[o[a]]:i)-r/100}${n})`}function u(e){return o.indexOf(e)+1<o.length?l(e,o[o.indexOf(e)+1]):s(e)}function d(e){let t=o.indexOf(e);return t===0?s(o[1]):t===o.length-1?c(o[t]):l(e,o[o.indexOf(e)+1]).replace(`@media`,`@media not all and`)}return{keys:o,values:a,up:s,down:c,between:l,only:u,not:d,unit:n,...i}}function En(e,t){if(!e.containerQueries)return t;let n=Object.keys(t).filter(e=>e.startsWith(`@container`)).sort((e,t)=>{let n=/min-width:\s*([0-9.]+)/;return(e.match(n)?.[1]||0)-+(t.match(n)?.[1]||0)});return n.length?n.reduce((e,n)=>{let r=t[n];return delete e[n],e[n]=r,e},{...t}):t}function Dn(e,t){return t===`@`||t.startsWith(`@`)&&(e.some(e=>t.startsWith(`@${e}`))||!!t.match(/^@\d/))}function On(e,t){let n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;let[,r,i]=n,a=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(a)}function kn(e){let t=(e,t)=>e.replace(`@media`,t?`@container ${t}`:`@container`);function n(n,r){n.up=(...n)=>t(e.breakpoints.up(...n),r),n.down=(...n)=>t(e.breakpoints.down(...n),r),n.between=(...n)=>t(e.breakpoints.between(...n),r),n.only=(...n)=>t(e.breakpoints.only(...n),r),n.not=(...n)=>{let i=t(e.breakpoints.not(...n),r);return i.includes(`not all and`)?i.replace(`not all and `,``).replace(`min-width:`,`width<`).replace(`max-width:`,`width>`).replace(`and`,`or`):i}}let r={},i=e=>(n(r,e),r);return n(i),{...e,containerQueries:i}}var An={borderRadius:4};function jn(e,t){return t?Cn(e,t,{clone:!1}):e}M();var Mn={xs:0,sm:600,md:900,lg:1200,xl:1536},Nn={keys:[`xs`,`sm`,`md`,`lg`,`xl`],up:e=>`@media (min-width:${Mn[e]}px)`},Pn={containerQueries:e=>({up:t=>{let n=typeof t==`number`?t:Mn[t]||t;return typeof n==`number`&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Fn(e,t,n){let r=e.theme||{};if(Array.isArray(t)){let e=r.breakpoints||Nn;return t.reduce((r,i,a)=>(r[e.up(e.keys[a])]=n(t[a]),r),{})}if(typeof t==`object`){let e=r.breakpoints||Nn;return Object.keys(t).reduce((i,a)=>{if(Dn(e.keys,a)){let e=On(r.containerQueries?r:Pn,a);e&&(i[e]=n(t[a],a))}else if(Object.keys(e.values||Mn).includes(a)){let r=e.up(a);i[r]=n(t[a],a)}else{let e=a;i[e]=t[e]}return i},{})}return n(t)}function In(e={}){return e.keys?.reduce((t,n)=>{let r=e.up(n);return t[r]={},t},{})||{}}function Ln(e,t){return e.reduce((e,t)=>{let n=e[t];return(!n||Object.keys(n).length===0)&&delete e[t],e},t)}function Rn(e){if(typeof e!=`string`)throw Error(N(7));return e.charAt(0).toUpperCase()+e.slice(1)}function zn(e,t,n=!0){if(!t||typeof t!=`string`)return null;if(e&&e.vars&&n){let n=`vars.${t}`.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:null,e);if(n!=null)return n}return t.split(`.`).reduce((e,t)=>e&&e[t]!=null?e[t]:null,e)}function Bn(e,t,n,r=n){let i;return i=typeof e==`function`?e(n):Array.isArray(e)?e[n]||r:zn(e,n)||r,t&&(i=t(i,r,e)),i}function Vn(e){let{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,a=e=>{if(e[t]==null)return null;let a=e[t],o=e.theme,s=zn(o,r)||{};return Fn(e,a,e=>{let r=Bn(s,i,e);return e===r&&typeof e==`string`&&(r=Bn(s,i,`${t}${e===`default`?``:Rn(e)}`,e)),n===!1?r:{[n]:r}})};return a.propTypes={},a.filterProps=[t],a}function Hn(e){let t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}var Un={m:`margin`,p:`padding`},Wn={t:`Top`,r:`Right`,b:`Bottom`,l:`Left`,x:[`Left`,`Right`],y:[`Top`,`Bottom`]},Gn={marginX:`mx`,marginY:`my`,paddingX:`px`,paddingY:`py`},Kn=Hn(e=>{if(e.length>2)if(Gn[e])e=Gn[e];else return[e];let[t,n]=e.split(``),r=Un[t],i=Wn[n]||``;return Array.isArray(i)?i.map(e=>r+e):[r+i]}),qn=[`m`,`mt`,`mr`,`mb`,`ml`,`mx`,`my`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginX`,`marginY`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`],Jn=[`p`,`pt`,`pr`,`pb`,`pl`,`px`,`py`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingX`,`paddingY`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`],Yn=[...qn,...Jn];function Xn(e,t,n,r){let i=zn(e,t,!0)??n;return typeof i==`number`||typeof i==`string`?e=>typeof e==`string`?e:typeof i==`string`?i.startsWith(`var(`)&&e===0?0:i.startsWith(`var(`)&&e===1?i:`calc(${e} * ${i})`:i*e:Array.isArray(i)?e=>{if(typeof e==`string`)return e;let t=i[Math.abs(e)];return e>=0?t:typeof t==`number`?-t:typeof t==`string`&&t.startsWith(`var(`)?`calc(-1 * ${t})`:`-${t}`}:typeof i==`function`?i:()=>void 0}function Zn(e){return Xn(e,`spacing`,8,`spacing`)}function Qn(e,t){return typeof t==`string`||t==null?t:e(t)}function $n(e,t){return n=>e.reduce((e,r)=>(e[r]=Qn(t,n),e),{})}function er(e,t,n,r){if(!t.includes(n))return null;let i=$n(Kn(n),r),a=e[n];return Fn(e,a,i)}function tr(e,t){let n=Zn(e.theme);return Object.keys(e).map(r=>er(e,t,r,n)).reduce(jn,{})}function nr(e){return tr(e,qn)}nr.propTypes={},nr.filterProps=qn;function rr(e){return tr(e,Jn)}rr.propTypes={},rr.filterProps=Jn;function ir(e){return tr(e,Yn)}ir.propTypes={},ir.filterProps=Yn;function ar(e=8,t=Zn({spacing:e})){if(e.mui)return e;let n=(...e)=>(e.length===0?[1]:e).map(e=>{let n=t(e);return typeof n==`number`?`${n}px`:n}).join(` `);return n.mui=!0,n}function or(...e){let t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?jn(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function sr(e){return typeof e==`number`?`${e}px solid`:e}function cr(e,t){return Vn({prop:e,themeKey:`borders`,transform:t})}var lr=cr(`border`,sr),ur=cr(`borderTop`,sr),dr=cr(`borderRight`,sr),fr=cr(`borderBottom`,sr),pr=cr(`borderLeft`,sr),mr=cr(`borderColor`),hr=cr(`borderTopColor`),gr=cr(`borderRightColor`),_r=cr(`borderBottomColor`),vr=cr(`borderLeftColor`),yr=cr(`outline`,sr),br=cr(`outlineColor`),xr=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){let t=Xn(e.theme,`shape.borderRadius`,4,`borderRadius`);return Fn(e,e.borderRadius,e=>({borderRadius:Qn(t,e)}))}return null};xr.propTypes={},xr.filterProps=[`borderRadius`],or(lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,xr,yr,br);var Sr=e=>{if(e.gap!==void 0&&e.gap!==null){let t=Xn(e.theme,`spacing`,8,`gap`);return Fn(e,e.gap,e=>({gap:Qn(t,e)}))}return null};Sr.propTypes={},Sr.filterProps=[`gap`];var Cr=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){let t=Xn(e.theme,`spacing`,8,`columnGap`);return Fn(e,e.columnGap,e=>({columnGap:Qn(t,e)}))}return null};Cr.propTypes={},Cr.filterProps=[`columnGap`];var wr=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){let t=Xn(e.theme,`spacing`,8,`rowGap`);return Fn(e,e.rowGap,e=>({rowGap:Qn(t,e)}))}return null};wr.propTypes={},wr.filterProps=[`rowGap`],or(Sr,Cr,wr,Vn({prop:`gridColumn`}),Vn({prop:`gridRow`}),Vn({prop:`gridAutoFlow`}),Vn({prop:`gridAutoColumns`}),Vn({prop:`gridAutoRows`}),Vn({prop:`gridTemplateColumns`}),Vn({prop:`gridTemplateRows`}),Vn({prop:`gridTemplateAreas`}),Vn({prop:`gridArea`}));function Tr(e,t){return t===`grey`?t:e}or(Vn({prop:`color`,themeKey:`palette`,transform:Tr}),Vn({prop:`bgcolor`,cssProperty:`backgroundColor`,themeKey:`palette`,transform:Tr}),Vn({prop:`backgroundColor`,themeKey:`palette`,transform:Tr}));function Er(e){return e<=1&&e!==0?`${e*100}%`:e}var Dr=Vn({prop:`width`,transform:Er}),Or=e=>e.maxWidth!==void 0&&e.maxWidth!==null?Fn(e,e.maxWidth,t=>{let n=e.theme?.breakpoints?.values?.[t]||Mn[t];return n?e.theme?.breakpoints?.unit===`px`?{maxWidth:n}:{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:Er(t)}}):null;Or.filterProps=[`maxWidth`];var kr=Vn({prop:`minWidth`,transform:Er}),Ar=Vn({prop:`height`,transform:Er}),jr=Vn({prop:`maxHeight`,transform:Er}),Mr=Vn({prop:`minHeight`,transform:Er});Vn({prop:`size`,cssProperty:`width`,transform:Er}),Vn({prop:`size`,cssProperty:`height`,transform:Er}),or(Dr,Or,kr,Ar,jr,Mr,Vn({prop:`boxSizing`}));var Nr={border:{themeKey:`borders`,transform:sr},borderTop:{themeKey:`borders`,transform:sr},borderRight:{themeKey:`borders`,transform:sr},borderBottom:{themeKey:`borders`,transform:sr},borderLeft:{themeKey:`borders`,transform:sr},borderColor:{themeKey:`palette`},borderTopColor:{themeKey:`palette`},borderRightColor:{themeKey:`palette`},borderBottomColor:{themeKey:`palette`},borderLeftColor:{themeKey:`palette`},outline:{themeKey:`borders`,transform:sr},outlineColor:{themeKey:`palette`},borderRadius:{themeKey:`shape.borderRadius`,style:xr},color:{themeKey:`palette`,transform:Tr},bgcolor:{themeKey:`palette`,cssProperty:`backgroundColor`,transform:Tr},backgroundColor:{themeKey:`palette`,transform:Tr},p:{style:rr},pt:{style:rr},pr:{style:rr},pb:{style:rr},pl:{style:rr},px:{style:rr},py:{style:rr},padding:{style:rr},paddingTop:{style:rr},paddingRight:{style:rr},paddingBottom:{style:rr},paddingLeft:{style:rr},paddingX:{style:rr},paddingY:{style:rr},paddingInline:{style:rr},paddingInlineStart:{style:rr},paddingInlineEnd:{style:rr},paddingBlock:{style:rr},paddingBlockStart:{style:rr},paddingBlockEnd:{style:rr},m:{style:nr},mt:{style:nr},mr:{style:nr},mb:{style:nr},ml:{style:nr},mx:{style:nr},my:{style:nr},margin:{style:nr},marginTop:{style:nr},marginRight:{style:nr},marginBottom:{style:nr},marginLeft:{style:nr},marginX:{style:nr},marginY:{style:nr},marginInline:{style:nr},marginInlineStart:{style:nr},marginInlineEnd:{style:nr},marginBlock:{style:nr},marginBlockStart:{style:nr},marginBlockEnd:{style:nr},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Sr},rowGap:{style:wr},columnGap:{style:Cr},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:`zIndex`},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:`shadows`},width:{transform:Er},maxWidth:{style:Or},minWidth:{transform:Er},height:{transform:Er},maxHeight:{transform:Er},minHeight:{transform:Er},boxSizing:{},font:{themeKey:`font`},fontFamily:{themeKey:`typography`},fontSize:{themeKey:`typography`},fontStyle:{themeKey:`typography`},fontWeight:{themeKey:`typography`},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:`typography`}};function Pr(...e){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),n=new Set(t);return e.every(e=>n.size===Object.keys(e).length)}function Fr(e,t){return typeof e==`function`?e(t):e}function Ir(){function e(e,t,n,r){let i={[e]:t,theme:n},a=r[e];if(!a)return{[e]:t};let{cssProperty:o=e,themeKey:s,transform:c,style:l}=a;if(t==null)return null;if(s===`typography`&&t===`inherit`)return{[e]:t};let u=zn(n,s)||{};return l?l(i):Fn(i,t,t=>{let n=Bn(u,c,t);return t===n&&typeof t==`string`&&(n=Bn(u,c,`${e}${t===`default`?``:Rn(t)}`,t)),o===!1?n:{[o]:n}})}function t(n){let{sx:r,theme:i={},nested:a}=n||{};if(!r)return null;let o=i.unstable_sxConfig??Nr;function s(n){let r=n;if(typeof n==`function`)r=n(i);else if(typeof n!=`object`)return n;if(!r)return null;let s=In(i.breakpoints),c=Object.keys(s),l=s;return Object.keys(r).forEach(n=>{let a=Fr(r[n],i);if(a!=null)if(typeof a==`object`)if(o[n])l=jn(l,e(n,a,i,o));else{let e=Fn({theme:i},a,e=>({[n]:e}));Pr(e,a)?l[n]=t({sx:a,theme:i,nested:!0}):l=jn(l,e)}else l=jn(l,e(n,a,i,o))}),!a&&i.modularCssLayers?{"@layer sx":En(i,Ln(c,l))}:En(i,Ln(c,l))}return Array.isArray(r)?r.map(s):s(r)}return t}var Lr=Ir();Lr.filterProps=[`sx`];function Rr(e,t){let n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!=`function`)return{};let r=n.getColorSchemeSelector(e);return r===`&`?t:((r.includes(`data-`)||r.includes(`.`))&&(r=`*:where(${r.replace(/\s*&$/,``)}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function zr(e={},...t){let{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,s=Tn(n),c=ar(i),l=Cn({breakpoints:s,direction:`ltr`,components:{},palette:{mode:`light`,...r},spacing:c,shape:{...An,...a}},o);return l=kn(l),l.applyStyles=Rr,l=t.reduce((e,t)=>Cn(e,t),l),l.unstable_sxConfig={...Nr,...o?.unstable_sxConfig},l.unstable_sx=function(e){return Lr({sx:e,theme:this})},l}function Br(e){return Object.keys(e).length===0}function Vr(e=null){let t=W.useContext(It);return!t||Br(t)?e:t}var Hr=zr();function Ur(e=Hr){return Vr(e)}M();function Wr(e){let t=vn(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Gr({styles:e,themeId:t,defaultTheme:n={}}){let r=Ur(n),i=t&&r[t]||r,a=typeof e==`function`?e(i):e;return i.modularCssLayers&&(a=Array.isArray(a)?a.map(e=>Wr(typeof e==`function`?e(i):e)):Wr(a)),(0,G.jsx)(mn,{styles:a})}var Kr=e=>{let t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Nr;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function qr(e){let{sx:t,...n}=e,{systemProps:r,otherProps:i}=Kr(n),a;return a=Array.isArray(t)?[r,...t]:typeof t==`function`?(...e)=>{let n=t(...e);return xn(n)?{...r,...n}:r}:{...r,...t},{...i,sx:a}}var Jr=e=>e,Yr=(()=>{let e=Jr;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Jr}}})();function Xr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Xr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function K(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Xr(e))&&(r&&(r+=` `),r+=t);return r}var Zr={active:`active`,checked:`checked`,completed:`completed`,disabled:`disabled`,error:`error`,expanded:`expanded`,focused:`focused`,focusVisible:`focusVisible`,open:`open`,readOnly:`readOnly`,required:`required`,selected:`selected`};function Qr(e,t,n=`Mui`){let r=Zr[t];return r?`${n}-${r}`:`${Yr.generate(e)}-${t}`}function $r(e,t,n=`Mui`){let r={};return t.forEach(t=>{r[t]=Qr(e,t,n)}),r}function ei(e){let{variants:t,...n}=e,r={variants:t,style:vn(n),isProcessed:!0};return r.style===n||t&&t.forEach(e=>{typeof e.style!=`function`&&(e.style=vn(e.style))}),r}var ti=zr();function ni(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}function ri(e,t){return t&&e&&typeof e==`object`&&e.styles&&!e.styles.startsWith(`@layer`)&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function ii(e){return e?(t,n)=>n[e]:null}function ai(e,t,n){e.theme=li(e.theme)?n:e.theme[t]||e.theme}function oi(e,t,n){let r=typeof t==`function`?t(e):t;if(Array.isArray(r))return r.flatMap(t=>oi(e,t,n));if(Array.isArray(r?.variants)){let t;if(r.isProcessed)t=n?ri(r.style,n):r.style;else{let{variants:e,...i}=r;t=n?ri(vn(i),n):i}return si(e,r.variants,[t],n)}return r?.isProcessed?n?ri(vn(r.style),n):r.style:n?ri(vn(r),n):r}function si(e,t,n=[],r=void 0){let i;variantLoop:for(let a=0;a<t.length;a+=1){let o=t[a];if(typeof o.props==`function`){if(i??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(i))continue}else for(let t in o.props)if(e[t]!==o.props[t]&&e.ownerState?.[t]!==o.props[t])continue variantLoop;typeof o.style==`function`?(i??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?ri(vn(o.style(i)),r):o.style(i))):n.push(r?ri(vn(o.style),r):o.style)}return n}function ci(e={}){let{themeId:t,defaultTheme:n=ti,rootShouldForwardProp:r=ni,slotShouldForwardProp:i=ni}=e;function a(e){ai(e,t,n)}return(e,t={})=>{gn(e,e=>e.filter(e=>e!==Lr));let{name:n,slot:o,skipVariantsResolver:s,skipSx:c,overridesResolver:l=ii(di(o)),...u}=t,d=n&&n.startsWith(`Mui`)||o?`components`:`custom`,f=s===void 0?o&&o!==`Root`&&o!==`root`||!1:s,p=c||!1,m=ni;o===`Root`||o===`root`?m=r:o?m=i:ui(e)&&(m=void 0);let h=hn(e,{shouldForwardProp:m,label:void 0,...u}),g=e=>{if(e.__emotion_real===e)return e;if(typeof e==`function`)return function(t){return oi(t,e,t.theme.modularCssLayers?d:void 0)};if(xn(e)){let t=ei(e);return function(e){return t.variants?oi(e,t,e.theme.modularCssLayers?d:void 0):e.theme.modularCssLayers?ri(t.style,d):t.style}}return e},_=(...t)=>{let r=[],i=t.map(g),o=[];if(r.push(a),n&&l&&o.push(function(e){let t=e.theme.components?.[n]?.styleOverrides;if(!t)return null;let r={};for(let n in t)r[n]=oi(e,t[n],e.theme.modularCssLayers?`theme`:void 0);return l(e,r)}),n&&!f&&o.push(function(e){let t=e.theme?.components?.[n]?.variants;return t?si(e,t,[],e.theme.modularCssLayers?`theme`:void 0):null}),p||o.push(Lr),Array.isArray(i[0])){let e=i.shift(),t=Array(r.length).fill(``),n=Array(o.length).fill(``),a;a=[...t,...e,...n],a.raw=[...t,...e.raw,...n],r.unshift(a)}let s=h(...r,...i,...o);return e.muiName&&(s.muiName=e.muiName),s};return h.withConfig&&(_.withConfig=h.withConfig),_}}function li(e){for(let t in e)return!1;return!0}function ui(e){return typeof e==`string`&&e.charCodeAt(0)>96}function di(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function fi(e,t,n=!1){let r={...t};for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let a=i;if(a===`components`||a===`slots`)r[a]={...e[a],...r[a]};else if(a===`componentsProps`||a===`slotProps`){let i=e[a],o=t[a];if(!o)r[a]=i||{};else if(!i)r[a]=o;else{r[a]={...o};for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let t=e;r[a][t]=fi(i[t],o[t],n)}}}else a===`className`&&n&&t.className?r.className=K(e?.className,t?.className):a===`style`&&n&&t.style?r.style={...e?.style,...t?.style}:r[a]===void 0&&(r[a]=e[a])}return r}var pi=typeof window<`u`?W.useLayoutEffect:W.useEffect;function mi(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function hi(e,t=0,n=1){return mi(e,t,n)}function gi(e){e=e.slice(1);let t=RegExp(`.{1,${e.length>=6?2:1}}`,`g`),n=e.match(t);return n&&n[0].length===1&&(n=n.map(e=>e+e)),n?`rgb${n.length===4?`a`:``}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(`, `)})`:``}function _i(e){if(e.type)return e;if(e.charAt(0)===`#`)return _i(gi(e));let t=e.indexOf(`(`),n=e.substring(0,t);if(![`rgb`,`rgba`,`hsl`,`hsla`,`color`].includes(n))throw Error(N(9,e));let r=e.substring(t+1,e.length-1),i;if(n===`color`){if(r=r.split(` `),i=r.shift(),r.length===4&&r[3].charAt(0)===`/`&&(r[3]=r[3].slice(1)),![`srgb`,`display-p3`,`a98-rgb`,`prophoto-rgb`,`rec-2020`].includes(i))throw Error(N(10,i))}else r=r.split(`,`);return r=r.map(e=>parseFloat(e)),{type:n,values:r,colorSpace:i}}var vi=e=>{let t=_i(e);return t.values.slice(0,3).map((e,n)=>t.type.includes(`hsl`)&&n!==0?`${e}%`:e).join(` `)},yi=(e,t)=>{try{return vi(e)}catch{return e}};function bi(e){let{type:t,colorSpace:n}=e,{values:r}=e;return t.includes(`rgb`)?r=r.map((e,t)=>t<3?parseInt(e,10):e):t.includes(`hsl`)&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=t.includes(`color`)?`${n} ${r.join(` `)}`:`${r.join(`, `)}`,`${t}(${r})`}function xi(e){e=_i(e);let{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),o=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1),s=`rgb`,c=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type===`hsla`&&(s+=`a`,c.push(t[3])),bi({type:s,values:c})}function Si(e){e=_i(e);let t=e.type===`hsl`||e.type===`hsla`?_i(xi(e)).values:e.values;return t=t.map(t=>(e.type!==`color`&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Ci(e,t){let n=Si(e),r=Si(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function wi(e,t){return e=_i(e),t=hi(t),(e.type===`rgb`||e.type===`hsl`)&&(e.type+=`a`),e.type===`color`?e.values[3]=`/${t}`:e.values[3]=t,bi(e)}function Ti(e,t,n){try{return wi(e,t)}catch{return e}}function Ei(e,t){if(e=_i(e),t=hi(t),e.type.includes(`hsl`))e.values[2]*=1-t;else if(e.type.includes(`rgb`)||e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return bi(e)}function Di(e,t,n){try{return Ei(e,t)}catch{return e}}function Oi(e,t){if(e=_i(e),t=hi(t),e.type.includes(`hsl`))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes(`rgb`))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return bi(e)}function ki(e,t,n){try{return Oi(e,t)}catch{return e}}function Ai(e,t=.15){return Si(e)>.5?Ei(e,t):Oi(e,t)}function ji(e,t,n){try{return Ai(e,t)}catch{return e}}var Mi=W.createContext(null);function Ni(){return W.useContext(Mi)}var Pi=typeof Symbol==`function`&&Symbol.for?Symbol.for(`mui.nested`):`__THEME_NESTED__`;M();function Fi(e,t){return typeof t==`function`?t(e):{...e,...t}}function Ii(e){let{children:t,theme:n}=e,r=Ni(),i=W.useMemo(()=>{let e=r===null?{...n}:Fi(r,n);return e!=null&&(e[Pi]=r!==null),e},[n,r]);return(0,G.jsx)(Mi.Provider,{value:i,children:t})}M();var Li=W.createContext();function Ri({value:e,...t}){return(0,G.jsx)(Li.Provider,{value:e??!0,...t})}var zi=()=>W.useContext(Li)??!1;M();var Bi=W.createContext(void 0);function Vi({value:e,children:t}){return(0,G.jsx)(Bi.Provider,{value:e,children:t})}function Hi(e){let{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;let i=t.components[n];return i.defaultProps?fi(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?fi(i,r,t.components.mergeClassNameAndStyle):r}function Ui({props:e,name:t}){return Hi({props:e,name:t,theme:{components:W.useContext(Bi)}})}var Wi=0;function Gi(e){let[t,n]=W.useState(e),r=e||t;return W.useEffect(()=>{t??(Wi+=1,n(`mui-${Wi}`))},[t]),r}var Ki={...W}.useId;function qi(e){if(Ki!==void 0){let t=Ki();return e??t}return Gi(e)}function Ji(e){let t=Vr(),n=qi()||``,{modularCssLayers:r}=e,i=`mui.global, mui.components, mui.theme, mui.custom, mui.sx`;return i=!r||t!==null?``:typeof r==`string`?r.replace(/mui(?!\.)/g,i):`@layer ${i};`,pi(()=>{let e=document.querySelector(`head`);if(!e)return;let t=e.firstChild;if(i){if(t&&t.hasAttribute?.(`data-mui-layer-order`)&&t.getAttribute(`data-mui-layer-order`)===n)return;let r=document.createElement(`style`);r.setAttribute(`data-mui-layer-order`,n),r.textContent=i,e.prepend(r)}else e.querySelector(`style[data-mui-layer-order="${n}"]`)?.remove()},[i,n]),i?(0,G.jsx)(Gr,{styles:i}):null}M();var Yi={};function Xi(e,t,n,r=!1){return W.useMemo(()=>{let i=e&&t[e]||t;if(typeof n==`function`){let a=n(i),o=e?{...t,[e]:a}:a;return r?()=>o:o}return e?{...t,[e]:n}:{...t,...n}},[e,t,n,r])}function Zi(e){let{children:t,theme:n,themeId:r}=e,i=Vr(Yi),a=Ni()||Yi,o=Xi(r,i,n),s=Xi(r,a,n,!0),c=(r?o[r]:o).direction===`rtl`,l=Ji(o);return(0,G.jsx)(Ii,{theme:s,children:(0,G.jsx)(It.Provider,{value:o,children:(0,G.jsx)(Ri,{value:c,children:(0,G.jsxs)(Vi,{value:r?o[r].components:o.components,children:[l,t]})})})})}var Qi={theme:void 0};function $i(e){let t,n;return function(r){let i=t;return(i===void 0||r.theme!==n)&&(Qi.theme=r.theme,i=ei(e(Qi)),t=i,n=r.theme),i}}var ea=`mode`,ta=`color-scheme`,na=`data-color-scheme`;function ra(e){let{defaultMode:t=`system`,defaultLightColorScheme:n=`light`,defaultDarkColorScheme:r=`dark`,modeStorageKey:i=ea,colorSchemeStorageKey:a=ta,attribute:o=na,colorSchemeNode:s=`document.documentElement`,nonce:c}=e||{},l=``,u=o;if(o===`class`&&(u=`.%s`),o===`data`&&(u=`[data-%s]`),u.startsWith(`.`)){let e=u.substring(1);l+=`${s}.classList.remove('${e}'.replace('%s', light), '${e}'.replace('%s', dark));
9
- ${s}.classList.add('${e}'.replace('%s', colorScheme));`}let d=u.match(/\[([^[\]]+)\]/);if(d){let[e,t]=d[1].split(`=`);t||(l+=`${s}.removeAttribute('${e}'.replace('%s', light));
10
- ${s}.removeAttribute('${e}'.replace('%s', dark));`),l+=`
11
- ${s}.setAttribute('${e}'.replace('%s', colorScheme), ${t?`${t}.replace('%s', colorScheme)`:`""`});`}else u!==`.%s`&&(l+=`${s}.setAttribute('${u}', colorScheme);`);return(0,G.jsx)(`script`,{suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(function() {
12
- try {
13
- let colorScheme = '';
14
- const mode = localStorage.getItem('${i}') || '${t}';
15
- const dark = localStorage.getItem('${a}-dark') || '${r}';
16
- const light = localStorage.getItem('${a}-light') || '${n}';
17
- if (mode === 'system') {
18
- // handle system mode
19
- const mql = window.matchMedia('(prefers-color-scheme: dark)');
20
- if (mql.matches) {
21
- colorScheme = dark
22
- } else {
23
- colorScheme = light
24
- }
25
- }
26
- if (mode === 'light') {
27
- colorScheme = light;
28
- }
29
- if (mode === 'dark') {
30
- colorScheme = dark;
31
- }
32
- if (colorScheme) {
33
- ${l}
34
- }
35
- } catch(e){}})();`}},`mui-color-scheme-init`)}function ia(){}var aa=({key:e,storageWindow:t})=>(!t&&typeof window<`u`&&(t=window),{get(n){if(typeof window>`u`)return;if(!t)return n;let r;try{r=t.localStorage.getItem(e)}catch{}return r||n},set:n=>{if(t)try{t.localStorage.setItem(e,n)}catch{}},subscribe:n=>{if(!t)return ia;let r=t=>{let r=t.newValue;t.key===e&&n(r)};return t.addEventListener(`storage`,r),()=>{t.removeEventListener(`storage`,r)}}});function oa(){}function sa(e){if(typeof window<`u`&&typeof window.matchMedia==`function`&&e===`system`)return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function ca(e,t){if(e.mode===`light`||e.mode===`system`&&e.systemMode===`light`)return t(`light`);if(e.mode===`dark`||e.mode===`system`&&e.systemMode===`dark`)return t(`dark`)}function la(e){return ca(e,t=>{if(t===`light`)return e.lightColorScheme;if(t===`dark`)return e.darkColorScheme})}function ua(e){let{defaultMode:t=`light`,defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:a=ea,colorSchemeStorageKey:o=ta,storageWindow:s=typeof window>`u`?void 0:window,storageManager:c=aa,noSsr:l=!1}=e,u=i.join(`,`),d=i.length>1,f=W.useMemo(()=>c?.({key:a,storageWindow:s}),[c,a,s]),p=W.useMemo(()=>c?.({key:`${o}-light`,storageWindow:s}),[c,o,s]),m=W.useMemo(()=>c?.({key:`${o}-dark`,storageWindow:s}),[c,o,s]),[h,g]=W.useState(()=>{let e=f?.get(t)||t,i=p?.get(n)||n,a=m?.get(r)||r;return{mode:e,systemMode:sa(e),lightColorScheme:i,darkColorScheme:a}}),[_,v]=W.useState(l||!d);W.useEffect(()=>{v(!0)},[]);let y=la(h),b=W.useCallback(e=>{g(n=>{if(e===n.mode)return n;let r=e??t;return f?.set(r),{...n,mode:r,systemMode:sa(r)}})},[f,t]),x=W.useCallback(e=>{e?typeof e==`string`?e&&!u.includes(e)?console.error(`\`${e}\` does not exist in \`theme.colorSchemes\`.`):g(t=>{let n={...t};return ca(t,t=>{t===`light`&&(p?.set(e),n.lightColorScheme=e),t===`dark`&&(m?.set(e),n.darkColorScheme=e)}),n}):g(t=>{let i={...t},a=e.light===null?n:e.light,o=e.dark===null?r:e.dark;return a&&(u.includes(a)?(i.lightColorScheme=a,p?.set(a)):console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)),o&&(u.includes(o)?(i.darkColorScheme=o,m?.set(o)):console.error(`\`${o}\` does not exist in \`theme.colorSchemes\`.`)),i}):g(e=>(p?.set(n),m?.set(r),{...e,lightColorScheme:n,darkColorScheme:r}))},[u,p,m,n,r]),S=W.useCallback(e=>{h.mode===`system`&&g(t=>{let n=e?.matches?`dark`:`light`;return t.systemMode===n?t:{...t,systemMode:n}})},[h.mode]),C=W.useRef(S);return C.current=S,W.useEffect(()=>{if(typeof window.matchMedia!=`function`||!d)return;let e=(...e)=>C.current(...e),t=window.matchMedia(`(prefers-color-scheme: dark)`);return t.addListener(e),e(t),()=>{t.removeListener(e)}},[d]),W.useEffect(()=>{if(d){let e=f?.subscribe(e=>{(!e||[`light`,`dark`,`system`].includes(e))&&b(e||t)})||oa,n=p?.subscribe(e=>{(!e||u.match(e))&&x({light:e})})||oa,r=m?.subscribe(e=>{(!e||u.match(e))&&x({dark:e})})||oa;return()=>{e(),n(),r()}}},[x,b,u,t,s,d,f,p,m]),{...h,mode:_?h.mode:void 0,systemMode:_?h.systemMode:void 0,colorScheme:_?y:void 0,setMode:b,setColorScheme:x}}M();var da=`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function fa(e){let{themeId:t,theme:n={},modeStorageKey:r=ea,colorSchemeStorageKey:i=ta,disableTransitionOnChange:a=!1,defaultColorScheme:o,resolveTheme:s}=e,c={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},l=W.createContext(void 0),u=()=>W.useContext(l)||c,d={},f={};function p(e){let{children:c,theme:u,modeStorageKey:p=r,colorSchemeStorageKey:m=i,disableTransitionOnChange:h=a,storageManager:g,storageWindow:_=typeof window>`u`?void 0:window,documentNode:v=typeof document>`u`?void 0:document,colorSchemeNode:y=typeof document>`u`?void 0:document.documentElement,disableNestedContext:b=!1,disableStyleSheetGeneration:x=!1,defaultMode:S=`system`,forceThemeRerender:C=!1,noSsr:w}=e,T=W.useRef(!1),E=Ni(),D=W.useContext(l),O=!!D&&!b,k=W.useMemo(()=>u||(typeof n==`function`?n():n),[u]),A=k[t],j=A||k,{colorSchemes:M=d,components:N=f,cssVarPrefix:P}=j,F=Object.keys(M).filter(e=>!!M[e]).join(`,`),ee=W.useMemo(()=>F.split(`,`),[F]),te=typeof o==`string`?o:o.light,I=typeof o==`string`?o:o.dark,{mode:ne,setMode:re,systemMode:ie,lightColorScheme:L,darkColorScheme:R,colorScheme:ae,setColorScheme:z}=ua({supportedColorSchemes:ee,defaultLightColorScheme:te,defaultDarkColorScheme:I,modeStorageKey:p,colorSchemeStorageKey:m,defaultMode:M[te]&&M[I]?S:M[j.defaultColorScheme]?.palette?.mode||j.palette?.mode,storageManager:g,storageWindow:_,noSsr:w}),B=ne,oe=ae;O&&(B=D.mode,oe=D.colorScheme);let se=oe||j.defaultColorScheme;j.vars&&!C&&(se=j.defaultColorScheme);let ce=W.useMemo(()=>{let e=j.generateThemeVars?.()||j.vars,t={...j,components:N,colorSchemes:M,cssVarPrefix:P,vars:e};if(typeof t.generateSpacing==`function`&&(t.spacing=t.generateSpacing()),se){let e=M[se];e&&typeof e==`object`&&Object.keys(e).forEach(n=>{e[n]&&typeof e[n]==`object`?t[n]={...t[n],...e[n]}:t[n]=e[n]})}return s?s(t):t},[j,se,N,M,P]),V=j.colorSchemeSelector;pi(()=>{if(oe&&y&&V&&V!==`media`){let e=V,t=V;if(e===`class`&&(t=`.%s`),e===`data`&&(t=`[data-%s]`),e?.startsWith(`data-`)&&!e.includes(`%s`)&&(t=`[${e}="%s"]`),t.startsWith(`.`))y.classList.remove(...ee.map(e=>t.substring(1).replace(`%s`,e))),y.classList.add(t.substring(1).replace(`%s`,oe));else{let e=t.replace(`%s`,oe).match(/\[([^\]]+)\]/);if(e){let[t,n]=e[1].split(`=`);n||ee.forEach(e=>{y.removeAttribute(t.replace(oe,e))}),y.setAttribute(t,n?n.replace(/"|'/g,``):``)}else y.setAttribute(t,oe)}}},[oe,V,y,ee]),W.useEffect(()=>{let e;if(h&&T.current&&v){let t=v.createElement(`style`);t.appendChild(v.createTextNode(da)),v.head.appendChild(t),window.getComputedStyle(v.body),e=setTimeout(()=>{v.head.removeChild(t)},1)}return()=>{clearTimeout(e)}},[oe,h,v]),W.useEffect(()=>(T.current=!0,()=>{T.current=!1}),[]);let le=W.useMemo(()=>({allColorSchemes:ee,colorScheme:oe,darkColorScheme:R,lightColorScheme:L,mode:B,setColorScheme:z,setMode:re,systemMode:ie}),[ee,oe,R,L,B,z,re,ie,ce.colorSchemeSelector]),ue=!0;(x||j.cssVariables===!1||O&&E?.cssVarPrefix===P)&&(ue=!1);let de=(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(Zi,{themeId:A?t:void 0,theme:ce,children:c}),ue&&(0,G.jsx)(mn,{styles:ce.generateStyleSheets?.()||[]})]});return O?de:(0,G.jsx)(l.Provider,{value:le,children:de})}let m=typeof o==`string`?o:o.light,h=typeof o==`string`?o:o.dark;return{CssVarsProvider:p,useColorScheme:u,getInitColorSchemeScript:e=>ra({colorSchemeStorageKey:i,defaultLightColorScheme:m,defaultDarkColorScheme:h,modeStorageKey:r,...e})}}function pa(e=``){function t(...n){if(!n.length)return``;let r=n[0];return typeof r==`string`&&!r.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:``}${r}${t(...n.slice(1))})`:`, ${r}`}return(n,...r)=>`var(--${e?`${e}-`:``}${n}${t(...r)})`}var ma=(e,t,n,r=[])=>{let i=e;t.forEach((e,a)=>{a===t.length-1?Array.isArray(i)?i[Number(e)]=n:i&&typeof i==`object`&&(i[e]=n):i&&typeof i==`object`&&(i[e]||(i[e]=r.includes(e)?[]:{}),i=i[e])})},ha=(e,t,n)=>{function r(e,i=[],a=[]){Object.entries(e).forEach(([e,o])=>{(!n||n&&!n([...i,e]))&&o!=null&&(typeof o==`object`&&Object.keys(o).length>0?r(o,[...i,e],Array.isArray(o)?[...a,e]:a):t([...i,e],o,a))})}r(e)},ga=(e,t)=>typeof t==`number`?[`lineHeight`,`fontWeight`,`opacity`,`zIndex`].some(t=>e.includes(t))||e[e.length-1].toLowerCase().includes(`opacity`)?t:`${t}px`:t;function _a(e,t){let{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return ha(e,(e,t,s)=>{if((typeof t==`string`||typeof t==`number`)&&(!r||!r(e,t))){let r=`--${n?`${n}-`:``}${e.join(`-`)}`,c=ga(e,t);Object.assign(i,{[r]:c}),ma(a,e,`var(${r})`,s),ma(o,e,`var(${r}, ${c})`,s)}},e=>e[0]===`vars`),{css:i,vars:a,varsWithDefaults:o}}function va(e,t={}){let{getSelector:n=_,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:a}=t,{colorSchemes:o={},components:s,defaultColorScheme:c=`light`,...l}=e,{vars:u,css:d,varsWithDefaults:f}=_a(l,t),p=f,m={},{[c]:h,...g}=o;if(Object.entries(g||{}).forEach(([e,n])=>{let{vars:r,css:i,varsWithDefaults:a}=_a(n,t);p=Cn(p,a),m[e]={css:i,vars:r}}),h){let{css:e,vars:n,varsWithDefaults:r}=_a(h,t);p=Cn(p,r),m[c]={css:e,vars:n}}function _(t,n){let r=i;if(i===`class`&&(r=`.%s`),i===`data`&&(r=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(r=`[${i}="%s"]`),t){if(r===`media`)return e.defaultColorScheme===t?`:root`:{[`@media (prefers-color-scheme: ${o[t]?.palette?.mode||t})`]:{":root":n}};if(r)return e.defaultColorScheme===t?`:root, ${r.replace(`%s`,String(t))}`:r.replace(`%s`,String(t))}return`:root`}return{vars:p,generateThemeVars:()=>{let e={...u};return Object.entries(m).forEach(([,{vars:t}])=>{e=Cn(e,t)}),e},generateStyleSheets:()=>{let t=[],i=e.defaultColorScheme||`light`;function s(e,n){Object.keys(n).length&&t.push(typeof e==`string`?{[e]:{...n}}:e)}s(n(void 0,{...d}),d);let{[i]:c,...l}=m;if(c){let{css:e}=c,t=o[i]?.palette?.mode,a=!r&&t?{colorScheme:t,...e}:{...e};s(n(i,{...a}),a)}return Object.entries(l).forEach(([e,{css:t}])=>{let i=o[e]?.palette?.mode,a=!r&&i?{colorScheme:i,...t}:{...t};s(n(e,{...a}),a)}),a&&t.push({":root":{"--__l-threshold":`0.7`,"--__l":`clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)`,"--__a":`clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)`}}),t}}}function ya(e){return function(t){return e===`media`?`@media (prefers-color-scheme: ${t})`:e?e.startsWith(`data-`)&&!e.includes(`%s`)?`[${e}="${t}"] &`:e===`class`?`.${t} &`:e===`data`?`[data-${t}] &`:`${e.replace(`%s`,t)} &`:`&`}}function ba(e,t,n=void 0){let r={};for(let i in e){let a=e[i],o=``,s=!0;for(let e=0;e<a.length;e+=1){let r=a[e];r&&(o+=(s===!0?``:` `)+t(r),s=!1,n&&n[r]&&(o+=` `+n[r]))}r[i]=o}return r}function xa(e,t){return W.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}var Sa={black:`#000`,white:`#fff`},Ca={50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`,A100:`#f5f5f5`,A200:`#eeeeee`,A400:`#bdbdbd`,A700:`#616161`},wa={50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`,A100:`#ea80fc`,A200:`#e040fb`,A400:`#d500f9`,A700:`#aa00ff`},Ta={50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`,A100:`#ff8a80`,A200:`#ff5252`,A400:`#ff1744`,A700:`#d50000`},Ea={50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`,A100:`#ffd180`,A200:`#ffab40`,A400:`#ff9100`,A700:`#ff6d00`},Da={50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`,A100:`#82b1ff`,A200:`#448aff`,A400:`#2979ff`,A700:`#2962ff`},Oa={50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`,A100:`#80d8ff`,A200:`#40c4ff`,A400:`#00b0ff`,A700:`#0091ea`},ka={50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`,A100:`#b9f6ca`,A200:`#69f0ae`,A400:`#00e676`,A700:`#00c853`};function Aa(){return{text:{primary:`rgba(0, 0, 0, 0.87)`,secondary:`rgba(0, 0, 0, 0.6)`,disabled:`rgba(0, 0, 0, 0.38)`},divider:`rgba(0, 0, 0, 0.12)`,background:{paper:Sa.white,default:Sa.white},action:{active:`rgba(0, 0, 0, 0.54)`,hover:`rgba(0, 0, 0, 0.04)`,hoverOpacity:.04,selected:`rgba(0, 0, 0, 0.08)`,selectedOpacity:.08,disabled:`rgba(0, 0, 0, 0.26)`,disabledBackground:`rgba(0, 0, 0, 0.12)`,disabledOpacity:.38,focus:`rgba(0, 0, 0, 0.12)`,focusOpacity:.12,activatedOpacity:.12}}}var ja=Aa();function Ma(){return{text:{primary:Sa.white,secondary:`rgba(255, 255, 255, 0.7)`,disabled:`rgba(255, 255, 255, 0.5)`,icon:`rgba(255, 255, 255, 0.5)`},divider:`rgba(255, 255, 255, 0.12)`,background:{paper:`#121212`,default:`#121212`},action:{active:Sa.white,hover:`rgba(255, 255, 255, 0.08)`,hoverOpacity:.08,selected:`rgba(255, 255, 255, 0.16)`,selectedOpacity:.16,disabled:`rgba(255, 255, 255, 0.3)`,disabledBackground:`rgba(255, 255, 255, 0.12)`,disabledOpacity:.38,focus:`rgba(255, 255, 255, 0.12)`,focusOpacity:.12,activatedOpacity:.24}}}var Na=Ma();function Pa(e,t,n,r){let i=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t===`light`?e.light=Oi(e.main,i):t===`dark`&&(e.dark=Ei(e.main,a)))}function Fa(e,t,n,r,i){let a=i.light||i,o=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n===`light`?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n===`dark`&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function Ia(e=`light`){return e===`dark`?{main:Da[200],light:Da[50],dark:Da[400]}:{main:Da[700],light:Da[400],dark:Da[800]}}function La(e=`light`){return e===`dark`?{main:wa[200],light:wa[50],dark:wa[400]}:{main:wa[500],light:wa[300],dark:wa[700]}}function Ra(e=`light`){return e===`dark`?{main:Ta[500],light:Ta[300],dark:Ta[700]}:{main:Ta[700],light:Ta[400],dark:Ta[800]}}function za(e=`light`){return e===`dark`?{main:Oa[400],light:Oa[300],dark:Oa[700]}:{main:Oa[700],light:Oa[500],dark:Oa[900]}}function Ba(e=`light`){return e===`dark`?{main:ka[400],light:ka[300],dark:ka[700]}:{main:ka[800],light:ka[500],dark:ka[900]}}function Va(e=`light`){return e===`dark`?{main:Ea[400],light:Ea[300],dark:Ea[700]}:{main:`#ed6c02`,light:Ea[500],dark:Ea[900]}}function Ha(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Ua(e){let{mode:t=`light`,contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||Ia(t),s=e.secondary||La(t),c=e.error||Ra(t),l=e.info||za(t),u=e.success||Ba(t),d=e.warning||Va(t);function f(e){return i?Ha(e):Ci(e,Na.text.primary)>=n?Na.text.primary:ja.text.primary}let p=({color:e,name:t,mainShade:n=500,lightShade:a=300,darkShade:o=700})=>{if(e={...e},!e.main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty(`main`))throw Error(N(11,t?` (${t})`:``,n));if(typeof e.main!=`string`)throw Error(N(12,t?` (${t})`:``,JSON.stringify(e.main)));return i?(Fa(i,e,`light`,a,r),Fa(i,e,`dark`,o,r)):(Pa(e,`light`,a,r),Pa(e,`dark`,o,r)),e.contrastText||=f(e.main),e},m;return t===`light`?m=Aa():t===`dark`&&(m=Ma()),Cn({common:{...Sa},mode:t,primary:p({color:o,name:`primary`}),secondary:p({color:s,name:`secondary`,mainShade:`A400`,lightShade:`A200`,darkShade:`A700`}),error:p({color:c,name:`error`}),warning:p({color:d,name:`warning`}),info:p({color:l,name:`info`}),success:p({color:u,name:`success`}),grey:Ca,contrastThreshold:n,getContrastText:f,augmentColor:p,tonalOffset:r,...m},a)}function Wa(e){let t={};return Object.entries(e).forEach(e=>{let[n,r]=e;typeof r==`object`&&(t[n]=`${r.fontStyle?`${r.fontStyle} `:``}${r.fontVariant?`${r.fontVariant} `:``}${r.fontWeight?`${r.fontWeight} `:``}${r.fontStretch?`${r.fontStretch} `:``}${r.fontSize||``}${r.lineHeight?`/${r.lineHeight} `:``}${r.fontFamily||``}`)}),t}function Ga(e,t){return{toolbar:{minHeight:56,[e.up(`xs`)]:{"@media (orientation: landscape)":{minHeight:48}},[e.up(`sm`)]:{minHeight:64}},...t}}function Ka(e){return Math.round(e*1e5)/1e5}var qa={textTransform:`uppercase`},Ja=`"Roboto", "Helvetica", "Arial", sans-serif`;function Ya(e,t){let{fontFamily:n=Ja,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:c=16,allVariants:l,pxToRem:u,...d}=typeof t==`function`?t(e):t,f=r/14,p=u||(e=>`${e/c*f}rem`),m=(e,t,r,i,a)=>({fontFamily:n,fontWeight:e,fontSize:p(t),lineHeight:r,...n===Ja?{letterSpacing:`${Ka(i/t)}em`}:{},...a,...l});return Cn({htmlFontSize:c,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:s,h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(o,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(o,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(o,14,1.75,.4,qa),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,qa),inherit:{fontFamily:`inherit`,fontWeight:`inherit`,fontSize:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},d,{clone:!1})}var Xa=.2,Za=.14,Qa=.12;function $a(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Xa})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Za})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Qa})`].join(`,`)}var eo=[`none`,$a(0,2,1,-1,0,1,1,0,0,1,3,0),$a(0,3,1,-2,0,2,2,0,0,1,5,0),$a(0,3,3,-2,0,3,4,0,0,1,8,0),$a(0,2,4,-1,0,4,5,0,0,1,10,0),$a(0,3,5,-1,0,5,8,0,0,1,14,0),$a(0,3,5,-1,0,6,10,0,0,1,18,0),$a(0,4,5,-2,0,7,10,1,0,2,16,1),$a(0,5,5,-3,0,8,10,1,0,3,14,2),$a(0,5,6,-3,0,9,12,1,0,3,16,2),$a(0,6,6,-3,0,10,14,1,0,4,18,3),$a(0,6,7,-4,0,11,15,1,0,4,20,3),$a(0,7,8,-4,0,12,17,2,0,5,22,4),$a(0,7,8,-4,0,13,19,2,0,5,24,4),$a(0,7,9,-4,0,14,21,2,0,5,26,4),$a(0,8,9,-5,0,15,22,2,0,6,28,5),$a(0,8,10,-5,0,16,24,2,0,6,30,5),$a(0,8,11,-5,0,17,26,2,0,6,32,5),$a(0,9,11,-5,0,18,28,2,0,7,34,6),$a(0,9,12,-6,0,19,29,2,0,7,36,6),$a(0,10,13,-6,0,20,31,3,0,8,38,7),$a(0,10,13,-6,0,21,33,3,0,8,40,7),$a(0,10,14,-6,0,22,35,3,0,8,42,7),$a(0,11,14,-7,0,23,36,3,0,9,44,8),$a(0,11,15,-7,0,24,38,3,0,9,46,8)],to={easeInOut:`cubic-bezier(0.4, 0, 0.2, 1)`,easeOut:`cubic-bezier(0.0, 0, 0.2, 1)`,easeIn:`cubic-bezier(0.4, 0, 1, 1)`,sharp:`cubic-bezier(0.4, 0, 0.6, 1)`},no={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ro(e){return`${Math.round(e)}ms`}function io(e){if(!e)return 0;let t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function ao(e){let t={...to,...e.easing},n={...no,...e.duration};return{getAutoHeightDuration:io,create:(e=[`all`],r={})=>{let{duration:i=n.standard,easing:a=t.easeInOut,delay:o=0,...s}=r;return(Array.isArray(e)?e:[e]).map(e=>`${e} ${typeof i==`string`?i:ro(i)} ${a} ${typeof o==`string`?o:ro(o)}`).join(`,`)},...e,easing:t,duration:n}}var oo={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function so(e){return xn(e)||e===void 0||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||Array.isArray(e)}function co(e={}){let t={...e};function n(e){let t=Object.entries(e);for(let r=0;r<t.length;r++){let[i,a]=t[r];!so(a)||i.startsWith(`unstable_`)?delete e[i]:xn(a)&&(e[i]={...a},n(e[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
36
-
37
- const theme = ${JSON.stringify(t,null,2)};
38
-
39
- theme.breakpoints = createBreakpoints(theme.breakpoints || {});
40
- theme.transitions = createTransitions(theme.transitions || {});
41
-
42
- export default theme;`}function lo(e){return typeof e==`number`?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}var uo=e=>{if(!Number.isNaN(+e))return+e;let t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let e=0;e<t.length;e+=1)n+=+t[e];return n};function fo(e){Object.assign(e,{alpha(t,n){let r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n==`string`?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,`var(--$1Channel)`)} / ${typeof n==`string`?`calc(${n})`:n})`:wi(t,uo(n))},lighten(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${lo(n)})`:Oi(t,n)},darken(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${lo(n)})`:Ei(t,n)}})}function po(e={},...t){let{breakpoints:n,mixins:r={},spacing:i,palette:a={},transitions:o={},typography:s={},shape:c,colorSpace:l,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw Error(N(20));let d=Ua({...a,colorSpace:l}),f=zr(e),p=Cn(f,{mixins:Ga(f.breakpoints,r),palette:d,shadows:eo.slice(),typography:Ya(d,s),transitions:ao(o),zIndex:{...oo}});return p=Cn(p,u),p=t.reduce((e,t)=>Cn(e,t),p),p.unstable_sxConfig={...Nr,...u?.unstable_sxConfig},p.unstable_sx=function(e){return Lr({sx:e,theme:this})},p.toRuntimeSource=co,fo(p),p}function mo(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}var ho=[...Array(25)].map((e,t)=>{if(t===0)return`none`;let n=mo(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function go(e){return{inputPlaceholder:e===`dark`?.5:.42,inputUnderline:e===`dark`?.7:.42,switchTrackDisabled:e===`dark`?.2:.12,switchTrack:e===`dark`?.3:.38}}function _o(e){return e===`dark`?ho:[]}function vo(e){let{palette:t={mode:`light`},opacity:n,overlays:r,colorSpace:i,...a}=e,o=Ua({...t,colorSpace:i});return{palette:o,opacity:{...go(o.mode),...n},overlays:r||_o(o.mode),...a}}function yo(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]===`palette`&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}var bo=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:``}overlays-${n}`),`--${e?`${e}-`:``}palette-AppBar-darkBg`,`--${e?`${e}-`:``}palette-AppBar-darkColor`],xo=e=>(t,n)=>{let r=e.rootSelector||`:root`,i=e.colorSchemeSelector,a=i;if(i===`class`&&(a=`.%s`),i===`data`&&(a=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t===`dark`){let i={};return bo(e.cssVarPrefix).forEach(e=>{i[e]=n[e],delete n[e]}),a===`media`?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:a?{[a.replace(`%s`,t)]:i,[`${r}, ${a.replace(`%s`,t)}`]:n}:{[r]:{...n,...i}}}if(a&&a!==`media`)return`${r}, ${a.replace(`%s`,String(t))}`}else if(t){if(a===`media`)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace(`%s`,String(t))}return r};function So(e,t){t.forEach(t=>{e[t]||(e[t]={})})}function q(e,t,n){!e[t]&&n&&(e[t]=n)}function Co(e){return typeof e!=`string`||!e.startsWith(`hsl`)?e:xi(e)}function wo(e,t){`${t}Channel`in e||(e[`${t}Channel`]=yi(Co(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
43
- To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function To(e){return typeof e==`number`?`${e}px`:typeof e==`string`||typeof e==`function`||Array.isArray(e)?e:`8px`}var Eo=e=>{try{return e()}catch{}},Do=(e=`mui`)=>pa(e);function Oo(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;let a=i===`dark`?`dark`:`light`;if(!r){t[i]=vo({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}let{palette:o,...s}=po({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...go(a),...n?.opacity},overlays:n?.overlays||_o(a)},s}function ko(e={},...t){let{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a=`mui`,nativeColor:o=!1,shouldSkipGeneratingVar:s=yo,colorSchemeSelector:c=n.light&&n.dark?`media`:void 0,rootSelector:l=`:root`,...u}=e,d=Object.keys(n)[0],f=r||(n.light&&d!==`light`?`light`:d),p=Do(a),{[f]:m,light:h,dark:g,..._}=n,v={..._},y=m;if((f===`dark`&&!(`dark`in n)||f===`light`&&!(`light`in n))&&(y=!0),!y)throw Error(N(21,f));let b;o&&(b=`oklch`);let x=Oo(b,v,y,u,f);h&&!v.light&&Oo(b,v,h,void 0,`light`),g&&!v.dark&&Oo(b,v,g,void 0,`dark`);let S={defaultColorScheme:f,...x,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:l,getCssVar:p,colorSchemes:v,font:{...Wa(x.typography),...x.font},spacing:To(u.spacing)};Object.keys(S.colorSchemes).forEach(e=>{let t=S.colorSchemes[e].palette,n=e=>{let n=e.split(`-`),r=n[1],i=n[2];return p(e,t[r][i])};t.mode===`light`&&(q(t.common,`background`,`#fff`),q(t.common,`onBackground`,`#000`)),t.mode===`dark`&&(q(t.common,`background`,`#000`),q(t.common,`onBackground`,`#fff`));function r(e,t,n){if(b){let r;return e===Ti&&(r=`transparent ${((1-n)*100).toFixed(0)}%`),e===Di&&(r=`#000 ${(n*100).toFixed(0)}%`),e===ki&&(r=`#fff ${(n*100).toFixed(0)}%`),`color-mix(in ${b}, ${t}, ${r})`}return e(t,n)}if(So(t,[`Alert`,`AppBar`,`Avatar`,`Button`,`Chip`,`FilledInput`,`LinearProgress`,`Skeleton`,`Slider`,`SnackbarContent`,`SpeedDialAction`,`StepConnector`,`StepContent`,`Switch`,`TableCell`,`Tooltip`]),t.mode===`light`){q(t.Alert,`errorColor`,r(Di,o?p(`palette-error-light`):t.error.light,.6)),q(t.Alert,`infoColor`,r(Di,o?p(`palette-info-light`):t.info.light,.6)),q(t.Alert,`successColor`,r(Di,o?p(`palette-success-light`):t.success.light,.6)),q(t.Alert,`warningColor`,r(Di,o?p(`palette-warning-light`):t.warning.light,.6)),q(t.Alert,`errorFilledBg`,n(`palette-error-main`)),q(t.Alert,`infoFilledBg`,n(`palette-info-main`)),q(t.Alert,`successFilledBg`,n(`palette-success-main`)),q(t.Alert,`warningFilledBg`,n(`palette-warning-main`)),q(t.Alert,`errorFilledColor`,Eo(()=>t.getContrastText(t.error.main))),q(t.Alert,`infoFilledColor`,Eo(()=>t.getContrastText(t.info.main))),q(t.Alert,`successFilledColor`,Eo(()=>t.getContrastText(t.success.main))),q(t.Alert,`warningFilledColor`,Eo(()=>t.getContrastText(t.warning.main))),q(t.Alert,`errorStandardBg`,r(ki,o?p(`palette-error-light`):t.error.light,.9)),q(t.Alert,`infoStandardBg`,r(ki,o?p(`palette-info-light`):t.info.light,.9)),q(t.Alert,`successStandardBg`,r(ki,o?p(`palette-success-light`):t.success.light,.9)),q(t.Alert,`warningStandardBg`,r(ki,o?p(`palette-warning-light`):t.warning.light,.9)),q(t.Alert,`errorIconColor`,n(`palette-error-main`)),q(t.Alert,`infoIconColor`,n(`palette-info-main`)),q(t.Alert,`successIconColor`,n(`palette-success-main`)),q(t.Alert,`warningIconColor`,n(`palette-warning-main`)),q(t.AppBar,`defaultBg`,n(`palette-grey-100`)),q(t.Avatar,`defaultBg`,n(`palette-grey-400`)),q(t.Button,`inheritContainedBg`,n(`palette-grey-300`)),q(t.Button,`inheritContainedHoverBg`,n(`palette-grey-A100`)),q(t.Chip,`defaultBorder`,n(`palette-grey-400`)),q(t.Chip,`defaultAvatarColor`,n(`palette-grey-700`)),q(t.Chip,`defaultIconColor`,n(`palette-grey-700`)),q(t.FilledInput,`bg`,`rgba(0, 0, 0, 0.06)`),q(t.FilledInput,`hoverBg`,`rgba(0, 0, 0, 0.09)`),q(t.FilledInput,`disabledBg`,`rgba(0, 0, 0, 0.12)`),q(t.LinearProgress,`primaryBg`,r(ki,o?p(`palette-primary-main`):t.primary.main,.62)),q(t.LinearProgress,`secondaryBg`,r(ki,o?p(`palette-secondary-main`):t.secondary.main,.62)),q(t.LinearProgress,`errorBg`,r(ki,o?p(`palette-error-main`):t.error.main,.62)),q(t.LinearProgress,`infoBg`,r(ki,o?p(`palette-info-main`):t.info.main,.62)),q(t.LinearProgress,`successBg`,r(ki,o?p(`palette-success-main`):t.success.main,.62)),q(t.LinearProgress,`warningBg`,r(ki,o?p(`palette-warning-light`):t.warning.main,.62)),q(t.Skeleton,`bg`,b?r(Ti,o?p(`palette-text-primary`):t.text.primary,.11):`rgba(${n(`palette-text-primaryChannel`)} / 0.11)`),q(t.Slider,`primaryTrack`,r(ki,o?p(`palette-primary-main`):t.primary.main,.62)),q(t.Slider,`secondaryTrack`,r(ki,o?p(`palette-secondary-main`):t.secondary.main,.62)),q(t.Slider,`errorTrack`,r(ki,o?p(`palette-error-main`):t.error.main,.62)),q(t.Slider,`infoTrack`,r(ki,o?p(`palette-info-main`):t.info.main,.62)),q(t.Slider,`successTrack`,r(ki,o?p(`palette-success-main`):t.success.main,.62)),q(t.Slider,`warningTrack`,r(ki,o?p(`palette-warning-main`):t.warning.main,.62));let e=b?r(Di,o?p(`palette-background-default`):t.background.default,.6825):ji(t.background.default,.8);q(t.SnackbarContent,`bg`,e),q(t.SnackbarContent,`color`,Eo(()=>b?Na.text.primary:t.getContrastText(e))),q(t.SpeedDialAction,`fabHoverBg`,ji(t.background.paper,.15)),q(t.StepConnector,`border`,n(`palette-grey-400`)),q(t.StepContent,`border`,n(`palette-grey-400`)),q(t.Switch,`defaultColor`,n(`palette-common-white`)),q(t.Switch,`defaultDisabledColor`,n(`palette-grey-100`)),q(t.Switch,`primaryDisabledColor`,r(ki,o?p(`palette-primary-main`):t.primary.main,.62)),q(t.Switch,`secondaryDisabledColor`,r(ki,o?p(`palette-secondary-main`):t.secondary.main,.62)),q(t.Switch,`errorDisabledColor`,r(ki,o?p(`palette-error-main`):t.error.main,.62)),q(t.Switch,`infoDisabledColor`,r(ki,o?p(`palette-info-main`):t.info.main,.62)),q(t.Switch,`successDisabledColor`,r(ki,o?p(`palette-success-main`):t.success.main,.62)),q(t.Switch,`warningDisabledColor`,r(ki,o?p(`palette-warning-main`):t.warning.main,.62)),q(t.TableCell,`border`,r(ki,Ti(o?p(`palette-divider`):t.divider,1),.88)),q(t.Tooltip,`bg`,r(Ti,o?p(`palette-grey-700`):t.grey[700],.92))}if(t.mode===`dark`){q(t.Alert,`errorColor`,r(ki,o?p(`palette-error-light`):t.error.light,.6)),q(t.Alert,`infoColor`,r(ki,o?p(`palette-info-light`):t.info.light,.6)),q(t.Alert,`successColor`,r(ki,o?p(`palette-success-light`):t.success.light,.6)),q(t.Alert,`warningColor`,r(ki,o?p(`palette-warning-light`):t.warning.light,.6)),q(t.Alert,`errorFilledBg`,n(`palette-error-dark`)),q(t.Alert,`infoFilledBg`,n(`palette-info-dark`)),q(t.Alert,`successFilledBg`,n(`palette-success-dark`)),q(t.Alert,`warningFilledBg`,n(`palette-warning-dark`)),q(t.Alert,`errorFilledColor`,Eo(()=>t.getContrastText(t.error.dark))),q(t.Alert,`infoFilledColor`,Eo(()=>t.getContrastText(t.info.dark))),q(t.Alert,`successFilledColor`,Eo(()=>t.getContrastText(t.success.dark))),q(t.Alert,`warningFilledColor`,Eo(()=>t.getContrastText(t.warning.dark))),q(t.Alert,`errorStandardBg`,r(Di,o?p(`palette-error-light`):t.error.light,.9)),q(t.Alert,`infoStandardBg`,r(Di,o?p(`palette-info-light`):t.info.light,.9)),q(t.Alert,`successStandardBg`,r(Di,o?p(`palette-success-light`):t.success.light,.9)),q(t.Alert,`warningStandardBg`,r(Di,o?p(`palette-warning-light`):t.warning.light,.9)),q(t.Alert,`errorIconColor`,n(`palette-error-main`)),q(t.Alert,`infoIconColor`,n(`palette-info-main`)),q(t.Alert,`successIconColor`,n(`palette-success-main`)),q(t.Alert,`warningIconColor`,n(`palette-warning-main`)),q(t.AppBar,`defaultBg`,n(`palette-grey-900`)),q(t.AppBar,`darkBg`,n(`palette-background-paper`)),q(t.AppBar,`darkColor`,n(`palette-text-primary`)),q(t.Avatar,`defaultBg`,n(`palette-grey-600`)),q(t.Button,`inheritContainedBg`,n(`palette-grey-800`)),q(t.Button,`inheritContainedHoverBg`,n(`palette-grey-700`)),q(t.Chip,`defaultBorder`,n(`palette-grey-700`)),q(t.Chip,`defaultAvatarColor`,n(`palette-grey-300`)),q(t.Chip,`defaultIconColor`,n(`palette-grey-300`)),q(t.FilledInput,`bg`,`rgba(255, 255, 255, 0.09)`),q(t.FilledInput,`hoverBg`,`rgba(255, 255, 255, 0.13)`),q(t.FilledInput,`disabledBg`,`rgba(255, 255, 255, 0.12)`),q(t.LinearProgress,`primaryBg`,r(Di,o?p(`palette-primary-main`):t.primary.main,.5)),q(t.LinearProgress,`secondaryBg`,r(Di,o?p(`palette-secondary-main`):t.secondary.main,.5)),q(t.LinearProgress,`errorBg`,r(Di,o?p(`palette-error-main`):t.error.main,.5)),q(t.LinearProgress,`infoBg`,r(Di,o?p(`palette-info-main`):t.info.main,.5)),q(t.LinearProgress,`successBg`,r(Di,o?p(`palette-success-main`):t.success.main,.5)),q(t.LinearProgress,`warningBg`,r(Di,o?p(`palette-warning-main`):t.warning.main,.5)),q(t.Skeleton,`bg`,b?r(Ti,o?p(`palette-text-primary`):t.text.primary,.13):`rgba(${n(`palette-text-primaryChannel`)} / 0.13)`),q(t.Slider,`primaryTrack`,r(Di,o?p(`palette-primary-main`):t.primary.main,.5)),q(t.Slider,`secondaryTrack`,r(Di,o?p(`palette-secondary-main`):t.secondary.main,.5)),q(t.Slider,`errorTrack`,r(Di,o?p(`palette-error-main`):t.error.main,.5)),q(t.Slider,`infoTrack`,r(Di,o?p(`palette-info-main`):t.info.main,.5)),q(t.Slider,`successTrack`,r(Di,o?p(`palette-success-main`):t.success.main,.5)),q(t.Slider,`warningTrack`,r(Di,o?p(`palette-warning-light`):t.warning.main,.5));let e=b?r(ki,o?p(`palette-background-default`):t.background.default,.985):ji(t.background.default,.98);q(t.SnackbarContent,`bg`,e),q(t.SnackbarContent,`color`,Eo(()=>b?ja.text.primary:t.getContrastText(e))),q(t.SpeedDialAction,`fabHoverBg`,ji(t.background.paper,.15)),q(t.StepConnector,`border`,n(`palette-grey-600`)),q(t.StepContent,`border`,n(`palette-grey-600`)),q(t.Switch,`defaultColor`,n(`palette-grey-300`)),q(t.Switch,`defaultDisabledColor`,n(`palette-grey-600`)),q(t.Switch,`primaryDisabledColor`,r(Di,o?p(`palette-primary-main`):t.primary.main,.55)),q(t.Switch,`secondaryDisabledColor`,r(Di,o?p(`palette-secondary-main`):t.secondary.main,.55)),q(t.Switch,`errorDisabledColor`,r(Di,o?p(`palette-error-main`):t.error.main,.55)),q(t.Switch,`infoDisabledColor`,r(Di,o?p(`palette-info-main`):t.info.main,.55)),q(t.Switch,`successDisabledColor`,r(Di,o?p(`palette-success-main`):t.success.main,.55)),q(t.Switch,`warningDisabledColor`,r(Di,o?p(`palette-warning-light`):t.warning.main,.55)),q(t.TableCell,`border`,r(Di,Ti(o?p(`palette-divider`):t.divider,1),.68)),q(t.Tooltip,`bg`,r(Ti,o?p(`palette-grey-700`):t.grey[700],.92))}o||(wo(t.background,`default`),wo(t.background,`paper`),wo(t.common,`background`),wo(t.common,`onBackground`),wo(t,`divider`)),Object.keys(t).forEach(e=>{let n=t[e];e!==`tonalOffset`&&!o&&n&&typeof n==`object`&&(n.main&&q(t[e],`mainChannel`,yi(Co(n.main))),n.light&&q(t[e],`lightChannel`,yi(Co(n.light))),n.dark&&q(t[e],`darkChannel`,yi(Co(n.dark))),n.contrastText&&q(t[e],`contrastTextChannel`,yi(Co(n.contrastText))),e===`text`&&(wo(t[e],`primary`),wo(t[e],`secondary`)),e===`action`&&(n.active&&wo(t[e],`active`),n.selected&&wo(t[e],`selected`)))})}),S=t.reduce((e,t)=>Cn(e,t),S);let C={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:xo(S),enableContrastVars:o},{vars:w,generateThemeVars:T,generateStyleSheets:E}=va(S,C);return S.vars=w,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([e,t])=>{S[e]=t}),S.generateThemeVars=T,S.generateStyleSheets=E,S.generateSpacing=function(){return ar(u.spacing,Zn(this))},S.getColorSchemeSelector=ya(c),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=s,S.unstable_sxConfig={...Nr,...u?.unstable_sxConfig},S.unstable_sx=function(e){return Lr({sx:e,theme:this})},S.toRuntimeSource=co,S}function Ao(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Ua({...n===!0?{}:n.palette,mode:t})})}function jo(e={},...t){let{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=e,s=a||`light`,c=i?.[s],l={...i,...n?{[s]:{...typeof c!=`boolean`&&c,palette:n}}:void 0};if(r===!1){if(!(`colorSchemes`in e))return po(e,...t);let r=n;`palette`in e||l[s]&&(l[s]===!0?s===`dark`&&(r={mode:`dark`}):r=l[s].palette);let i=po({...e,palette:r},...t);return i.defaultColorScheme=s,i.colorSchemes=l,i.palette.mode===`light`&&(i.colorSchemes.light={...l.light!==!0&&l.light,palette:i.palette},Ao(i,`dark`,l.dark)),i.palette.mode===`dark`&&(i.colorSchemes.dark={...l.dark!==!0&&l.dark,palette:i.palette},Ao(i,`light`,l.light)),i}return!n&&!(`light`in l)&&s===`light`&&(l.light=!0),ko({...o,colorSchemes:l,defaultColorScheme:s,...typeof r!=`boolean`&&r},...t)}var Mo=jo();function No(){let e=Ur(Mo);return e.$$material||e}function Po(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}var Fo=e=>Po(e)&&e!==`classes`,J=ci({themeId:P,defaultTheme:Mo,rootShouldForwardProp:Fo});function Io({theme:e,...t}){let n=`$$material`in e?e[P]:void 0;return(0,G.jsx)(Zi,{...t,themeId:n?P:void 0,theme:n||e})}M();var Lo={attribute:`data-mui-color-scheme`,colorSchemeStorageKey:`mui-color-scheme`,defaultLightColorScheme:`light`,defaultDarkColorScheme:`dark`,modeStorageKey:`mui-mode`},{CssVarsProvider:Ro,useColorScheme:zo,getInitColorSchemeScript:Bo}=fa({themeId:P,theme:()=>jo({cssVariables:!0}),colorSchemeStorageKey:Lo.colorSchemeStorageKey,modeStorageKey:Lo.modeStorageKey,defaultColorScheme:{light:Lo.defaultLightColorScheme,dark:Lo.defaultDarkColorScheme},resolveTheme:e=>{let t={...e,typography:Ya(e.palette,e.typography)};return t.unstable_sx=function(e){return Lr({sx:e,theme:this})},t}}),Vo=Ro;function Ho({theme:e,...t}){let n=W.useMemo(()=>{if(typeof e==`function`)return e;let t=`$$material`in e?e[P]:e;return`colorSchemes`in t?null:`vars`in t?e:{...e,vars:null}},[e]);return n?(0,G.jsx)(Io,{theme:n,...t}):(0,G.jsx)(Vo,{theme:e,...t})}var Uo=typeof global==`object`&&global&&global.Object===Object&&global,Wo=typeof self==`object`&&self&&self.Object===Object&&self,Go=Uo||Wo||Function(`return this`)(),Ko=Go.Symbol,qo=Object.prototype,Jo=qo.hasOwnProperty,Yo=qo.toString,Xo=Ko?Ko.toStringTag:void 0;function Zo(e){var t=Jo.call(e,Xo),n=e[Xo];try{e[Xo]=void 0;var r=!0}catch{}var i=Yo.call(e);return r&&(t?e[Xo]=n:delete e[Xo]),i}var Qo=Object.prototype.toString;function $o(e){return Qo.call(e)}var es=`[object Null]`,ts=`[object Undefined]`,ns=Ko?Ko.toStringTag:void 0;function rs(e){return e==null?e===void 0?ts:es:ns&&ns in Object(e)?Zo(e):$o(e)}function is(e){return typeof e==`object`&&!!e}var as=`[object Symbol]`;function ss(e){return typeof e==`symbol`||is(e)&&rs(e)==as}function cs(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ls=Array.isArray,us=1/0,ds=Ko?Ko.prototype:void 0,fs=ds?ds.toString:void 0;function ps(e){if(typeof e==`string`)return e;if(ls(e))return cs(e,ps)+``;if(ss(e))return fs?fs.call(e):``;var t=e+``;return t==`0`&&1/e==-us?`-0`:t}var ms=/\s/;function hs(e){for(var t=e.length;t--&&ms.test(e.charAt(t)););return t}var gs=/^\s+/;function _s(e){return e&&e.slice(0,hs(e)+1).replace(gs,``)}function vs(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var ys=NaN,bs=/^[-+]0x[0-9a-f]+$/i,xs=/^0b[01]+$/i,Ss=/^0o[0-7]+$/i,Cs=parseInt;function ws(e){if(typeof e==`number`)return e;if(ss(e))return ys;if(vs(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=vs(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=_s(e);var n=xs.test(e);return n||Ss.test(e)?Cs(e.slice(2),n?2:8):bs.test(e)?ys:+e}var Ts=1/0,Es=17976931348623157e292;function Ds(e){return e?(e=ws(e),e===Ts||e===-Ts?(e<0?-1:1)*Es:e===e?e:0):e===0?e:0}function Os(e){var t=Ds(e),n=t%1;return t===t?n?t-n:t:0}function ks(e){return e}var As=`[object AsyncFunction]`,js=`[object Function]`,Ms=`[object GeneratorFunction]`,Ns=`[object Proxy]`;function Ps(e){if(!vs(e))return!1;var t=rs(e);return t==js||t==Ms||t==As||t==Ns}var Fs=Go[`__core-js_shared__`],Is=function(){var e=/[^.]+$/.exec(Fs&&Fs.keys&&Fs.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Ls(e){return!!Is&&Is in e}var Rs=Function.prototype.toString;function zs(e){if(e!=null){try{return Rs.call(e)}catch{}try{return e+``}catch{}}return``}var Bs=/[\\^$.*+?()[\]{}|]/g,Vs=/^\[object .+?Constructor\]$/,Hs=Function.prototype,Us=Object.prototype,Ws=Hs.toString,Gs=Us.hasOwnProperty,Ks=RegExp(`^`+Ws.call(Gs).replace(Bs,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function qs(e){return!vs(e)||Ls(e)?!1:(Ps(e)?Ks:Vs).test(zs(e))}function Js(e,t){return e?.[t]}function Ys(e,t){var n=Js(e,t);return qs(n)?n:void 0}var Xs=Ys(Go,`WeakMap`),Zs=Object.create,Qs=function(){function e(){}return function(t){if(!vs(t))return{};if(Zs)return Zs(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function $s(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ec(){}function tc(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var nc=800,rc=16,ic=Date.now;function ac(e){var t=0,n=0;return function(){var r=ic(),i=rc-(r-n);if(n=r,i>0){if(++t>=nc)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function oc(e){return function(){return e}}var sc=function(){try{var e=Ys(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),cc=ac(sc?function(e,t){return sc(e,`toString`,{configurable:!0,enumerable:!1,value:oc(t),writable:!0})}:ks);function lc(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function uc(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function dc(e){return e!==e}function fc(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function pc(e,t,n){return t===t?fc(e,t,n):uc(e,dc,n)}function mc(e,t){return!!(e!=null&&e.length)&&pc(e,t,0)>-1}var hc=9007199254740991,Y=/^(?:0|[1-9]\d*)$/;function gc(e,t){var n=typeof e;return t??=hc,!!t&&(n==`number`||n!=`symbol`&&Y.test(e))&&e>-1&&e%1==0&&e<t}function _c(e,t,n){t==`__proto__`&&sc?sc(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function vc(e,t){return e===t||e!==e&&t!==t}var yc=Object.prototype.hasOwnProperty;function bc(e,t,n){var r=e[t];(!(yc.call(e,t)&&vc(r,n))||n===void 0&&!(t in e))&&_c(e,t,n)}function xc(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?_c(n,s,c):bc(n,s,c)}return n}var Sc=Math.max;function Cc(e,t,n){return t=Sc(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Sc(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),$s(e,this,s)}}function wc(e,t){return cc(Cc(e,t,ks),e+``)}var Tc=9007199254740991;function Ec(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Tc}function Dc(e){return e!=null&&Ec(e.length)&&!Ps(e)}function Oc(e,t,n){if(!vs(n))return!1;var r=typeof t;return(r==`number`?Dc(n)&&gc(t,n.length):r==`string`&&t in n)?vc(n[t],e):!1}var kc=Object.prototype;function Ac(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||kc)}function jc(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Mc=`[object Arguments]`;function Nc(e){return is(e)&&rs(e)==Mc}var Pc=Object.prototype,Fc=Pc.hasOwnProperty,Ic=Pc.propertyIsEnumerable,Lc=Nc(function(){return arguments}())?Nc:function(e){return is(e)&&Fc.call(e,`callee`)&&!Ic.call(e,`callee`)};function Rc(){return!1}var zc=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Bc=zc&&typeof module==`object`&&module&&!module.nodeType&&module,Vc=Bc&&Bc.exports===zc?Go.Buffer:void 0,Hc=(Vc?Vc.isBuffer:void 0)||Rc,Uc=`[object Arguments]`,Wc=`[object Array]`,Gc=`[object Boolean]`,Kc=`[object Date]`,qc=`[object Error]`,Jc=`[object Function]`,Yc=`[object Map]`,Xc=`[object Number]`,Zc=`[object Object]`,Qc=`[object RegExp]`,$c=`[object Set]`,el=`[object String]`,tl=`[object WeakMap]`,nl=`[object ArrayBuffer]`,rl=`[object DataView]`,il=`[object Float32Array]`,al=`[object Float64Array]`,ol=`[object Int8Array]`,sl=`[object Int16Array]`,cl=`[object Int32Array]`,ll=`[object Uint8Array]`,ul=`[object Uint8ClampedArray]`,dl=`[object Uint16Array]`,fl=`[object Uint32Array]`,pl={};pl[il]=pl[al]=pl[ol]=pl[sl]=pl[cl]=pl[ll]=pl[ul]=pl[dl]=pl[fl]=!0,pl[Uc]=pl[Wc]=pl[nl]=pl[Gc]=pl[rl]=pl[Kc]=pl[qc]=pl[Jc]=pl[Yc]=pl[Xc]=pl[Zc]=pl[Qc]=pl[$c]=pl[el]=pl[tl]=!1;function ml(e){return is(e)&&Ec(e.length)&&!!pl[rs(e)]}function hl(e){return function(t){return e(t)}}var gl=typeof exports==`object`&&exports&&!exports.nodeType&&exports,_l=gl&&typeof module==`object`&&module&&!module.nodeType&&module,vl=_l&&_l.exports===gl&&Uo.process,yl=function(){try{return _l&&_l.require&&_l.require(`util`).types||vl&&vl.binding&&vl.binding(`util`)}catch{}}(),bl=yl&&yl.isTypedArray,xl=bl?hl(bl):ml,Sl=Object.prototype.hasOwnProperty;function Cl(e,t){var n=ls(e),r=!n&&Lc(e),i=!n&&!r&&Hc(e),a=!n&&!r&&!i&&xl(e),o=n||r||i||a,s=o?jc(e.length,String):[],c=s.length;for(var l in e)(t||Sl.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||gc(l,c)))&&s.push(l);return s}function wl(e,t){return function(n){return e(t(n))}}var Tl=wl(Object.keys,Object),El=Object.prototype.hasOwnProperty;function Dl(e){if(!Ac(e))return Tl(e);var t=[];for(var n in Object(e))El.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Ol(e){return Dc(e)?Cl(e):Dl(e)}function kl(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Al=Object.prototype.hasOwnProperty;function jl(e){if(!vs(e))return kl(e);var t=Ac(e),n=[];for(var r in e)r==`constructor`&&(t||!Al.call(e,r))||n.push(r);return n}function Ml(e){return Dc(e)?Cl(e,!0):jl(e)}var Nl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pl=/^\w*$/;function Fl(e,t){if(ls(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||ss(e)?!0:Pl.test(e)||!Nl.test(e)||t!=null&&e in Object(t)}var Il=Ys(Object,`create`);function Ll(){this.__data__=Il?Il(null):{},this.size=0}function Rl(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var zl=`__lodash_hash_undefined__`,Bl=Object.prototype.hasOwnProperty;function Vl(e){var t=this.__data__;if(Il){var n=t[e];return n===zl?void 0:n}return Bl.call(t,e)?t[e]:void 0}var Hl=Object.prototype.hasOwnProperty;function Ul(e){var t=this.__data__;return Il?t[e]!==void 0:Hl.call(t,e)}var Wl=`__lodash_hash_undefined__`;function Gl(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=Il&&t===void 0?Wl:t,this}function Kl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Kl.prototype.clear=Ll,Kl.prototype.delete=Rl,Kl.prototype.get=Vl,Kl.prototype.has=Ul,Kl.prototype.set=Gl;function ql(){this.__data__=[],this.size=0}function Jl(e,t){for(var n=e.length;n--;)if(vc(e[n][0],t))return n;return-1}var Yl=Array.prototype.splice;function Xl(e){var t=this.__data__,n=Jl(t,e);return n<0?!1:(n==t.length-1?t.pop():Yl.call(t,n,1),--this.size,!0)}function Zl(e){var t=this.__data__,n=Jl(t,e);return n<0?void 0:t[n][1]}function Ql(e){return Jl(this.__data__,e)>-1}function $l(e,t){var n=this.__data__,r=Jl(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function eu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}eu.prototype.clear=ql,eu.prototype.delete=Xl,eu.prototype.get=Zl,eu.prototype.has=Ql,eu.prototype.set=$l;var tu=Ys(Go,`Map`);function nu(){this.size=0,this.__data__={hash:new Kl,map:new(tu||eu),string:new Kl}}function ru(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function iu(e,t){var n=e.__data__;return ru(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function au(e){var t=iu(this,e).delete(e);return this.size-=+!!t,t}function ou(e){return iu(this,e).get(e)}function su(e){return iu(this,e).has(e)}function cu(e,t){var n=iu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function lu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}lu.prototype.clear=nu,lu.prototype.delete=au,lu.prototype.get=ou,lu.prototype.has=su,lu.prototype.set=cu;var uu=`Expected a function`;function du(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(uu);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(du.Cache||lu),n}du.Cache=lu;var fu=500;function pu(e){var t=du(e,function(e){return n.size===fu&&n.clear(),e}),n=t.cache;return t}var mu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hu=/\\(\\)?/g,gu=pu(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(mu,function(e,n,r,i){t.push(r?i.replace(hu,`$1`):n||e)}),t});function _u(e){return e==null?``:ps(e)}function vu(e,t){return ls(e)?e:Fl(e,t)?[e]:gu(_u(e))}var yu=1/0;function bu(e){if(typeof e==`string`||ss(e))return e;var t=e+``;return t==`0`&&1/e==-yu?`-0`:t}function xu(e,t){t=vu(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[bu(t[n++])];return n&&n==r?e:void 0}function Su(e,t,n){var r=e==null?void 0:xu(e,t);return r===void 0?n:r}function Cu(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var wu=Ko?Ko.isConcatSpreadable:void 0;function Tu(e){return ls(e)||Lc(e)||!!(wu&&e&&e[wu])}function Eu(e,t,n,r,i){var a=-1,o=e.length;for(n||=Tu,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?Eu(s,t-1,n,r,i):Cu(i,s):r||(i[i.length]=s)}return i}function Du(e){return e!=null&&e.length?Eu(e,1):[]}function Ou(e){return cc(Cc(e,void 0,Du),e+``)}var ku=wl(Object.getPrototypeOf,Object),Au=`[object Object]`,ju=Function.prototype,Mu=Object.prototype,Nu=ju.toString,Pu=Mu.hasOwnProperty,Fu=Nu.call(Object);function Iu(e){if(!is(e)||rs(e)!=Au)return!1;var t=ku(e);if(t===null)return!0;var n=Pu.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Nu.call(n)==Fu}function Lu(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var Ru=Math.ceil,zu=Math.max;function Bu(e,t,n){t=(n?Oc(e,t,n):t===void 0)?1:zu(Os(t),0);var r=e==null?0:e.length;if(!r||t<1)return[];for(var i=0,a=0,o=Array(Ru(r/t));i<r;)o[a++]=Lu(e,i,i+=t);return o}function Vu(){this.__data__=new eu,this.size=0}function Hu(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Uu(e){return this.__data__.get(e)}function Wu(e){return this.__data__.has(e)}var Gu=200;function Ku(e,t){var n=this.__data__;if(n instanceof eu){var r=n.__data__;if(!tu||r.length<Gu-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new lu(r)}return n.set(e,t),this.size=n.size,this}function qu(e){var t=this.__data__=new eu(e);this.size=t.size}qu.prototype.clear=Vu,qu.prototype.delete=Hu,qu.prototype.get=Uu,qu.prototype.has=Wu,qu.prototype.set=Ku;function Ju(e,t){return e&&xc(t,Ol(t),e)}function Yu(e,t){return e&&xc(t,Ml(t),e)}var Xu=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Zu=Xu&&typeof module==`object`&&module&&!module.nodeType&&module,Qu=Zu&&Zu.exports===Xu?Go.Buffer:void 0,$u=Qu?Qu.allocUnsafe:void 0;function ed(e,t){if(t)return e.slice();var n=e.length,r=$u?$u(n):new e.constructor(n);return e.copy(r),r}function td(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function nd(){return[]}var rd=Object.prototype.propertyIsEnumerable,id=Object.getOwnPropertySymbols,ad=id?function(e){return e==null?[]:(e=Object(e),td(id(e),function(t){return rd.call(e,t)}))}:nd;function od(e,t){return xc(e,ad(e),t)}var sd=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Cu(t,ad(e)),e=ku(e);return t}:nd;function cd(e,t){return xc(e,sd(e),t)}function ld(e,t,n){var r=t(e);return ls(e)?r:Cu(r,n(e))}function ud(e){return ld(e,Ol,ad)}function dd(e){return ld(e,Ml,sd)}var fd=Ys(Go,`DataView`),pd=Ys(Go,`Promise`),md=Ys(Go,`Set`),hd=`[object Map]`,eee=`[object Object]`,gd=`[object Promise]`,_d=`[object Set]`,vd=`[object WeakMap]`,yd=`[object DataView]`,tee=zs(fd),nee=zs(tu),ree=zs(pd),iee=zs(md),aee=zs(Xs),bd=rs;(fd&&bd(new fd(new ArrayBuffer(1)))!=yd||tu&&bd(new tu)!=hd||pd&&bd(pd.resolve())!=gd||md&&bd(new md)!=_d||Xs&&bd(new Xs)!=vd)&&(bd=function(e){var t=rs(e),n=t==eee?e.constructor:void 0,r=n?zs(n):``;if(r)switch(r){case tee:return yd;case nee:return hd;case ree:return gd;case iee:return _d;case aee:return vd}return t});var xd=bd,oee=Object.prototype.hasOwnProperty;function Sd(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&oee.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}var Cd=Go.Uint8Array;function wd(e){var t=new e.constructor(e.byteLength);return new Cd(t).set(new Cd(e)),t}function Td(e,t){var n=t?wd(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Ed=/\w*$/;function Dd(e){var t=new e.constructor(e.source,Ed.exec(e));return t.lastIndex=e.lastIndex,t}var Od=Ko?Ko.prototype:void 0,kd=Od?Od.valueOf:void 0;function Ad(e){return kd?Object(kd.call(e)):{}}function jd(e,t){var n=t?wd(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Md=`[object Boolean]`,Nd=`[object Date]`,Pd=`[object Map]`,Fd=`[object Number]`,Id=`[object RegExp]`,Ld=`[object Set]`,Rd=`[object String]`,zd=`[object Symbol]`,Bd=`[object ArrayBuffer]`,Vd=`[object DataView]`,Hd=`[object Float32Array]`,Ud=`[object Float64Array]`,Wd=`[object Int8Array]`,Gd=`[object Int16Array]`,Kd=`[object Int32Array]`,qd=`[object Uint8Array]`,Jd=`[object Uint8ClampedArray]`,Yd=`[object Uint16Array]`,Xd=`[object Uint32Array]`;function Zd(e,t,n){var r=e.constructor;switch(t){case Bd:return wd(e);case Md:case Nd:return new r(+e);case Vd:return Td(e,n);case Hd:case Ud:case Wd:case Gd:case Kd:case qd:case Jd:case Yd:case Xd:return jd(e,n);case Pd:return new r;case Fd:case Rd:return new r(e);case Id:return Dd(e);case Ld:return new r;case zd:return Ad(e)}}function Qd(e){return typeof e.constructor==`function`&&!Ac(e)?Qs(ku(e)):{}}var $d=`[object Map]`;function ef(e){return is(e)&&xd(e)==$d}var tf=yl&&yl.isMap,nf=tf?hl(tf):ef,rf=`[object Set]`;function af(e){return is(e)&&xd(e)==rf}var of=yl&&yl.isSet,sf=of?hl(of):af,cf=1,lf=2,uf=4,df=`[object Arguments]`,ff=`[object Array]`,pf=`[object Boolean]`,mf=`[object Date]`,hf=`[object Error]`,gf=`[object Function]`,_f=`[object GeneratorFunction]`,vf=`[object Map]`,yf=`[object Number]`,bf=`[object Object]`,xf=`[object RegExp]`,Sf=`[object Set]`,Cf=`[object String]`,wf=`[object Symbol]`,Tf=`[object WeakMap]`,Ef=`[object ArrayBuffer]`,Df=`[object DataView]`,Of=`[object Float32Array]`,kf=`[object Float64Array]`,Af=`[object Int8Array]`,jf=`[object Int16Array]`,Mf=`[object Int32Array]`,Nf=`[object Uint8Array]`,Pf=`[object Uint8ClampedArray]`,see=`[object Uint16Array]`,cee=`[object Uint32Array]`,Ff={};Ff[df]=Ff[ff]=Ff[Ef]=Ff[Df]=Ff[pf]=Ff[mf]=Ff[Of]=Ff[kf]=Ff[Af]=Ff[jf]=Ff[Mf]=Ff[vf]=Ff[yf]=Ff[bf]=Ff[xf]=Ff[Sf]=Ff[Cf]=Ff[wf]=Ff[Nf]=Ff[Pf]=Ff[see]=Ff[cee]=!0,Ff[hf]=Ff[gf]=Ff[Tf]=!1;function If(e,t,n,r,i,a){var o,s=t&cf,c=t&lf,l=t&uf;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!vs(e))return e;var u=ls(e);if(u){if(o=Sd(e),!s)return tc(e,o)}else{var d=xd(e),f=d==gf||d==_f;if(Hc(e))return ed(e,s);if(d==bf||d==df||f&&!i){if(o=c||f?{}:Qd(e),!s)return c?cd(e,Yu(o,e)):od(e,Ju(o,e))}else{if(!Ff[d])return i?e:{};o=Zd(e,d,s)}}a||=new qu;var p=a.get(e);if(p)return p;a.set(e,o),sf(e)?e.forEach(function(r){o.add(If(r,t,n,r,e,a))}):nf(e)&&e.forEach(function(r,i){o.set(i,If(r,t,n,i,e,a))});var m=u?void 0:(l?c?dd:ud:c?Ml:Ol)(e);return lc(m||e,function(r,i){m&&(i=r,r=e[i]),bc(o,i,If(r,t,n,i,e,a))}),o}var lee=1,uee=4;function Lf(e){return If(e,lee|uee)}function dee(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function fee(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Cu(ls(n)?tc(n):[n],Eu(t,1))}var pee=`__lodash_hash_undefined__`;function mee(e){return this.__data__.set(e,pee),this}function hee(e){return this.__data__.has(e)}function Rf(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new lu;++t<n;)this.add(e[t])}Rf.prototype.add=Rf.prototype.push=mee,Rf.prototype.has=hee;function gee(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function zf(e,t){return e.has(t)}var _ee=1,vee=2;function Bf(e,t,n,r,i,a){var o=n&_ee,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&vee?new Rf:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!gee(t,function(e,t){if(!zf(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function yee(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Vf(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var bee=1,xee=2,See=`[object Boolean]`,Cee=`[object Date]`,wee=`[object Error]`,Tee=`[object Map]`,Eee=`[object Number]`,Dee=`[object RegExp]`,Oee=`[object Set]`,kee=`[object String]`,Aee=`[object Symbol]`,jee=`[object ArrayBuffer]`,Mee=`[object DataView]`,Hf=Ko?Ko.prototype:void 0,Uf=Hf?Hf.valueOf:void 0;function Nee(e,t,n,r,i,a,o){switch(n){case Mee:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case jee:return!(e.byteLength!=t.byteLength||!a(new Cd(e),new Cd(t)));case See:case Cee:case Eee:return vc(+e,+t);case wee:return e.name==t.name&&e.message==t.message;case Dee:case kee:return e==t+``;case Tee:var s=yee;case Oee:var c=r&bee;if(s||=Vf,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=xee,o.set(e,t);var u=Bf(s(e),s(t),r,i,a,o);return o.delete(e),u;case Aee:if(Uf)return Uf.call(e)==Uf.call(t)}return!1}var Pee=1,Fee=Object.prototype.hasOwnProperty;function Iee(e,t,n,r,i,a){var o=n&Pee,s=ud(e),c=s.length;if(c!=ud(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Fee.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Lee=1,Wf=`[object Arguments]`,Gf=`[object Array]`,Kf=`[object Object]`,qf=Object.prototype.hasOwnProperty;function Ree(e,t,n,r,i,a){var o=ls(e),s=ls(t),c=o?Gf:xd(e),l=s?Gf:xd(t);c=c==Wf?Kf:c,l=l==Wf?Kf:l;var u=c==Kf,d=l==Kf,f=c==l;if(f&&Hc(e)){if(!Hc(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new qu,o||xl(e)?Bf(e,t,n,r,i,a):Nee(e,t,c,n,r,i,a);if(!(n&Lee)){var p=u&&qf.call(e,`__wrapped__`),m=d&&qf.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new qu,i(h,g,n,r,a)}}return f?(a||=new qu,Iee(e,t,n,r,i,a)):!1}function Jf(e,t,n,r,i){return e===t?!0:e==null||t==null||!is(e)&&!is(t)?e!==e&&t!==t:Ree(e,t,n,r,Jf,i)}function Yf(e){return function(t){return t?.[e]}}var Xf=function(){return Go.Date.now()},Zf=`Expected a function`,Qf=Math.max,$f=Math.min;function ep(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(Zf);t=ws(t)||0,vs(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Qf(ws(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?$f(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=Xf();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Xf())}function x(){var e=Xf(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function tp(e){return is(e)&&Dc(e)}function np(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function rp(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function ip(e){return typeof e==`function`?e:ks}function ap(e){return e&&e.length?e[0]:void 0}var op=`[object String]`;function sp(e){return typeof e==`string`||!ls(e)&&is(e)&&rs(e)==op}function cp(e){return e!=null&&e.length?Lu(e,0,-1):[]}function lp(e,t){return t.length<2?e:xu(e,Lu(t,0,-1))}var up=`[object Map]`,dp=`[object Set]`,fp=Object.prototype.hasOwnProperty;function pp(e){if(e==null)return!0;if(Dc(e)&&(ls(e)||typeof e==`string`||typeof e.splice==`function`||Hc(e)||xl(e)||Lc(e)))return!e.length;var t=xd(e);if(t==up||t==dp)return!e.size;if(Ac(e))return!Dl(e).length;for(var n in e)if(fp.call(e,n))return!1;return!0}function mp(e,t){return Jf(e,t)}var hp=Object.prototype.hasOwnProperty;function gp(e,t){t=vu(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=bu(t[n]);if(i===`__proto__`&&!hp.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=lp(e,t);return a==null||delete a[bu(rp(t))]}function _p(e){return Iu(e)?void 0:e}var vp=1,yp=2,bp=4,xp=Ou(function(e,t){var n={};if(e==null)return n;var r=!1;t=cs(t,function(t){return t=vu(t,e),r||=t.length>1,t}),xc(e,dd(e),n),r&&(n=If(n,vp|yp|bp,_p));for(var i=t.length;i--;)gp(n,t[i]);return n}),Sp=Math.ceil,Cp=Math.max;function wp(e,t,n,r){for(var i=-1,a=Cp(Sp((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Tp(e){return function(t,n,r){return r&&typeof r!=`number`&&Oc(t,n,r)&&(n=r=void 0),t=Ds(t),n===void 0?(n=t,t=0):n=Ds(n),r=r===void 0?t<n?1:-1:Ds(r),wp(t,n,r,e)}}var Ep=Tp(),Dp=Tp(!0);function Op(e){var t=e==null?0:e.length;return t?Lu(e,1,t):[]}var kp=9007199254740991,Ap=4294967295,jp=Math.min;function Mp(e,t){if(e=Os(e),e<1||e>kp)return[];var n=Ap,r=jp(e,Ap);t=ip(t),e-=Ap;for(var i=jc(r,t);++n<e;)t(n);return i}var Np=md&&1/Vf(new md([,-0]))[1]==1/0?function(e){return new md(e)}:ec,Pp=200;function Fp(e,t,n){var r=-1,i=mc,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=np;else if(a>=Pp){var l=t?null:Np(e);if(l)return Vf(l);o=!1,i=zf,c=new Rf}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}function Ip(e){return e&&e.length?Fp(e):[]}var Lp=Math.max;function Rp(e){if(!(e&&e.length))return[];var t=0;return e=td(e,function(e){if(tp(e))return t=Lp(e.length,t),!0}),jc(t,function(t){return cs(e,Yf(t))})}var zp=wc(Rp),Bp={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Vp(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Bp.hasOwnProperty(t)?{space:Bp[t],local:e}:e}function Hp(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Up(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Wp(e){var t=Vp(e);return(t.local?Up:Hp)(t)}function Gp(){}function Kp(e){return e==null?Gp:function(){return this.querySelector(e)}}function qp(e){typeof e!=`function`&&(e=Kp(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Fh(r,this._parents)}function Jp(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Yp(){return[]}function Xp(e){return e==null?Yp:function(){return this.querySelectorAll(e)}}function Zp(e){return function(){return Jp(e.apply(this,arguments))}}function Qp(e){e=typeof e==`function`?Zp(e):Xp(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Fh(r,i)}function $p(e){return function(){return this.matches(e)}}function em(e){return function(t){return t.matches(e)}}var tm=Array.prototype.find;function nm(e){return function(){return tm.call(this.children,e)}}function rm(){return this.firstElementChild}function im(e){return this.select(e==null?rm:nm(typeof e==`function`?e:em(e)))}var am=Array.prototype.filter;function om(){return Array.from(this.children)}function sm(e){return function(){return am.call(this.children,e)}}function cm(e){return this.selectAll(e==null?om:sm(typeof e==`function`?e:em(e)))}function lm(e){typeof e!=`function`&&(e=$p(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Fh(r,this._parents)}function um(e){return Array(e.length)}function dm(){return new Fh(this._enter||this._groups.map(um),this._parents)}function fm(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}fm.prototype={constructor:fm,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function pm(e){return function(){return e}}function mm(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new fm(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function hm(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new fm(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function gm(e){return e.__data__}function _m(e,t){if(!arguments.length)return Array.from(this,gm);var n=t?hm:mm,r=this._parents,i=this._groups;typeof e!=`function`&&(e=pm(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=vm(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Fh(o,r),o._enter=s,o._exit=c,o}function vm(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ym(){return new Fh(this._exit||this._groups.map(um),this._parents)}function bm(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function xm(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Fh(s,this._parents)}function Sm(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Cm(e){e||=wm;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Fh(i,this._parents).order()}function wm(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Tm(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Em(){return Array.from(this)}function Dm(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Om(){let e=0;for(let t of this)++e;return e}function km(){return!this.node()}function Am(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function jm(e){return function(){this.removeAttribute(e)}}function Mm(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Nm(e,t){return function(){this.setAttribute(e,t)}}function Pm(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Fm(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Im(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Lm(e,t){var n=Vp(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Mm:jm:typeof t==`function`?n.local?Im:Fm:n.local?Pm:Nm)(n,t))}function Rm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function zm(e){return function(){this.style.removeProperty(e)}}function Bm(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Vm(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Hm(e,t,n){return arguments.length>1?this.each((t==null?zm:typeof t==`function`?Vm:Bm)(e,t,n??``)):Um(this.node(),e)}function Um(e,t){return e.style.getPropertyValue(t)||Rm(e).getComputedStyle(e,null).getPropertyValue(t)}function Wm(e){return function(){delete this[e]}}function Gm(e,t){return function(){this[e]=t}}function Km(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function qm(e,t){return arguments.length>1?this.each((t==null?Wm:typeof t==`function`?Km:Gm)(e,t)):this.node()[e]}function Jm(e){return e.trim().split(/^|\s+/)}function Ym(e){return e.classList||new Xm(e)}function Xm(e){this._node=e,this._names=Jm(e.getAttribute(`class`)||``)}Xm.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Zm(e,t){for(var n=Ym(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Qm(e,t){for(var n=Ym(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function $m(e){return function(){Zm(this,e)}}function eh(e){return function(){Qm(this,e)}}function th(e,t){return function(){(t.apply(this,arguments)?Zm:Qm)(this,e)}}function nh(e,t){var n=Jm(e+``);if(arguments.length<2){for(var r=Ym(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?th:t?$m:eh)(n,t))}function rh(){this.textContent=``}function ih(e){return function(){this.textContent=e}}function ah(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function oh(e){return arguments.length?this.each(e==null?rh:(typeof e==`function`?ah:ih)(e)):this.node().textContent}function sh(){this.innerHTML=``}function ch(e){return function(){this.innerHTML=e}}function lh(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function uh(e){return arguments.length?this.each(e==null?sh:(typeof e==`function`?lh:ch)(e)):this.node().innerHTML}function dh(){this.nextSibling&&this.parentNode.appendChild(this)}function fh(){return this.each(dh)}function ph(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mh(){return this.each(ph)}function hh(e){var t=typeof e==`function`?e:Wp(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function gh(){return null}function _h(e,t){var n=typeof e==`function`?e:Wp(e),r=t==null?gh:typeof t==`function`?t:Kp(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function vh(){var e=this.parentNode;e&&e.removeChild(this)}function yh(){return this.each(vh)}function bh(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xh(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Sh(e){return this.select(e?xh:bh)}function Ch(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function wh(e){return function(t){e.call(this,t,this.__data__)}}function Th(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Eh(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Dh(e,t,n){return function(){var r=this.__on,i,a=wh(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Oh(e,t,n){var r=Th(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Dh:Eh,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function kh(e,t,n){var r=Rm(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Ah(e,t){return function(){return kh(this,e,t)}}function jh(e,t){return function(){return kh(this,e,t.apply(this,arguments))}}function Mh(e,t){return this.each((typeof t==`function`?jh:Ah)(e,t))}function*Nh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Ph=[null];function Fh(e,t){this._groups=e,this._parents=t}function Ih(){return new Fh([[document.documentElement]],Ph)}function Lh(){return this}Fh.prototype=Ih.prototype={constructor:Fh,select:qp,selectAll:Qp,selectChild:im,selectChildren:cm,filter:lm,data:_m,enter:dm,exit:ym,join:bm,merge:xm,selection:Lh,order:Sm,sort:Cm,call:Tm,nodes:Em,node:Dm,size:Om,empty:km,each:Am,attr:Lm,style:Hm,property:qm,classed:nh,text:oh,html:uh,raise:fh,lower:mh,append:hh,insert:_h,remove:yh,clone:Sh,datum:Ch,on:Oh,dispatch:Mh,[Symbol.iterator]:Nh};function Rh(e){return typeof e==`string`?new Fh([[document.querySelector(e)]],[document.documentElement]):new Fh([[e]],Ph)}function zh(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Bh(e,t){if(e=zh(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}M();var Vh=e=>typeof e==`string`?e:typeof e==`number`?`${e}px`:`30px`,Hh=({size:e,children:t})=>(e=Vh(e),(0,G.jsx)(`div`,{style:{height:e,width:e,display:`inline-block`,position:`relative`},children:t}));Hh.propTypes={size:j.number,children:j.oneOfType([j.arrayOf(j.node),j.node]).isRequired},M();var Uh=({size:e,children:t,sx:n})=>(0,G.jsx)(Hh,{size:e,children:(0,G.jsx)(`svg`,{preserveAspectRatio:`xMinYMin meet`,viewBox:`0 0 44 40`,style:{enableBackground:`new 0 0 44 40`,...n},children:t})});Uh.propTypes={size:j.oneOfType([j.string,j.number]),children:j.oneOfType([j.arrayOf(j.node),j.node]).isRequired,sx:j.object};var Wh=({fill:e})=>(0,G.jsx)(`polygon`,{points:`17.4,26.9 10.1,20.6 12.8,17.5 16.3,20.5 22.3,9.7 25.9,11.7`,fill:e});Wh.propTypes={fill:j.string.isRequired};var Gh=({fill:e})=>(0,G.jsx)(`polygon`,{transform:`translate(2, 0)`,points:`34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3`,fill:e});Gh.propTypes={fill:j.string.isRequired};var Kh=({fill:e})=>(0,G.jsx)(`path`,{transform:`translate(1, 0)`,d:`M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z`,fill:e});Kh.propTypes={fill:j.string.isRequired};var qh=({fill:e})=>(0,G.jsx)(`circle`,{transform:`translate(-3,0)`,cx:`23`,cy:`20.4`,r:`16`,fill:e});qh.propTypes={fill:j.string.isRequired};var Jh=({fill:e})=>(0,G.jsx)(`rect`,{x:`3.6`,y:`4.1`,width:`32`,height:`32`,fill:e});Jh.propTypes={fill:j.string.isRequired},M();var Yh=(e,t)=>{class n extends W.Component{static propTypes={iconSet:j.oneOf([`emoji`,`check`]),shape:j.oneOf([`round`,`square`]),category:j.oneOf([`feedback`,void 0]),open:j.bool,size:j.oneOfType([j.number,j.string]),fg:j.string,bg:j.string};static defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,size:30,fg:`#4aaf46`,bg:`#f8ffe2`};render(){let{iconSet:n,shape:r,category:i,open:a,size:o,fg:s,bg:c}=this.props,l=n===`check`?(0,G.jsx)(e,{fill:s}):(0,G.jsx)(t,{fill:s}),u=n===`check`?(0,G.jsx)(e,{fill:c}):(0,G.jsx)(t,{fill:c});return a?(0,G.jsx)(Uh,{size:o,children:u}):(0,G.jsxs)(Uh,{size:o,children:[i===`feedback`?r===`round`?(0,G.jsx)(Kh,{fill:c}):(0,G.jsx)(Gh,{fill:c}):r===`round`?(0,G.jsx)(qh,{fill:c}):(0,G.jsx)(Jh,{fill:c}),l]})}}return n};M();var Xh=({fill:e})=>(0,G.jsxs)(`g`,{transform:`translate(1, 0)`,children:[(0,G.jsx)(`path`,{d:`M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2
44
- c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z`,fill:e}),(0,G.jsx)(`rect`,{x:`21.1`,y:`13.1`,width:`3.7`,height:`4.7`,fill:e}),(0,G.jsx)(`rect`,{x:`12.7`,y:`13.1`,width:`3.7`,height:`4.7`,fill:e})]});Xh.propTypes={fill:j.string.isRequired};var Zh=({fill:e,x:t=0,y:n=0})=>(0,G.jsx)(`polygon`,{transform:`translate(${t}, ${n})`,points:`19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4`,fill:e});Zh.propTypes={fill:j.string.isRequired,x:j.number,y:j.number};var Qh=Yh(Zh,Xh);Qh.propTypes={iconSet:j.oneOf([`emoji`,`check`]),shape:j.oneOf([`round`,`square`]),category:j.oneOf([`feedback`,void 0]),open:j.bool,fg:j.string,bg:j.string,size:j.oneOfType([j.string,j.number])},Qh.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#4aaf46`,bg:`#f8ffe2`,size:30},M();var $h=({bgFill:e,fgFill:t})=>(0,G.jsxs)(`svg`,{preserveAspectRatio:`xMinYMin meet`,version:`1.1`,viewBox:`-283 359 34 35`,style:{enableBackground:`new -283 359 34 35`},children:[(0,G.jsx)(`circle`,{cx:`-266`,cy:`375.9`,r:`14`,fill:e}),(0,G.jsx)(`path`,{d:`M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z
45
- M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z`,fill:e}),(0,G.jsx)(`polygon`,{points:`-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6`,fill:t})]});$h.propTypes={bgFill:j.string.isRequired,fgFill:j.string.isRequired};var eg=({bgFill:e,fgFill:t,borderFill:n})=>(0,G.jsxs)(`svg`,{preserveAspectRatio:`xMinYMin meet`,version:`1.1`,viewBox:`-129.5 127 34 35`,style:{enableBackground:`new -129.5 127 34 35`},children:[(0,G.jsx)(`path`,{style:{fill:`#D0CAC5`,stroke:`#E6E3E0`,strokeWidth:.75,strokeMiterlimit:10},d:`M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5
46
- C-97.4,153.5-104.3,160.4-112.9,160.4z`}),(0,G.jsx)(`path`,{style:{fill:`#B3ABA4`,stroke:`#CDC7C2`,strokeWidth:.5,strokeMiterlimit:10},d:`M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z`}),(0,G.jsx)(`circle`,{cx:`-114.2`,cy:`143.5`,r:`14`,fill:e}),(0,G.jsx)(`path`,{d:`M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z
47
- M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z`,fill:n}),(0,G.jsx)(`polygon`,{points:`-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2`,fill:t})]});eg.propTypes={bgFill:j.string.isRequired,fgFill:j.string.isRequired,borderFill:j.string.isRequired};var tg=J(`div`)(({size:e})=>({width:e||`25px`,height:e||`25px`})),ng=({open:e,size:t})=>(0,G.jsx)(tg,{size:t,children:e?(0,G.jsx)($h,{bgFill:`#bce2ff`,fgFill:`#1a9cff`}):(0,G.jsx)(eg,{bgFill:`white`,fgFill:`#1a9cff`,borderFill:`#bce2ff`})});ng.propTypes={open:j.bool,size:j.string},ng.defaultProps={open:!1},M();var rg=({fill:e})=>(0,G.jsxs)(`g`,{transform:`translate(0.5, 0.5)`,children:[(0,G.jsx)(`rect`,{x:`11`,y:`17.3`,transform:`matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)`,width:`16.6`,height:`3.7`,fill:e}),(0,G.jsx)(`rect`,{x:`17.4`,y:`10.7`,transform:`matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)`,width:`3.7`,height:`16.6`,fill:e})]});rg.propTypes={fill:j.string.isRequired};var ig=({fill:e})=>(0,G.jsxs)(`g`,{transform:`translate(1,0)`,children:[(0,G.jsx)(`rect`,{x:`21`,y:`12.9`,width:`3.7`,height:`4.7`,fill:e}),(0,G.jsx)(`rect`,{x:`12.7`,y:`12.9`,width:`3.7`,height:`4.7`,fill:e}),(0,G.jsx)(`rect`,{x:`12.2`,y:`22.5`,width:`13`,height:`3.3`,fill:e})]});ig.propTypes={fill:j.string.isRequired};var ag=Yh(rg,ig);ag.propTypes={iconSet:j.oneOf([`emoji`,`check`]),shape:j.oneOf([`round`,`square`]),category:j.oneOf([`feedback`,void 0]),open:j.bool,fg:j.string,bg:j.string,size:j.oneOfType([j.string,j.number])},ag.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#fcb733`,bg:`#fbf2e3`,size:30},M();var og=({fill:e})=>(0,G.jsxs)(`g`,{children:[(0,G.jsx)(`rect`,{x:`19.3`,y:`10.3`,width:`4.5`,height:`12.7`,fill:e}),(0,G.jsx)(`rect`,{x:`19.3`,y:`26.2`,width:`4.5`,height:`4.5`,fill:e})]});og.propTypes={fill:j.string.isRequired};var sg=({fill:e})=>(0,G.jsx)(`polygon`,{points:`14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5`,fill:e});sg.propTypes={fill:j.string.isRequired};var cg=({fill:e})=>(0,G.jsxs)(`g`,{children:[(0,G.jsx)(`rect`,{x:`23.8`,y:`15`,width:`3.5`,height:`4.4`,fill:e}),(0,G.jsx)(`rect`,{x:`16`,y:`15`,width:`3.5`,height:`4.4`,fill:e}),(0,G.jsx)(`path`,{d:`M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0
48
- C25.7,26.4,25,27.1,24.2,27.1z`,fill:e})]});cg.propTypes={fill:j.string.isRequired};var lg=class extends W.Component{constructor(e){super(e);let{fg:t=`#464146`,bg:n=`white`}=this.props;this.icons={check:(0,G.jsxs)(Uh,{children:[(0,G.jsx)(sg,{fill:n}),(0,G.jsx)(og,{fill:t})]}),emoji:(0,G.jsxs)(Uh,{children:[(0,G.jsx)(sg,{fill:n}),(0,G.jsx)(cg,{fill:t})]}),feedback:{check:(0,G.jsxs)(Uh,{children:[(0,G.jsx)(sg,{fill:n}),(0,G.jsx)(cg,{fill:t})]}),emoji:(0,G.jsxs)(Uh,{children:[(0,G.jsx)(sg,{fill:n}),(0,G.jsx)(cg,{fill:t})]}),square:{check:(0,G.jsxs)(Uh,{children:[(0,G.jsx)(sg,{fill:n}),(0,G.jsx)(og,{fill:t})]}),emoji:(0,G.jsxs)(Uh,{children:[(0,G.jsx)(sg,{fill:n}),(0,G.jsx)(cg,{fill:t})]}),open:{check:(0,G.jsx)(Uh,{children:(0,G.jsx)(og,{fill:n})}),emoji:(0,G.jsx)(Uh,{children:(0,G.jsx)(cg,{fill:n})})}}}}}render(){let{iconSet:e,category:t,shape:n,open:r}=this.props;return t===void 0?this.icons[e]:n===void 0?this.icons.feedback[e]:r===!0?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}};lg.propTypes={iconSet:j.oneOf([`emoji`,`check`,void 0]),shape:j.oneOf([`square`,void 0]),category:j.oneOf([`feedback`,void 0]),open:j.bool,fg:j.string,bg:j.string},lg.defaultProps={iconSet:`check`,shape:void 0,category:void 0,open:!1,fg:`#464146`,bg:`white`},M();var ug=({fill:e})=>(0,G.jsxs)(`g`,{transform:`translate(0, 0)`,children:[(0,G.jsx)(`polygon`,{points:`27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6`,fill:e}),(0,G.jsx)(`polygon`,{points:`16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3`,fill:e})]});ug.propTypes={fill:j.string.isRequired};var dg=({fill:e})=>(0,G.jsxs)(`g`,{transform:`translate(2, 0)`,children:[(0,G.jsx)(`rect`,{x:`20.6`,y:`11.8`,width:`4`,height:`5`,fill:e}),(0,G.jsx)(`rect`,{x:`11.5`,y:`11.8`,width:`4`,height:`5`,fill:e}),(0,G.jsx)(`rect`,{x:`10.9`,y:`22.9`,transform:`matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)`,width:`14.3`,height:`3.7`,fill:e})]});dg.propTypes={fill:j.string.isRequired};var fg=Yh(ug,dg);fg.propTypes={iconSet:j.oneOf([`emoji`,`check`]),shape:j.oneOf([`round`,`square`]),category:j.oneOf([`feedback`,void 0]),open:j.bool,fg:j.string,bg:j.string,size:j.oneOfType([j.string,j.number])},fg.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#4aaf46`,bg:`#c1e1ac`,size:30};function pg(e){return typeof e==`string`}M();function mg(e){return(0,G.jsx)(Gr,{...e,defaultTheme:Mo,themeId:P})}function hg(e){return function(t){return(0,G.jsx)(mg,{styles:typeof e==`function`?n=>e({theme:n,...t}):e})}}function gg(){return qr}M();function _g(e){return Ui(e)}function vg(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}var yg=vg;function bg(e){return e&&e.ownerDocument||document}var xg=bg;function Sg(e){return bg(e).defaultView||window}var Cg=Sg,wg={};function Tg(e,t){let n=W.useRef(wg);return n.current===wg&&(n.current=e(t)),n}var Eg=[];function Dg(e){W.useEffect(e,Eg)}var Og=class e{static create(){return new e}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear};function kg(){let e=Tg(Og.create).current;return Dg(e.disposeEffect),e}function Ag(e){return e?.ref||null}function jg(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Mg(e,t){return Mg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mg(e,t)}function Ng(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Mg(e,t)}function Pg(e,t){return e.classList?!!t&&e.classList.contains(t):(` `+(e.className.baseVal||e.className)+` `).indexOf(` `+t+` `)!==-1}function Fg(e,t){e.classList?e.classList.add(t):Pg(e,t)||(typeof e.className==`string`?e.className=e.className+` `+t:e.setAttribute(`class`,(e.className&&e.className.baseVal||``)+` `+t))}function Ig(e,t){return e.replace(RegExp(`(^|\\s)`+t+`(?:\\s|$)`,`g`),`$1`).replace(/\s+/g,` `).replace(/^\s*|\s*$/g,``)}function Lg(e,t){e.classList?e.classList.remove(t):typeof e.className==`string`?e.className=Ig(e.className,t):e.setAttribute(`class`,Ig(e.className&&e.className.baseVal||``,t))}var Rg={disabled:!1},zg=W.createContext(null),Bg=function(e){return e.scrollTop};M();var Vg=u(_()),Hg=`unmounted`,Ug=`exited`,Wg=`entering`,Gg=`entered`,Kg=`exiting`,qg=function(e){Ng(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=Ug,r.appearStatus=Wg):o=Gg:o=t.unmountOnExit||t.mountOnEnter?Hg:Ug,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:Ug}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=Wg):(n===`entering`||n===`entered`)&&(t=Kg)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Vg.findDOMNode(this);n&&Bg(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:Hg})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[Vg.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||Rg.disabled){this.safeSetState({status:Gg},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:Wg},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:Gg},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Vg.findDOMNode(this);if(!t||Rg.disabled){this.safeSetState({status:Ug},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:Kg},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Ug},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Vg.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=jg(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return W.createElement(zg.Provider,{value:null},typeof n==`function`?n(e,r):W.cloneElement(W.Children.only(n),r))},t}(W.Component);qg.contextType=zg,qg.propTypes={};function Jg(){}qg.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Jg,onEntering:Jg,onEntered:Jg,onExit:Jg,onExiting:Jg,onExited:Jg},qg.UNMOUNTED=Hg,qg.EXITED=Ug,qg.ENTERING=Wg,qg.ENTERED=Gg,qg.EXITING=Kg,M();var zee=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return Fg(e,t)})},Yg=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return Lg(e,t)})},Xg=function(e){Ng(t,e);function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return t=e.call.apply(e,[this].concat(r))||this,t.appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1];t.removeClasses(i,`exit`),t.addClass(i,a?`appear`:`enter`,`base`),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?`appear`:`enter`;t.addClass(i,a,`active`),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],a=r[1]?`appear`:`enter`;t.removeClasses(i,a),t.addClass(i,a,`done`),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,`appear`),t.removeClasses(n,`enter`),t.addClass(n,`exit`,`base`),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,`exit`,`active`),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,`exit`),t.addClass(n,`exit`,`done`),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r=typeof n==`string`,i=r&&n?n+`-`:``,a=r?``+i+e:n[e];return{baseClassName:a,activeClassName:r?a+`-active`:n[e+`Active`],doneClassName:r?a+`-done`:n[e+`Done`]}},t}var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+`ClassName`],i=this.getClassNames(`enter`).doneClassName;t===`appear`&&n===`done`&&i&&(r+=` `+i),n===`active`&&e&&Bg(e),r&&(this.appliedClasses[t][n]=r,zee(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,a=n.done;this.appliedClasses[t]={},r&&Yg(e,r),i&&Yg(e,i),a&&Yg(e,a)},n.render=function(){var e=this.props;e.classNames;var t=jg(e,[`classNames`]);return W.createElement(qg,F({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(W.Component);Xg.defaultProps={classNames:``},Xg.propTypes={};function Zg(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Qg(e,t){var n=function(e){return t&&(0,W.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&W.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function Bee(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function $g(e,t,n){return n[t]==null?e.props[t]:n[t]}function Vee(e,t){return Qg(e.children,function(n){return(0,W.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:$g(n,`appear`,e),enter:$g(n,`enter`,e),exit:$g(n,`exit`,e)})})}function Hee(e,t,n){var r=Qg(e.children),i=Bee(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,W.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,W.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,W.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:$g(o,`exit`,e),enter:$g(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,W.cloneElement)(o,{in:!1}):c&&s&&(0,W.isValidElement)(l)&&(i[a]=(0,W.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:$g(o,`exit`,e),enter:$g(o,`enter`,e)}))}}),i}M();var Uee=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Wee={component:`div`,childFactory:function(e){return e}},e_=function(e){Ng(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(Zg(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?Vee(e,r):Hee(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=Qg(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=F({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=jg(e,[`component`,`childFactory`]),i=this.state.contextValue,a=Uee(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?W.createElement(zg.Provider,{value:i},a):W.createElement(zg.Provider,{value:i},W.createElement(t,r,a))},t}(W.Component);e_.propTypes={},e_.defaultProps=Wee;var t_=e=>e.scrollTop;function n_(e,t){return n=>{if(t){let r=e.current;n===void 0?t(r):t(r,n)}}}function r_(e,t,n,r,i,a){let o=e===`exited`&&!t?r:n[e]||n.exited;return i||a?{...o,...i,...a}:o}function i_(e,t){let{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n==`number`?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r==`object`?r[t.mode]:r),delay:i.transitionDelay}}function a_(...e){let t=W.useRef(void 0),n=W.useCallback(t=>{let n=e.map(e=>{if(e==null)return null;if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}});return()=>{n.forEach(e=>e?.())}},e);return W.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var o_=a_;M();function s_(e){return`scale(${e}, ${e**2})`}var Gee={entering:{opacity:1,transform:s_(1)},entered:{opacity:1,transform:`none`},exiting:{opacity:0,transform:s_(.75)},exited:{opacity:0,transform:s_(.75)}},Kee={opacity:0,transform:s_(.75),visibility:`hidden`},c_=W.forwardRef(function(e,t){let{addEndListener:n,appear:r=!0,children:i,easing:a,in:o,onEnter:s,onEntered:c,onEntering:l,onExit:u,onExited:d,onExiting:f,style:p,timeout:m=`auto`,...h}=e,g=kg(),_=W.useRef(),v=No(),y=W.useRef(null),b=o_(y,Ag(i),t),x=n_(y,l),S=n_(y,(e,t)=>{t_(e);let{duration:n,delay:r,easing:i}=i_({style:p,timeout:m,easing:a},{mode:`enter`}),o;m===`auto`?(o=v.transitions.getAutoHeightDuration(e.clientHeight),_.current=o):o=n,e.style.transition=[v.transitions.create(`opacity`,{duration:o,delay:r}),v.transitions.create(`transform`,{duration:o*.666,delay:r,easing:i})].join(`,`),s&&s(e,t)}),C=n_(y,c),w=n_(y,f),T=n_(y,e=>{let{duration:t,delay:n,easing:r}=i_({style:p,timeout:m,easing:a},{mode:`exit`}),i;m===`auto`?(i=v.transitions.getAutoHeightDuration(e.clientHeight),_.current=i):i=t,e.style.transition=[v.transitions.create(`opacity`,{duration:i,delay:n}),v.transitions.create(`transform`,{duration:i*.666,delay:n||i*.333,easing:r})].join(`,`),e.style.opacity=0,e.style.transform=s_(.75),u&&u(e)}),E=n_(y,e=>{e.style.transition=``,d&&d(e)});return(0,G.jsx)(qg,{appear:r,in:o,nodeRef:y,onEnter:S,onEntered:C,onEntering:x,onExit:T,onExited:E,onExiting:w,addEndListener:e=>{m===`auto`&&g.start(_.current||0,e),n&&n(y.current,e)},timeout:m===`auto`?null:m,...h,children:(e,{ownerState:t,...n})=>{let r=r_(e,o,Gee,Kee,p,i.props.style);return W.cloneElement(i,{style:r,ref:b,...n})}})});c_&&(c_.muiSupportAuto=!0);function l_(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}function qee(e){let t=bg(e);return t.body===e?Sg(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function u_(e,t){t?e.setAttribute(`aria-hidden`,`true`):e.removeAttribute(`aria-hidden`)}function d_(e){return parseFloat(Sg(e).getComputedStyle(e).paddingRight)||0}function Jee(e){let t=[`TEMPLATE`,`SCRIPT`,`STYLE`,`LINK`,`MAP`,`META`,`NOSCRIPT`,`PICTURE`,`COL`,`COLGROUP`,`PARAM`,`SLOT`,`SOURCE`,`TRACK`].includes(e.tagName),n=e.tagName===`INPUT`&&e.getAttribute(`type`)===`hidden`;return t||n}function f_(e,t,n,r,i){let a=[t,n,...r];[].forEach.call(e.children,e=>{let t=!a.includes(e),n=!Jee(e);t&&n&&u_(e,i)})}function p_(e,t){let n=-1;return e.some((e,r)=>t(e)?(n=r,!0):!1),n}function Yee(e,t){let n=[],r=e.container;if(!t.disableScrollLock){if(qee(r)){let e=l_(Sg(r));n.push({value:r.style.paddingRight,property:`padding-right`,el:r}),r.style.paddingRight=`${d_(r)+e}px`;let t=bg(r).querySelectorAll(`.mui-fixed`);[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:`padding-right`,el:t}),t.style.paddingRight=`${d_(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=bg(r).body;else{let t=r.parentElement,n=Sg(r);e=t?.nodeName===`HTML`&&n.getComputedStyle(t).overflowY===`scroll`?t:r}n.push({value:e.style.overflow,property:`overflow`,el:e},{value:e.style.overflowX,property:`overflow-x`,el:e},{value:e.style.overflowY,property:`overflow-y`,el:e}),e.style.overflow=`hidden`}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}function Xee(e){let t=[];return[].forEach.call(e.children,e=>{e.getAttribute(`aria-hidden`)===`true`&&t.push(e)}),t}var Zee=class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(n!==-1)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&u_(e.modalRef,!1);let r=Xee(t);f_(t,e.mount,e.modalRef,r,!0);let i=p_(this.containers,e=>e.container===t);return i===-1?(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n):(this.containers[i].modals.push(e),n)}mount(e,t){let n=p_(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||=Yee(r,t)}remove(e,t=!0){let n=this.modals.indexOf(e);if(n===-1)return n;let r=p_(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),e.modalRef&&u_(e.modalRef,t),f_(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&u_(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function Qee(e,t){if(!e||!t)return!1;if(e.contains(t))return!0;let n=t.getRootNode?.();if(n&&n instanceof ShadowRoot){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode??n.host??null}}return!1}var m_=Qee;function $ee(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}var h_=$ee,g_=`data-mui-focusable`;function ete(e){return e?e.hasAttribute(`data-mui-focusable`)?e:e.querySelector(`[${g_}]`):null}M();var tte=[`input`,`select`,`textarea`,`a[href]`,`button`,`[tabindex]`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function nte(e){let t=parseInt(e.getAttribute(`tabindex`)||``,10);return Number.isNaN(t)?e.contentEditable===`true`||(e.nodeName===`AUDIO`||e.nodeName===`VIDEO`||e.nodeName===`DETAILS`)&&e.getAttribute(`tabindex`)===null?0:e.tabIndex:t}function rte(e){if(e.tagName!==`INPUT`||e.type!==`radio`||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||=t(`[name="${e.name}"]`),n!==e}function ite(e){return!(e.disabled||e.tagName===`INPUT`&&e.type===`hidden`||rte(e))}function ate(e){let t=[],n=[];return Array.from(e.querySelectorAll(tte)).forEach((e,r)=>{let i=nte(e);i===-1||!ite(e)||(i===0?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function ote(){return!0}function ste(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=ate,isEnabled:o=ote,open:s}=e,c=W.useRef(!1),l=W.useRef(null),u=W.useRef(null),d=W.useRef(null),f=W.useRef(null),p=W.useRef(!1),m=W.useRef(null),h=a_(Ag(t),m),g=W.useRef(null);W.useEffect(()=>{!s||!m.current||(p.current=!n)},[n,s]),W.useEffect(()=>{if(c.current=!1,!s||!m.current)return;let e=h_(bg(m.current)),t=ete(m.current)??m.current;return m_(m.current,e)||(t.hasAttribute(`tabIndex`)||t.setAttribute(`tabIndex`,`-1`),p.current&&t.focus()),()=>{i||(d.current&&d.current.focus&&(c.current=!0,d.current.focus()),d.current=null)}},[s]),W.useEffect(()=>{if(!s||!m.current)return;let e=bg(m.current),t=t=>{g.current=t,!(r||!o()||t.key!==`Tab`)&&h_(e)===m.current&&t.shiftKey&&(c.current=!0,u.current&&u.current.focus())},n=()=>{let t=m.current;if(t===null)return;let n=h_(e);if(!e.hasFocus()||!o()||c.current){c.current=!1;return}if(m_(t,n)||r&&n!==l.current&&n!==u.current)return;if(n!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let i=[];if((n===l.current||n===u.current)&&(i=a(m.current)),i.length>0){let e=!!(g.current?.shiftKey&&g.current?.key===`Tab`),t=i[0],n=i[i.length-1];typeof t!=`string`&&typeof n!=`string`&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener(`focusin`,n),e.addEventListener(`keydown`,t,!0);let i=setInterval(()=>{let t=h_(e);t&&t.tagName===`BODY`&&n()},50);return()=>{clearInterval(i),e.removeEventListener(`focusin`,n),e.removeEventListener(`keydown`,t,!0)}},[n,r,i,o,s,a]);let _=e=>{d.current===null&&(d.current=e.relatedTarget),p.current=!0,f.current=e.target;let n=t.props.onFocus;n&&n(e)},v=e=>{d.current===null&&(d.current=e.relatedTarget),p.current=!0};return(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(`div`,{tabIndex:s?0:-1,onFocus:v,ref:l,"data-testid":`sentinelStart`}),W.cloneElement(t,{ref:h,onFocus:_}),(0,G.jsx)(`div`,{tabIndex:s?0:-1,onFocus:v,ref:u,"data-testid":`sentinelEnd`})]})}function __(e,t){typeof e==`function`?e(t):e&&(e.current=t)}M();function cte(e){return typeof e==`function`?e():e}var v_=W.forwardRef(function(e,t){let{children:n,container:r,disablePortal:i=!1}=e,[a,o]=W.useState(null),s=a_(W.isValidElement(n)?Ag(n):null,t);if(pi(()=>{i||o(cte(r)||document.body)},[r,i]),pi(()=>{if(a&&!i)return __(t,a),()=>{__(t,null)}},[t,a,i]),i){if(W.isValidElement(n)){let e={ref:s};return W.cloneElement(n,e)}return n}return a&&Vg.createPortal(n,a)}),y_=$i;function b_(e,t,n){return e===void 0||pg(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function x_(e,t,n){return typeof e==`function`?e(t,n):e}function S_(e,t=[]){if(e===void 0)return{};let n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]==`function`&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function C_(e){if(e===void 0)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&typeof e[t]==`function`)).forEach(n=>{t[n]=e[n]}),t}function w_(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){let e=K(n?.className,a,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},o={...n,...i,...r};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}let o=S_({...i,...r}),s=C_(r),c=C_(i),l=t(o),u=K(l?.className,n?.className,a,i?.className,r?.className),d={...l?.style,...n?.style,...i?.style,...r?.style},f={...l,...n,...c,...s};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}function T_(e,t){let{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...c}=t,{component:l,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...f}=a,p=u[e]||r,m=x_(d[e],i),{props:{component:h,...g},internalRef:_}=w_({className:n,...c,externalForwardedProps:e===`root`?f:void 0,externalSlotProps:m}),v=a_(_,m?.ref,t.ref),y=e===`root`?h||l:h;return[p,b_(p,{...e===`root`&&!l&&!u[e]&&o,...e!==`root`&&!u[e]&&o,...g,...y&&!s&&{as:y},...y&&s&&{component:y},ref:v},i)]}M();var lte={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0}},ute={opacity:0,visibility:`hidden`},E_=W.forwardRef(function(e,t){let n=No(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:o,easing:s,in:c,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:p,onExiting:m,style:h,timeout:g=r,..._}=e,v=W.useRef(null),y=o_(v,Ag(o),t),b=n_(v,d),x=n_(v,(e,t)=>{t_(e);let r=i_({style:h,timeout:g,easing:s},{mode:`enter`});e.style.transition=n.transitions.create(`opacity`,r),l&&l(e,t)}),S=n_(v,u),C=n_(v,m),w=n_(v,e=>{let t=i_({style:h,timeout:g,easing:s},{mode:`exit`});e.style.transition=n.transitions.create(`opacity`,t),f&&f(e)}),T=n_(v,e=>{e.style.transition=``,p&&p(e)});return(0,G.jsx)(qg,{appear:a,in:c,nodeRef:v,onEnter:x,onEntered:S,onEntering:b,onExit:w,onExited:T,onExiting:C,addEndListener:e=>{i&&i(v.current,e)},timeout:g,..._,children:(e,{ownerState:t,...n})=>{let r=r_(e,c,lte,ute,h,o.props.style);return W.cloneElement(o,{style:r,ref:y,...n})}})});function dte(e){return Qr(`MuiBackdrop`,e)}$r(`MuiBackdrop`,[`root`,`invisible`]),M();var fte=e=>{let{classes:t,invisible:n}=e;return ba({root:[`root`,n&&`invisible`]},dte,t)},pte=J(`div`,{name:`MuiBackdrop`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:`fixed`,display:`flex`,alignItems:`center`,justifyContent:`center`,right:0,bottom:0,top:0,left:0,backgroundColor:`rgba(0, 0, 0, 0.5)`,WebkitTapHighlightColor:`transparent`,variants:[{props:{invisible:!0},style:{backgroundColor:`transparent`}}]}),D_=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiBackdrop`}),{children:r,className:i,component:a=`div`,invisible:o=!1,open:s,components:c={},componentsProps:l={},slotProps:u={},slots:d={},TransitionComponent:f,transitionDuration:p,...m}=n,h={...n,component:a,invisible:o},g=fte(h),_={component:a,slots:{transition:f,root:c.Root,...d},slotProps:{...l,...u}},[v,y]=T_(`root`,{elementType:pte,externalForwardedProps:_,className:K(g.root,i),ownerState:h}),[b,x]=T_(`transition`,{elementType:E_,externalForwardedProps:_,ownerState:h});return(0,G.jsx)(b,{in:s,timeout:p,...m,...x,children:(0,G.jsx)(v,{"aria-hidden":!0,...y,ref:t,children:r})})});function O_(e){let t=W.useRef(e);return pi(()=>{t.current=e}),W.useRef((...e)=>(0,t.current)(...e)).current}function k_(...e){return e.reduce((e,t)=>t==null?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function mte(e){return typeof e==`function`?e():e}function hte(e){return e?e.props.hasOwnProperty(`in`):!1}var A_=()=>{},j_=new Zee;function gte(e){let{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:a,onTransitionExited:o,children:s,onClose:c,open:l,rootRef:u}=e,d=W.useRef({}),f=W.useRef(null),p=W.useRef(null),m=a_(p,u),[h,g]=W.useState(!l),_=hte(s),v=!0;(e[`aria-hidden`]===`false`||e[`aria-hidden`]===!1)&&(v=!1);let y=()=>bg(f.current),b=()=>(d.current.modalRef=p.current,d.current.mount=f.current,d.current),x=()=>{j_.mount(b(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},S=O_(()=>{let e=mte(t)||y().body;j_.add(b(),e),p.current&&x()}),C=()=>j_.isTopModal(b()),w=O_(e=>{f.current=e,e&&(l&&C()?x():p.current&&u_(p.current,v))}),T=W.useCallback(()=>{j_.remove(b(),v)},[v]);W.useEffect(()=>()=>{T()},[T]),W.useEffect(()=>{l?S():(!_||!i)&&T()},[l,T,_,i,S]);let E=e=>t=>{e.onKeyDown?.(t),!(t.key!==`Escape`||t.which===229||!C())&&(n||(t.stopPropagation(),c&&c(t,`escapeKeyDown`)))},D=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&c&&c(t,`backdropClick`)};return{getRootProps:(t={})=>{let n=S_(e);delete n.onTransitionEnter,delete n.onTransitionExited;let r={...n,...t};return{role:`presentation`,...r,onKeyDown:E(r),ref:m}},getBackdropProps:(e={})=>{let t=e;return{"aria-hidden":!0,...t,onClick:D(t),open:l}},getTransitionProps:()=>({onEnter:k_(()=>{g(!1),a&&a()},s?.props.onEnter??A_),onExited:k_(()=>{g(!0),o&&o(),i&&T()},s?.props.onExited??A_)}),rootRef:m,portalRef:w,isTopModal:C,exited:h,hasTransition:_}}function _te(e){return Qr(`MuiModal`,e)}$r(`MuiModal`,[`root`,`hidden`,`backdrop`]),M();var vte=e=>{let{open:t,exited:n,classes:r}=e;return ba({root:[`root`,!t&&n&&`hidden`],backdrop:[`backdrop`]},_te,r)},yte=J(`div`,{name:`MuiModal`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(y_(({theme:e})=>({position:`fixed`,zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:`hidden`}}]}))),bte=J(D_,{name:`MuiModal`,slot:`Backdrop`})({zIndex:-1}),M_=W.forwardRef(function(e,t){let n=_g({name:`MuiModal`,props:e}),{BackdropComponent:r=bte,BackdropProps:i,classes:a,className:o,closeAfterTransition:s=!1,children:c,container:l,component:u,components:d={},componentsProps:f={},disableAutoFocus:p=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:h=!1,disablePortal:g=!1,disableRestoreFocus:_=!1,disableScrollLock:v=!1,hideBackdrop:y=!1,keepMounted:b=!1,onClose:x,onTransitionEnter:S,onTransitionExited:C,open:w,slotProps:T={},slots:E={},theme:D,...O}=n,k={...n,closeAfterTransition:s,disableAutoFocus:p,disableEnforceFocus:m,disableEscapeKeyDown:h,disablePortal:g,disableRestoreFocus:_,disableScrollLock:v,hideBackdrop:y,keepMounted:b},{getRootProps:A,getBackdropProps:j,getTransitionProps:M,portalRef:N,isTopModal:P,exited:F,hasTransition:ee}=gte({...k,rootRef:t}),te={...k,exited:F},I=vte(te),ne={};if(c.props.tabIndex===void 0&&(ne.tabIndex=`-1`),ee){let{onEnter:e,onExited:t}=M();ne.onEnter=e,ne.onExited=t}let re={slots:{root:d.Root,backdrop:d.Backdrop,...E},slotProps:{...f,...T}},[ie,L]=T_(`root`,{ref:t,elementType:yte,externalForwardedProps:{...re,...O,component:u},getSlotProps:A,ownerState:te,className:K(o,I?.root,!te.open&&te.exited&&I?.hidden)}),[R,ae]=T_(`backdrop`,{ref:i?.ref,elementType:r,externalForwardedProps:re,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:e=>j({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:K(i?.className,I?.backdrop),ownerState:te});return!b&&!w&&(!ee||F)?null:(0,G.jsx)(v_,{ref:N,container:l,disablePortal:g,children:(0,G.jsxs)(ie,{...L,children:[!y&&r?(0,G.jsx)(R,{...ae}):null,(0,G.jsx)(ste,{disableEnforceFocus:m,disableAutoFocus:p,disableRestoreFocus:_,isEnabled:P,open:w,children:W.cloneElement(c,ne)})]})})});function xte(e){return Qr(`MuiPaper`,e)}$r(`MuiPaper`,`root.rounded.outlined.elevation.elevation0.elevation1.elevation2.elevation3.elevation4.elevation5.elevation6.elevation7.elevation8.elevation9.elevation10.elevation11.elevation12.elevation13.elevation14.elevation15.elevation16.elevation17.elevation18.elevation19.elevation20.elevation21.elevation22.elevation23.elevation24`.split(`.`)),M();var Ste=e=>{let{square:t,elevation:n,variant:r,classes:i}=e;return ba({root:[`root`,r,!t&&`rounded`,r===`elevation`&&`elevation${n}`]},xte,i)},Cte=J(`div`,{name:`MuiPaper`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant===`elevation`&&t[`elevation${n.elevation}`]]}})(y_(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create(`box-shadow`),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:`outlined`},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:`elevation`},style:{boxShadow:`var(--Paper-shadow)`,backgroundImage:`var(--Paper-overlay)`}}]}))),N_=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiPaper`}),r=No(),{className:i,component:a=`div`,elevation:o=1,square:s=!1,variant:c=`elevation`,...l}=n,u={...n,component:a,elevation:o,square:s,variant:c};return(0,G.jsx)(Cte,{as:a,ownerState:u,className:K(Ste(u).root,i),ref:t,...l,style:{...c===`elevation`&&{"--Paper-shadow":(r.vars||r).shadows[o],...r.vars&&{"--Paper-overlay":r.vars.overlays?.[o]},...!r.vars&&r.palette.mode===`dark`&&{"--Paper-overlay":`linear-gradient(${wi(`#fff`,mo(o))}, ${wi(`#fff`,mo(o))})`}},...l.style}})});function wte(e){return Qr(`MuiPopover`,e)}$r(`MuiPopover`,[`root`,`paper`]);var P_=Rn;function Tte(e){return Qr(`MuiSvgIcon`,e)}$r(`MuiSvgIcon`,[`root`,`colorPrimary`,`colorSecondary`,`colorAction`,`colorError`,`colorDisabled`,`fontSizeInherit`,`fontSizeSmall`,`fontSizeMedium`,`fontSizeLarge`]),M();var Ete=e=>{let{color:t,fontSize:n,classes:r}=e;return ba({root:[`root`,t!==`inherit`&&`color${P_(t)}`,`fontSize${P_(n)}`]},Tte,r)},F_=J(`svg`,{name:`MuiSvgIcon`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color!==`inherit`&&t[`color${P_(n.color)}`],t[`fontSize${P_(n.fontSize)}`]]}})(y_(({theme:e})=>({userSelect:`none`,width:`1em`,height:`1em`,display:`inline-block`,flexShrink:0,transition:e.transitions?.create?.(`fill`,{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:`currentColor`}},{props:{fontSize:`inherit`},style:{fontSize:`inherit`}},{props:{fontSize:`small`},style:{fontSize:e.typography?.pxToRem?.(20)||`1.25rem`}},{props:{fontSize:`medium`},style:{fontSize:e.typography?.pxToRem?.(24)||`1.5rem`}},{props:{fontSize:`large`},style:{fontSize:e.typography?.pxToRem?.(35)||`2.1875rem`}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:`action`},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:`disabled`},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:`inherit`},style:{color:void 0}}]}))),I_=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiSvgIcon`}),{children:r,className:i,color:a=`inherit`,component:o=`svg`,fontSize:s=`medium`,htmlColor:c,inheritViewBox:l=!1,titleAccess:u,viewBox:d=`0 0 24 24`,...f}=n,p=W.isValidElement(r)&&r.type===`svg`,m={...n,color:a,component:o,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:l,viewBox:d,hasSvgAsChild:p},h={};return l||(h.viewBox=d),(0,G.jsxs)(F_,{as:o,className:K(Ete(m).root,i),focusable:`false`,color:c,"aria-hidden":u?void 0:!0,role:u?`img`:void 0,ref:t,...h,...f,...p&&r.props,ownerState:m,children:[p?r.props.children:r,u?(0,G.jsx)(`title`,{children:u}):null]})});I_.muiName=`SvgIcon`;function L_(e,t){function n(t,n){return(0,G.jsx)(I_,{"data-testid":void 0,ref:n,...t,children:e})}return n.muiName=I_.muiName,W.memo(W.forwardRef(n))}var R_=xa,z_=pi,B_=qi;function V_(e){let{controlled:t,default:n,name:r,state:i=`value`}=e,{current:a}=W.useRef(t!==void 0),[o,s]=W.useState(n);return[a?t:o,W.useCallback(e=>{a||s(e)},[])]}var H_=V_,U_=O_;function W_(e,t){let n=e.charCodeAt(2);return e[0]===`o`&&e[1]===`n`&&n>=65&&n<=90&&typeof t==`function`}function Dte(e,t){if(!e)return t;function n(e,t){let n={};return Object.keys(t).forEach(r=>{W_(r,t[r])&&typeof e[r]==`function`&&(n[r]=(...n)=>{e[r](...n),t[r](...n)})}),n}if(typeof e==`function`||typeof t==`function`)return r=>{let i=typeof t==`function`?t(r):t,a=typeof e==`function`?e({...r,...i}):e,o=K(r?.className,i?.className,a?.className),s=n(a,i);return{...i,...a,...s,...!!o&&{className:o},...i?.style&&a?.style&&{style:{...i.style,...a.style}},...i?.sx&&a?.sx&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(a.sx)?a.sx:[a.sx]]}}};let r=t,i=n(e,r),a=K(r?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}M();function G_(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.height/2:t===`bottom`&&(n=e.height),n}function K_(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.width/2:t===`right`&&(n=e.width),n}function q_(e){return[e.horizontal,e.vertical].map(e=>typeof e==`number`?`${e}px`:e).join(` `)}function J_(e){return typeof e==`function`?e():e}var Y_=e=>{let{classes:t}=e;return ba({root:[`root`],paper:[`paper`]},wte,t)},X_=J(M_,{name:`MuiPopover`,slot:`Root`})({}),Z_=J(N_,{name:`MuiPopover`,slot:`Paper`})({position:`absolute`,overflowY:`auto`,overflowX:`hidden`,minWidth:16,minHeight:16,maxWidth:`calc(100% - 32px)`,maxHeight:`calc(100% - 32px)`,outline:0}),Q_=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiPopover`}),{action:r,anchorEl:i,anchorOrigin:a={vertical:`top`,horizontal:`left`},anchorPosition:o,anchorReference:s=`anchorEl`,children:c,className:l,container:u,elevation:d=8,marginThreshold:f=16,open:p,PaperProps:m={},slots:h={},slotProps:g={},transformOrigin:_={vertical:`top`,horizontal:`left`},TransitionComponent:v,transitionDuration:y=`auto`,TransitionProps:b={},disableScrollLock:x=!1,...S}=n,C=W.useRef(),w={...n,anchorOrigin:a,anchorReference:s,elevation:d,marginThreshold:f,transformOrigin:_,TransitionComponent:v,transitionDuration:y,TransitionProps:b},T=Y_(w),E=W.useCallback(()=>{if(s===`anchorPosition`)return o;let e=J_(i),t=(e&&e.nodeType===1?e:xg(C.current).body).getBoundingClientRect();return{top:t.top+G_(t,a.vertical),left:t.left+K_(t,a.horizontal)}},[i,a.horizontal,a.vertical,o,s]),D=W.useCallback(e=>({vertical:G_(e,_.vertical),horizontal:K_(e,_.horizontal)}),[_.horizontal,_.vertical]),O=W.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=D(t);if(s===`none`)return{top:null,left:null,transformOrigin:q_(n)};let r=E(),a=r.top-n.vertical,o=r.left-n.horizontal,c=a+t.height,l=o+t.width,u=Cg(J_(i)),d=u.innerHeight-f,p=u.innerWidth-f;if(f!==null&&a<f){let e=a-f;a-=e,n.vertical+=e}else if(f!==null&&c>d){let e=c-d;a-=e,n.vertical+=e}if(f!==null&&o<f){let e=o-f;o-=e,n.horizontal+=e}else if(l>p){let e=l-p;o-=e,n.horizontal+=e}return{top:`${Math.round(a)}px`,left:`${Math.round(o)}px`,transformOrigin:q_(n)}},[i,s,E,D,f]),[k,A]=W.useState(p),j=W.useCallback(()=>{let e=C.current;if(!e)return;let t=O(e);t.top!==null&&e.style.setProperty(`top`,t.top),t.left!==null&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,A(!0)},[O]);W.useEffect(()=>(x&&window.addEventListener(`scroll`,j),()=>window.removeEventListener(`scroll`,j)),[i,x,j]);let M=()=>{j()},N=()=>{A(!1)};W.useEffect(()=>{p&&j()}),W.useImperativeHandle(r,()=>p?{updatePosition:()=>{j()}}:null,[p,j]),W.useEffect(()=>{if(!p)return;let e=yg(()=>{j()}),t=Cg(J_(i));return t.addEventListener(`resize`,e),()=>{e.clear(),t.removeEventListener(`resize`,e)}},[i,p,j]);let P=y,F={slots:{transition:v,...h},slotProps:{transition:b,paper:m,...g}},[ee,te]=T_(`transition`,{elementType:c_,externalForwardedProps:F,ownerState:w,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),M()},onExited:t=>{e.onExited?.(t),N()}}),additionalProps:{appear:!0,in:p}});y===`auto`&&!ee.muiSupportAuto&&(P=void 0);let I=u||(i?xg(J_(i)).body:void 0),[ne,{slots:re,slotProps:ie,...L}]=T_(`root`,{ref:t,elementType:X_,externalForwardedProps:{...F,...S},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:h.backdrop},slotProps:{backdrop:Dte(typeof g.backdrop==`function`?g.backdrop(w):g.backdrop,{invisible:!0})},container:I,open:p},ownerState:w,className:K(T.root,l)}),[R,ae]=T_(`paper`,{ref:C,className:T.paper,elementType:Z_,externalForwardedProps:F,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:k?void 0:{opacity:0}},ownerState:w});return(0,G.jsx)(ne,{...L,...!pg(ne)&&{slots:re,slotProps:ie,disableScrollLock:x},children:(0,G.jsx)(ee,{...te,timeout:P,children:(0,G.jsx)(R,{...ae,children:c})})})}),$_={50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`,A100:`#ff80ab`,A200:`#ff4081`,A400:`#f50057`,A700:`#c51162`},ev={50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`,A100:`#8c9eff`,A200:`#536dfe`,A400:`#3d5afe`,A700:`#304ffe`},tv=c({background:()=>Tv,backgroundDark:()=>Ote,black:()=>jv,blueGrey100:()=>Rv,blueGrey300:()=>zv,blueGrey600:()=>Bv,blueGrey900:()=>Vv,border:()=>Dv,borderDark:()=>kv,borderGray:()=>Av,borderLight:()=>Ov,buttonBorder:()=>qv,buttonHoverBg:()=>Jv,correct:()=>sv,correctSecondary:()=>cv,correctTertiary:()=>lv,correctWithIcon:()=>uv,defaults:()=>X,disabled:()=>av,disabledSecondary:()=>ov,dropdownBackground:()=>Ate,fadedPrimary:()=>bv,focusChecked:()=>Pv,focusCheckedBorder:()=>Fv,focusUnchecked:()=>Iv,focusUncheckedBorder:()=>Lv,incorrect:()=>dv,incorrectSecondary:()=>pv,incorrectWithIcon:()=>fv,keypadButton:()=>Hv,keypadButtonHover:()=>Gv,keypadButtonOperator:()=>Uv,keypadButtonOperatorHover:()=>Kv,keypadEmptyPlaceholder:()=>Wv,missing:()=>mv,missingWithIcon:()=>hv,primary:()=>gv,primaryDark:()=>vv,primaryLight:()=>_v,primaryText:()=>yv,secondary:()=>xv,secondaryBackground:()=>kte,secondaryDark:()=>Cv,secondaryLight:()=>Sv,secondaryText:()=>wv,tertiary:()=>jte,tertiaryLight:()=>Ev,text:()=>iv,transparent:()=>Nv,v:()=>nv,visualElementsColors:()=>Yv,white:()=>Mv}),X={TEXT:`black`,DISABLED:`grey`,DISABLED_SECONDARY:`#ABABAB`,CORRECT:ka[500],CORRECT_SECONDARY:ka[50],CORRECT_TERTIARY:`#0EA449`,CORRECT_WITH_ICON:`#087D38`,INCORRECT:Ea[500],INCORRECT_SECONDARY:Ta[50],INCORRECT_WITH_ICON:`#BF0D00`,MISSING:Ta[700],MISSING_WITH_ICON:`#6A78A1`,PRIMARY:ev[500],PRIMARY_LIGHT:ev[200],PRIMARY_DARK:ev[800],SECONDARY:$_.A400,SECONDARY_LIGHT:$_[200],SECONDARY_DARK:$_[900],TERTIARY:`#146EB3`,TERTIARY_LIGHT:`#D0E2F0`,BACKGROUND:`rgba(255,255,255,0)`,BACKGROUND_DARK:`#ECEDF1`,DROPDOWN_BACKGROUND:`#E0E1E6`,SECONDARY_BACKGROUND:`rgba(241,241,241,1)`,BORDER:`#9A9A9A`,BORDER_LIGHT:`#D1D1D1`,BORDER_DARK:`#646464`,BORDER_GRAY:`#7E8494`,BLACK:`#000000`,WHITE:`#ffffff`,TRANSPARENT:`transparent`,FOCUS_CHECKED:`#BBDEFB`,FOCUS_CHECKED_BORDER:`#1565C0`,FOCUS_UNCHECKED:`#E0E0E0`,FOCUS_UNCHECKED_BORDER:`#757575`,BLUE_GREY100:`#F3F5F7`,BLUE_GREY300:`#C0C3CF`,BLUE_GREY600:`#7E8494`,BLUE_GREY900:`#152452`,FADED_PRIMARY:`#DCDAFB`,KEYPAD_BUTTON:`rgb(188, 194, 229)`,KEYPAD_BUTTON_OPERATOR:`rgb(255, 159, 192)`,KEYPAD_EMPTY_PLACEHOLDER:`rgba(245, 0, 87, 0.4)`,KEYPAD_BUTTON_HOVER:`rgb(214, 218, 239)`,KEYPAD_BUTTON_OPERATOR_HOVER:`rgb(255, 197, 217)`,BUTTON_BORDER:`rgba(0, 0, 0, 0.23)`,BUTTON_HOVER_BG:`rgba(0, 0, 0, 0.08)`};Object.freeze(X);var nv=e=>(...t)=>{let n=t.pop();return t.reduceRight((t,n)=>`var(--${e}-${n}, ${t})`,n)},rv=nv(`pie`),iv=()=>rv(`text`,X.TEXT),av=()=>rv(`disabled`,X.DISABLED),ov=()=>rv(`disabled-secondary`,X.DISABLED_SECONDARY),sv=()=>rv(`correct`,X.CORRECT),cv=()=>rv(`correct-secondary`,X.CORRECT_SECONDARY),lv=()=>rv(`correct-tertiary`,X.CORRECT_TERTIARY),uv=()=>rv(`correct-icon`,X.CORRECT_WITH_ICON),dv=()=>rv(`incorrect`,X.INCORRECT),fv=()=>rv(`incorrect-icon`,X.INCORRECT_WITH_ICON),pv=()=>rv(`incorrect-secondary`,X.INCORRECT_SECONDARY),mv=()=>rv(`missing`,X.MISSING),hv=()=>rv(`missing-icon`,X.MISSING_WITH_ICON),gv=()=>rv(`primary`,X.PRIMARY),_v=()=>rv(`primary-light`,X.PRIMARY_LIGHT),vv=()=>rv(`primary-dark`,X.PRIMARY_DARK),yv=()=>rv(`primary-text`,`text`,X.TEXT),bv=()=>rv(`faded-primary`,X.FADED_PRIMARY),xv=()=>rv(`secondary`,X.SECONDARY),Sv=()=>rv(`secondary-light`,X.SECONDARY_LIGHT),Cv=()=>rv(`secondary-dark`,X.SECONDARY_DARK),wv=()=>rv(`secondary-text`,`text`,X.TEXT),Tv=()=>rv(`background`,X.BACKGROUND),Ote=()=>rv(`background-dark`,X.BACKGROUND_DARK),kte=()=>rv(`secondary-background`,X.SECONDARY_BACKGROUND),Ate=()=>rv(`dropdown-background`,X.DROPDOWN_BACKGROUND),jte=()=>rv(`tertiary`,X.TERTIARY),Ev=()=>rv(`tertiary-light`,X.TERTIARY_LIGHT),Dv=()=>rv(`border`,X.BORDER),Ov=()=>rv(`border-light`,X.BORDER_LIGHT),kv=()=>rv(`border-dark`,X.BORDER_DARK),Av=()=>rv(`border-gray`,X.BORDER_GRAY),jv=()=>rv(`black`,X.BLACK),Mv=()=>rv(`white`,X.WHITE),Nv=()=>X.TRANSPARENT,Pv=()=>rv(`focus-checked`,X.FOCUS_CHECKED),Fv=()=>rv(`focus-checked-border`,X.FOCUS_CHECKED_BORDER),Iv=()=>rv(`focus-unchecked`,X.FOCUS_UNCHECKED),Lv=()=>rv(`focus-unchecked-border`,X.FOCUS_UNCHECKED_BORDER),Rv=()=>rv(`blue-grey-100`,X.BLUE_GREY100),zv=()=>rv(`blue-grey-300`,X.BLUE_GREY300),Bv=()=>rv(`blue-grey-600`,X.BLUE_GREY600),Vv=()=>rv(`blue-grey-900`,X.BLUE_GREY900),Hv=()=>rv(`keypad-button`,X.KEYPAD_BUTTON),Uv=()=>rv(`keypad-button-operator`,X.KEYPAD_BUTTON_OPERATOR),Wv=()=>rv(`keypad-empty-placeholder`,X.KEYPAD_EMPTY_PLACEHOLDER),Gv=()=>rv(`keypad-button-hover`,X.KEYPAD_BUTTON_HOVER),Kv=()=>rv(`keypad-button-operator-hover`,X.KEYPAD_BUTTON_OPERATOR_HOVER),qv=()=>rv(`button-border`,X.BUTTON_BORDER),Jv=()=>rv(`button-hover-bg`,X.BUTTON_HOVER_BG),Yv={AXIS_LINE_COLOR:`#5A53C9`,ROLLOVER_FILL_BAR_COLOR:`#050F2D`,GRIDLINES_COLOR:`#8E88EA`,PLOT_FILL_COLOR:`#1463B3`,SHAPES_FILL_COLOR:`#7986cb`};M();var Xv=J(`div`)({transformOrigin:`0% 0px 0px`,width:`100%`,display:`block`,overflow:`hidden`,"&.incorrect":{color:`#946202`}}),Zv=J(`div`)({WebkitFontSmoothing:`antialiased`,backgroundColor:`var(--feedback-bg-color, ${av()})`,borderRadius:`4px`,lineHeight:`25px`,margin:`0px`,padding:`10px`,verticalAlign:`middle`,color:`var(--feedback-color, white)`,"&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${sv()})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${dv()})`}}),Qv=J(`div`)({"&.feedback-enter":{height:`1px`},"&.feedback-enter-active":{height:`45px`,transition:`height 500ms`},"&.feedback-exit":{height:`45px`},"&.feedback-exit-active":{height:`1px`,transition:`height 200ms`}}),$v=class extends W.Component{static propTypes={correctness:j.string,feedback:j.string};nodeRef=W.createRef();renderFeedback(){let{correctness:e,feedback:t}=this.props;return!e||!t?null:(0,G.jsx)(Xg,{nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:`feedback`,children:(0,G.jsx)(Qv,{ref:this.nodeRef,children:(0,G.jsx)(Xv,{children:(0,G.jsx)(Zv,{className:e,dangerouslySetInnerHTML:{__html:t}})})})},`hasFeedback`)}render(){return(0,G.jsx)(`div`,{children:(0,G.jsx)(e_,{children:this.renderFeedback()})})}};function ey(){return()=>{}}var ty=c({Correct:()=>sy,Incorrect:()=>cy,NothingSubmitted:()=>Mte,PartiallyCorrect:()=>ly});M();var ny=ey(`pie-libs:render-ui:response-indicators`),ry=J(`div`)(({hasFeedback:e})=>({cursor:e?`pointer`:`default`})),iy=J(Q_)({cursor:`pointer`}),ay=J(`div`)({padding:`0`,borderRadius:`4px`}),oy=(e,t)=>{class n extends W.Component{constructor(e){super(e),this.state={}}handlePopoverOpen=e=>{ny(`[handlePopoverOpen]`,e.target),this.setState({anchorEl:e.target})};handlePopoverClose=()=>{this.setState({anchorEl:null})};render(){let{feedback:n}=this.props,{anchorEl:r}=this.state;return(0,G.jsxs)(ry,{hasFeedback:!!n,children:[(0,G.jsx)(`span`,{ref:e=>this.icon=e,onClick:this.handlePopoverOpen,children:(0,G.jsx)(e,{})}),n&&(0,G.jsx)(iy,{PaperComponent:ay,open:!!r,anchorEl:r,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:this.handlePopoverClose,children:(0,G.jsx)($v,{feedback:n,correctness:t})})]})}}return n.propTypes={feedback:j.string},n},sy=oy(Qh,`correct`),cy=oy(ag,`incorrect`),ly=oy(fg,`partially-correct`),Mte=oy(lg,`nothing-submitted`);function Nte(e){return Qr(`MuiCollapse`,e)}$r(`MuiCollapse`,[`root`,`horizontal`,`vertical`,`entered`,`hidden`,`wrapper`,`wrapperInner`]),M();var Pte=e=>{let{orientation:t,classes:n}=e;return ba({root:[`root`,t],entered:[`entered`],hidden:[`hidden`],wrapper:[`wrapper`,t],wrapperInner:[`wrapperInner`,t]},Nte,n)},Fte=J(`div`,{name:`MuiCollapse`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.orientation],n.state===`entered`&&t.entered,n.state===`exited`&&!n.in&&n.collapsedSize===`0px`&&t.hidden]}})(y_(({theme:e})=>({height:0,overflow:`hidden`,transition:e.transitions.create(`height`),variants:[{props:{orientation:`horizontal`},style:{height:`auto`,width:0,transition:e.transitions.create(`width`)}},{props:{state:`entered`},style:{height:`auto`,overflow:`visible`}},{props:{state:`entered`,orientation:`horizontal`},style:{width:`auto`}},{props:({ownerState:e})=>e.state===`exited`&&!e.in&&e.collapsedSize===`0px`,style:{visibility:`hidden`}}]}))),Ite=J(`div`,{name:`MuiCollapse`,slot:`Wrapper`})({display:`flex`,width:`100%`,variants:[{props:{orientation:`horizontal`},style:{width:`auto`,height:`100%`}}]}),Lte=J(`div`,{name:`MuiCollapse`,slot:`WrapperInner`})({width:`100%`,variants:[{props:{orientation:`horizontal`},style:{width:`auto`,height:`100%`}}]}),uy=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiCollapse`}),{addEndListener:r,children:i,className:a,collapsedSize:o=`0px`,component:s,easing:c,in:l,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:m,onExiting:h,orientation:g=`vertical`,slots:_={},slotProps:v={},style:y,timeout:b=no.standard,TransitionComponent:x=qg,...S}=n,C={...n,orientation:g,collapsedSize:o},w=Pte(C),T=No(),E=kg(),D=W.useRef(null),O=W.useRef(),k=typeof o==`number`?`${o}px`:o,A=g===`horizontal`,j=A?`width`:`height`,M=W.useRef(null),N=o_(t,M),P=()=>D.current?D.current[A?`clientWidth`:`clientHeight`]:0,F=n_(M,(e,t)=>{D.current&&A&&(D.current.style.position=`absolute`),e.style[j]=k,u&&u(e,t)}),ee=n_(M,(e,t)=>{let n=P();D.current&&A&&(D.current.style.position=``);let{duration:r,easing:i}=i_({style:y,timeout:b,easing:c},{mode:`enter`});if(b===`auto`){let t=T.transitions.getAutoHeightDuration(n);e.style.transitionDuration=`${t}ms`,O.current=t}else e.style.transitionDuration=typeof r==`string`?r:`${r}ms`;e.style[j]=`${n}px`,e.style.transitionTimingFunction=i,f&&f(e,t)}),te=n_(M,(e,t)=>{e.style[j]=`auto`,d&&d(e,t)}),I=n_(M,e=>{e.style[j]=`${P()}px`,p&&p(e)}),ne=n_(M,m),re=n_(M,e=>{let t=P(),{duration:n,easing:r}=i_({style:y,timeout:b,easing:c},{mode:`exit`});if(b===`auto`){let n=T.transitions.getAutoHeightDuration(t);e.style.transitionDuration=`${n}ms`,O.current=n}else e.style.transitionDuration=typeof n==`string`?n:`${n}ms`;e.style[j]=k,e.style.transitionTimingFunction=r,h&&h(e)}),ie=e=>{b===`auto`&&E.start(O.current||0,e),r&&r(M.current,e)},L={slots:_,slotProps:v,component:s},[R,ae]=T_(`root`,{ref:N,className:K(w.root,a),elementType:Fte,externalForwardedProps:L,ownerState:C,additionalProps:{style:{[A?`minWidth`:`minHeight`]:k,...y}}}),[z,B]=T_(`wrapper`,{ref:D,className:w.wrapper,elementType:Ite,externalForwardedProps:L,ownerState:C}),[oe,se]=T_(`wrapperInner`,{className:w.wrapperInner,elementType:Lte,externalForwardedProps:L,ownerState:C});return(0,G.jsx)(x,{in:l,onEnter:F,onEntered:te,onEntering:ee,onExit:I,onExited:ne,onExiting:re,addEndListener:ie,nodeRef:M,timeout:b===`auto`?null:b,...S,children:(e,{ownerState:t,...n})=>{let r={...C,state:e};return(0,G.jsx)(R,{...ae,className:K(ae.className,{entered:w.entered,exited:!l&&k===`0px`&&w.hidden}[e]),ownerState:r,...n,children:(0,G.jsx)(z,{...B,ownerState:r,children:(0,G.jsx)(oe,{...se,ownerState:r,children:i})})})}})});uy&&(uy.muiSupportAuto=!0),M();var Rte=J(`span`)(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:`pointer`})),zte=J(uy)(({theme:e})=>({paddingTop:e.spacing(2)})),dy=class extends W.Component{static propTypes={className:j.string,children:j.object,labels:j.shape({visible:j.string,hidden:j.string})};static defaultProps={labels:{}};state={expanded:!1};toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))};componentDidMount(){D(this.root)}componentDidUpdate(){D(this.root)}render(){let{labels:e,children:t,className:n}=this.props,r=this.state.expanded?e.visible||`Hide`:e.hidden||`Show`;return(0,G.jsxs)(`div`,{className:n,ref:e=>this.root=e,children:[(0,G.jsx)(`div`,{onClick:this.toggleExpanded,children:(0,G.jsx)(Rte,{children:r})}),(0,G.jsx)(zte,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0,children:t})]})}};function fy(e){try{return e.matches(`:focus-visible`)}catch{}return!1}var Bte=class e{static create(){return new e}static use(){let t=Tg(e.create).current,[n,r]=W.useState(!1);return t.shouldMount=n,t.setShouldMount=r,W.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=Hte(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}};function Vte(){return Bte.use()}function Hte(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}M();function Ute(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=W.useState(!1),f=K(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},m=K(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),W.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,G.jsx)(`span`,{className:f,style:p,children:(0,G.jsx)(`span`,{className:m})})}var py=$r(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]);M();var my=550,Wte=Kt`
49
- 0% {
50
- transform: scale(0);
51
- opacity: 0.1;
52
- }
53
-
54
- 100% {
55
- transform: scale(1);
56
- opacity: 0.3;
57
- }
58
- `,Gte=Kt`
59
- 0% {
60
- opacity: 1;
61
- }
62
-
63
- 100% {
64
- opacity: 0;
65
- }
66
- `,Kte=Kt`
67
- 0% {
68
- transform: scale(1);
69
- }
70
-
71
- 50% {
72
- transform: scale(0.92);
73
- }
74
-
75
- 100% {
76
- transform: scale(1);
77
- }
78
- `,qte=J(`span`,{name:`MuiTouchRipple`,slot:`Root`})({overflow:`hidden`,pointerEvents:`none`,position:`absolute`,zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:`inherit`}),Jte=J(Ute,{name:`MuiTouchRipple`,slot:`Ripple`})`
79
- opacity: 0;
80
- position: absolute;
81
-
82
- &.${py.rippleVisible} {
83
- opacity: 0.3;
84
- transform: scale(1);
85
- animation-name: ${Wte};
86
- animation-duration: ${my}ms;
87
- animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
88
- }
89
-
90
- &.${py.ripplePulsate} {
91
- animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
92
- }
93
-
94
- & .${py.child} {
95
- opacity: 1;
96
- display: block;
97
- width: 100%;
98
- height: 100%;
99
- border-radius: 50%;
100
- background-color: currentColor;
101
- }
102
-
103
- & .${py.childLeaving} {
104
- opacity: 0;
105
- animation-name: ${Gte};
106
- animation-duration: ${my}ms;
107
- animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
108
- }
109
-
110
- & .${py.childPulsate} {
111
- position: absolute;
112
- /* @noflip */
113
- left: 0px;
114
- top: 0;
115
- animation-name: ${Kte};
116
- animation-duration: 2500ms;
117
- animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
118
- animation-iteration-count: infinite;
119
- animation-delay: 200ms;
120
- }
121
- `,Yte=W.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...a}=_g({props:e,name:`MuiTouchRipple`}),[o,s]=W.useState([]),c=W.useRef(0),l=W.useRef(null);W.useEffect(()=>{l.current&&=(l.current(),null)},[o]);let u=W.useRef(!1),d=kg(),f=W.useRef(null),p=W.useRef(null),m=W.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:a,cb:o}=e;s(e=>[...e,(0,G.jsx)(Jte,{classes:{ripple:K(r.ripple,py.ripple),rippleVisible:K(r.rippleVisible,py.rippleVisible),ripplePulsate:K(r.ripplePulsate,py.ripplePulsate),child:K(r.child,py.child),childLeaving:K(r.childLeaving,py.childLeaving),childPulsate:K(r.childPulsate,py.childPulsate)},timeout:my,pulsate:t,rippleX:n,rippleY:i,rippleSize:a},c.current)]),c.current+=1,l.current=o},[r]),h=W.useCallback((e={},t={},r=()=>{})=>{let{pulsate:i=!1,center:a=n||t.pulsate,fakeElement:o=!1}=t;if(e?.type===`mousedown`&&u.current){u.current=!1;return}e?.type===`touchstart`&&(u.current=!0);let s=o?null:p.current,c=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0},l,h,g;if(a||e===void 0||e.clientX===0&&e.clientY===0||!e.clientX&&!e.touches)l=Math.round(c.width/2),h=Math.round(c.height/2);else{let{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;l=Math.round(t-c.left),h=Math.round(n-c.top)}if(a)g=Math.sqrt((2*c.width**2+c.height**2)/3),g%2==0&&(g+=1);else{let e=Math.max(Math.abs((s?s.clientWidth:0)-l),l)*2+2,t=Math.max(Math.abs((s?s.clientHeight:0)-h),h)*2+2;g=Math.sqrt(e**2+t**2)}e?.touches?f.current===null&&(f.current=()=>{m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},d.start(80,()=>{f.current&&=(f.current(),null)})):m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},[n,m,d]),g=W.useCallback(()=>{h({},{pulsate:!0})},[h]),_=W.useCallback((e,t)=>{if(d.clear(),e?.type===`touchend`&&f.current){f.current(),f.current=null,d.start(0,()=>{_(e,t)});return}f.current=null,s(e=>e.length>0?e.slice(1):e),l.current=t},[d]);return W.useImperativeHandle(t,()=>({pulsate:g,start:h,stop:_}),[g,h,_]),(0,G.jsx)(qte,{className:K(py.root,r.root,i),ref:p,...a,children:(0,G.jsx)(e_,{component:null,exit:!0,children:o})})});function Xte(e){return Qr(`MuiButtonBase`,e)}var Zte=$r(`MuiButtonBase`,[`root`,`disabled`,`focusVisible`]);M();var Qte=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,a=ba({root:[`root`,t&&`disabled`,n&&`focusVisible`]},Xte,i);return n&&r&&(a.root+=` ${r}`),a},hy=J(`button`,{name:`MuiButtonBase`,slot:`Root`})({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,boxSizing:`border-box`,WebkitTapHighlightColor:`transparent`,backgroundColor:`transparent`,outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:`pointer`,userSelect:`none`,verticalAlign:`middle`,MozAppearance:`none`,WebkitAppearance:`none`,textDecoration:`none`,color:`inherit`,"&::-moz-focus-inner":{borderStyle:`none`},[`&.${Zte.disabled}`]:{pointerEvents:`none`,cursor:`default`},"@media print":{colorAdjust:`exact`}}),gy=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiButtonBase`}),{action:r,centerRipple:i=!1,children:a,className:o,component:s=`button`,disabled:c=!1,disableRipple:l=!1,disableTouchRipple:u=!1,focusRipple:d=!1,focusVisibleClassName:f,LinkComponent:p=`a`,onBlur:m,onClick:h,onContextMenu:g,onDragLeave:_,onFocus:v,onFocusVisible:y,onKeyDown:b,onKeyUp:x,onMouseDown:S,onMouseLeave:C,onMouseUp:w,onTouchEnd:T,onTouchMove:E,onTouchStart:D,tabIndex:O=0,TouchRippleProps:k,touchRippleRef:A,type:j,...M}=n,N=W.useRef(null),P=Vte(),F=o_(P.ref,A),[ee,te]=W.useState(!1);c&&ee&&te(!1),W.useImperativeHandle(r,()=>({focusVisible:()=>{te(!0),N.current.focus()}}),[]);let I=P.shouldMount&&!l&&!c;W.useEffect(()=>{ee&&d&&!l&&P.pulsate()},[l,d,ee,P]);let ne=_y(P,`start`,S,u),re=_y(P,`stop`,g,u),ie=_y(P,`stop`,_,u),L=_y(P,`stop`,w,u),R=_y(P,`stop`,e=>{ee&&e.preventDefault(),C&&C(e)},u),ae=_y(P,`start`,D,u),z=_y(P,`stop`,T,u),B=_y(P,`stop`,E,u),oe=_y(P,`stop`,e=>{fy(e.target)||te(!1),m&&m(e)},!1),se=U_(e=>{N.current||=e.currentTarget,fy(e.target)&&(te(!0),y&&y(e)),v&&v(e)}),ce=()=>{let e=N.current;return e?e.tagName===`BUTTON`?!1:!(e.tagName===`A`&&e.href):s&&s!==`button`},V=U_(e=>{d&&!e.repeat&&ee&&e.key===` `&&P.stop(e,()=>{P.start(e)}),e.target===e.currentTarget&&ce()&&e.key===` `&&e.preventDefault(),b&&b(e),e.target===e.currentTarget&&ce()&&e.key===`Enter`&&!c&&(e.preventDefault(),h&&h(e))}),le=U_(e=>{d&&e.key===` `&&ee&&!e.defaultPrevented&&P.stop(e,()=>{P.pulsate(e)}),x&&x(e),h&&e.target===e.currentTarget&&ce()&&e.key===` `&&!e.defaultPrevented&&!c&&h(e)}),ue=s;ue===`button`&&(M.href||M.to)&&(ue=p);let de={};if(ue===`button`){let e=!!M.formAction;de.type=j===void 0&&!e?`button`:j,de.disabled=c}else !M.href&&!M.to&&(de.role=`button`),c&&(de[`aria-disabled`]=c);let H=o_(t,N),fe={...n,centerRipple:i,component:s,disabled:c,disableRipple:l,disableTouchRipple:u,focusRipple:d,tabIndex:O,focusVisible:ee},pe=Qte(fe);return(0,G.jsxs)(hy,{as:ue,className:K(pe.root,o),ownerState:fe,onBlur:oe,onClick:h,onContextMenu:re,onFocus:se,onKeyDown:V,onKeyUp:le,onMouseDown:ne,onMouseLeave:R,onMouseUp:L,onDragLeave:ie,onTouchEnd:z,onTouchMove:B,onTouchStart:ae,ref:H,tabIndex:c?-1:O,type:j,...de,...M,children:[a,I?(0,G.jsx)(Yte,{ref:F,center:i,...k}):null]})});function _y(e,t,n,r=!1){return U_(i=>(n&&n(i),r||e[t](i),!0))}function vy(e){return typeof e.main==`string`}function yy(e,t=[]){if(!vy(e))return!1;for(let n of t)if(!e.hasOwnProperty(n)||typeof e[n]!=`string`)return!1;return!0}function by(e=[]){return([,t])=>t&&yy(t,e)}function xy(e){return Qr(`MuiCircularProgress`,e)}$r(`MuiCircularProgress`,[`root`,`determinate`,`indeterminate`,`colorPrimary`,`colorSecondary`,`svg`,`track`,`circle`,`circleDeterminate`,`circleIndeterminate`,`circleDisableShrink`]),M();var Sy=44,Cy=Kt`
122
- 0% {
123
- transform: rotate(0deg);
124
- }
125
-
126
- 100% {
127
- transform: rotate(360deg);
128
- }
129
- `,wy=Kt`
130
- 0% {
131
- stroke-dasharray: 1px, 200px;
132
- stroke-dashoffset: 0;
133
- }
134
-
135
- 50% {
136
- stroke-dasharray: 100px, 200px;
137
- stroke-dashoffset: -15px;
138
- }
139
-
140
- 100% {
141
- stroke-dasharray: 1px, 200px;
142
- stroke-dashoffset: -126px;
143
- }
144
- `,Ty=typeof Cy==`string`?null:Gt`
145
- animation: ${Cy} 1.4s linear infinite;
146
- `,Ey=typeof wy==`string`?null:Gt`
147
- animation: ${wy} 1.4s ease-in-out infinite;
148
- `,Dy=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e;return ba({root:[`root`,n,`color${P_(r)}`],svg:[`svg`],track:[`track`],circle:[`circle`,`circle${P_(n)}`,i&&`circleDisableShrink`]},xy,t)},Oy=J(`span`,{name:`MuiCircularProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${P_(n.color)}`]]}})(y_(({theme:e})=>({display:`inline-block`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`transform`)}},{props:{variant:`indeterminate`},style:Ty||{animation:`${Cy} 1.4s linear infinite`}},...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),ky=J(`svg`,{name:`MuiCircularProgress`,slot:`Svg`})({display:`block`}),Ay=J(`circle`,{name:`MuiCircularProgress`,slot:`Circle`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,t[`circle${P_(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(y_(({theme:e})=>({stroke:`currentColor`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`stroke-dashoffset`)}},{props:{variant:`indeterminate`},style:{strokeDasharray:`80px, 200px`,strokeDashoffset:0}},{props:({ownerState:e})=>e.variant===`indeterminate`&&!e.disableShrink,style:Ey||{animation:`${wy} 1.4s ease-in-out infinite`}}]}))),jy=J(`circle`,{name:`MuiCircularProgress`,slot:`Track`})(y_(({theme:e})=>({stroke:`currentColor`,opacity:(e.vars||e).palette.action.activatedOpacity}))),My=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiCircularProgress`}),{className:r,color:i=`primary`,disableShrink:a=!1,enableTrackSlot:o=!1,size:s=40,style:c,thickness:l=3.6,value:u=0,variant:d=`indeterminate`,...f}=n,p={...n,color:i,disableShrink:a,size:s,thickness:l,value:u,variant:d,enableTrackSlot:o},m=Dy(p),h={},g={},_={};if(d===`determinate`){let e=2*Math.PI*((Sy-l)/2);h.strokeDasharray=e.toFixed(3),_[`aria-valuenow`]=Math.round(u),h.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,g.transform=`rotate(-90deg)`}return(0,G.jsx)(Oy,{className:K(m.root,r),style:{width:s,height:s,...g,...c},ownerState:p,ref:t,role:`progressbar`,..._,...f,children:(0,G.jsxs)(ky,{className:m.svg,ownerState:p,viewBox:`${Sy/2} ${Sy/2} ${Sy} ${Sy}`,children:[o?(0,G.jsx)(jy,{className:m.track,ownerState:p,cx:Sy,cy:Sy,r:(Sy-l)/2,fill:`none`,strokeWidth:l,"aria-hidden":`true`}):null,(0,G.jsx)(Ay,{className:m.circle,style:h,ownerState:p,cx:Sy,cy:Sy,r:(Sy-l)/2,fill:`none`,strokeWidth:l})]})})});function Ny(e){return Qr(`MuiButton`,e)}var Py=$r(`MuiButton`,`root.text.textInherit.textPrimary.textSecondary.textSuccess.textError.textInfo.textWarning.outlined.outlinedInherit.outlinedPrimary.outlinedSecondary.outlinedSuccess.outlinedError.outlinedInfo.outlinedWarning.contained.containedInherit.containedPrimary.containedSecondary.containedSuccess.containedError.containedInfo.containedWarning.disableElevation.focusVisible.disabled.colorInherit.colorPrimary.colorSecondary.colorSuccess.colorError.colorInfo.colorWarning.textSizeSmall.textSizeMedium.textSizeLarge.outlinedSizeSmall.outlinedSizeMedium.outlinedSizeLarge.containedSizeSmall.containedSizeMedium.containedSizeLarge.sizeMedium.sizeSmall.sizeLarge.fullWidth.startIcon.endIcon.icon.iconSizeSmall.iconSizeMedium.iconSizeLarge.loading.loadingWrapper.loadingIconPlaceholder.loadingIndicator.loadingPositionCenter.loadingPositionStart.loadingPositionEnd`.split(`.`)),Fy=W.createContext({}),Iy=W.createContext(void 0);M();var Ly=e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:a,loading:o,loadingPosition:s,classes:c}=e,l=ba({root:[`root`,o&&`loading`,a,`${a}${P_(t)}`,`size${P_(i)}`,`${a}Size${P_(i)}`,`color${P_(t)}`,n&&`disableElevation`,r&&`fullWidth`,o&&`loadingPosition${P_(s)}`],startIcon:[`icon`,`startIcon`,`iconSize${P_(i)}`],endIcon:[`icon`,`endIcon`,`iconSize${P_(i)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},Ny,c);return{...c,...l}},Ry=[{props:{size:`small`},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:`medium`},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:`large`},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],zy=J(gy,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${P_(n.color)}`],t[`size${P_(n.size)}`],t[`${n.variant}Size${P_(n.size)}`],n.color===`inherit`&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(y_(({theme:e})=>{let t=e.palette.mode===`light`?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode===`light`?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:`6px 16px`,border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`,`color`],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:`none`},[`&.${Py.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.startIcon||e.loading&&e.loadingPosition===`start`,style:{"&::before":{content:`"\\200b"`,width:0,overflow:`hidden`}}},{props:{variant:`contained`},style:{color:`var(--variant-containedColor)`,backgroundColor:`var(--variant-containedBg)`,boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Py.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Py.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:`outlined`},style:{padding:`5px 15px`,border:`1px solid currentColor`,borderColor:`var(--variant-outlinedBorder, currentColor)`,backgroundColor:`var(--variant-outlinedBg)`,color:`var(--variant-outlinedColor)`,[`&.${Py.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:`text`},style:{padding:`6px 8px`,color:`var(--variant-textColor)`,backgroundColor:`var(--variant-textBg)`}},...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{"--variant-textColor":(e.vars||e).palette[t].main,"--variant-outlinedColor":(e.vars||e).palette[t].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[t].main,.5),"--variant-containedColor":(e.vars||e).palette[t].contrastText,"--variant-containedBg":(e.vars||e).palette[t].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[t].dark,"--variant-textBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[t].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:`inherit`},style:{color:`inherit`,borderColor:`currentColor`,"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:`small`,variant:`text`},style:{padding:`4px 5px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`text`},style:{padding:`8px 11px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`outlined`},style:{padding:`3px 9px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`outlined`},style:{padding:`7px 21px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`contained`},style:{padding:`4px 10px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`contained`},style:{padding:`8px 22px`,fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:`none`,"&:hover":{boxShadow:`none`},[`&.${Py.focusVisible}`]:{boxShadow:`none`},"&:active":{boxShadow:`none`},[`&.${Py.disabled}`]:{boxShadow:`none`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{loadingPosition:`center`},style:{transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`],{duration:e.transitions.duration.short}),[`&.${Py.loading}`]:{color:`transparent`}}}]}})),By=J(`span`,{name:`MuiButton`,slot:`StartIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${P_(n.size)}`]]}})(({theme:e})=>({display:`inherit`,marginRight:8,marginLeft:-4,variants:[{props:{size:`small`},style:{marginLeft:-2}},{props:{loadingPosition:`start`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`start`,loading:!0,fullWidth:!0},style:{marginRight:-8}},...Ry]})),Vy=J(`span`,{name:`MuiButton`,slot:`EndIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${P_(n.size)}`]]}})(({theme:e})=>({display:`inherit`,marginRight:-4,marginLeft:8,variants:[{props:{size:`small`},style:{marginRight:-2}},{props:{loadingPosition:`end`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`end`,loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Ry]})),Hy=J(`span`,{name:`MuiButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,variants:[{props:{loading:!0},style:{display:`flex`}},{props:{loadingPosition:`start`},style:{left:14}},{props:{loadingPosition:`start`,size:`small`},style:{left:10}},{props:{variant:`text`,loadingPosition:`start`},style:{left:6}},{props:{loadingPosition:`center`},style:{left:`50%`,transform:`translate(-50%)`,color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:`end`},style:{right:14}},{props:{loadingPosition:`end`,size:`small`},style:{right:10}},{props:{variant:`text`,loadingPosition:`end`},style:{right:6}},{props:{loadingPosition:`start`,fullWidth:!0},style:{position:`relative`,left:-10}},{props:{loadingPosition:`end`,fullWidth:!0},style:{position:`relative`,right:-10}}]})),Uy=J(`span`,{name:`MuiButton`,slot:`LoadingIconPlaceholder`})({display:`inline-block`,width:`1em`,height:`1em`}),Wy=W.forwardRef(function(e,t){let n=W.useContext(Fy),r=W.useContext(Iy),i=_g({props:fi(n,e),name:`MuiButton`}),{children:a,color:o=`primary`,component:s=`button`,className:c,disabled:l=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:p,fullWidth:m=!1,id:h,loading:g=null,loadingIndicator:_,loadingPosition:v=`center`,size:y=`medium`,startIcon:b,type:x,variant:S=`text`,...C}=i,w=B_(h),T=_??(0,G.jsx)(My,{"aria-labelledby":w,color:`inherit`,size:16}),E={...i,color:o,component:s,disabled:l,disableElevation:u,disableFocusRipple:d,fullWidth:m,loading:g,loadingIndicator:T,loadingPosition:v,size:y,type:x,variant:S},D=Ly(E),O=(b||g&&v===`start`)&&(0,G.jsx)(By,{className:D.startIcon,ownerState:E,children:b||(0,G.jsx)(Uy,{className:D.loadingIconPlaceholder,ownerState:E})}),k=(f||g&&v===`end`)&&(0,G.jsx)(Vy,{className:D.endIcon,ownerState:E,children:f||(0,G.jsx)(Uy,{className:D.loadingIconPlaceholder,ownerState:E})}),A=r||``,j=typeof g==`boolean`?(0,G.jsx)(`span`,{className:D.loadingWrapper,style:{display:`contents`},children:g&&(0,G.jsx)(Hy,{className:D.loadingIndicator,ownerState:E,children:T})}):null,{root:M,...N}=D;return(0,G.jsxs)(zy,{ownerState:E,className:K(n.className,D.root,c,A),component:s,disabled:l||g,focusRipple:!d,focusVisibleClassName:K(D.focusVisible,p),ref:t,type:x,id:g?w:h,...C,classes:N,children:[O,v!==`end`&&j,a,v===`end`&&j,k]})}),Gy=L_((0,G.jsx)(`path`,{d:`M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z`}),`Restore`),Ky=L_((0,G.jsx)(`path`,{d:`M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8`}),`Undo`);M();var qy=J(`div`)({display:`flex`,flexDirection:`column`}),Jy=J(`div`)({display:`flex`,alignItems:`center`,justifyContent:`center`}),Yy=J(`div`)(({theme:e})=>({width:`24px`,height:`24px`,color:`gray`,marginRight:e.spacing(1),display:`flex`,alignItems:`center`})),Xy=J(Wy)(({theme:e})=>({display:`flex`,alignItems:`center`,marginLeft:e.spacing(3),marginRight:e.spacing(3)})),Zy=e=>{class t extends W.Component{static propTypes={session:j.object,onSessionChange:j.func};constructor(e){super(e),this.state={sessionInitialValues:JSON.parse(JSON.stringify(e.session)),session:e.session,changes:[]}}onSessionChange=e=>{this.setState(t=>({session:e,changes:[...t.changes,e]}),()=>this.props.onSessionChange(e))};onUndo=()=>{this.setState(e=>{let t=[...e.changes];return t.pop(),{changes:t,session:t.length?t[t.length-1]:e.sessionInitialValues}},()=>this.props.onSessionChange(this.state.session))};onReset=()=>{this.setState(e=>({session:e.sessionInitialValues,changes:[]}),()=>this.props.onSessionChange(this.state.sessionInitialValues))};render(){let{...t}=this.props,{changes:n,session:r}=this.state;return(0,G.jsxs)(qy,{children:[(0,G.jsxs)(Jy,{children:[(0,G.jsxs)(Xy,{color:`primary`,disabled:n.length===0,onClick:this.onUndo,children:[(0,G.jsx)(Yy,{children:(0,G.jsx)(Ky,{})}),`Undo`]}),(0,G.jsxs)(Xy,{color:`primary`,disabled:n.length===0,onClick:this.onReset,children:[(0,G.jsx)(Yy,{children:(0,G.jsx)(Gy,{})}),`Start Over`]})]}),(0,G.jsx)(e,{...t,session:r,onSessionChange:this.onSessionChange})]})}}return t};M();var Qy=jo({typography:{fontFamily:`inherit`},palette:{action:{disabled:`rgba(0, 0, 0, 0.54);`}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:`inherit`}}},MuiButton:{styleOverrides:{contained:{backgroundColor:`#e0e0e0`,color:`#000000`,"&:hover":{backgroundColor:`#bdbdbd`}}}}}}),$y=J(`div`)({"& table, th, td":{fontSize:`inherit`}}),eb=class extends W.Component{static propTypes={className:j.string,children:j.array,extraCSSRules:j.shape({names:j.arrayOf(j.string),rules:j.string}),fontSizeFactor:j.number};static defaultProps={extraCSSRules:{},fontSizeFactor:1};constructor(e){super(e),this.classesSheet=document.createElement(`style`)}computeStyle(e){let t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),r=t(document.body),i=Math.max(n,r),a=e!=null&&typeof e==`number`?e:1;return a===1?null:{fontSize:`${i*a}px`}}render(){let{children:e,className:t,fontSizeFactor:n,...r}=this.props,{extraCSSRules:i,...a}=r,o=this.computeStyle(n);return(0,G.jsx)(fn,{injectFirst:!0,children:(0,G.jsxs)(Ho,{theme:Qy,children:[i?.rules?(0,G.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${i.rules} }`}}):null,(0,G.jsx)($y,{className:`${t} extraCSSRules`,...a,...o&&{style:o},children:e})]})})}};M();var tb=J(eb)({display:`flex`,flexDirection:`column`,position:`relative`}),nb=class extends W.Component{static propTypes={ariaLabel:j.string,children:j.oneOfType([j.arrayOf(j.node),j.node]).isRequired,role:j.string,extraCSSRules:j.shape({names:j.arrayOf(j.string),rules:j.string}),fontSizeFactor:j.number};render(){let{children:e,ariaLabel:t,role:n,extraCSSRules:r,fontSizeFactor:i,classes:a}=this.props;return(0,G.jsx)(tb,{...t?{"aria-label":t,role:n}:{},extraCSSRules:r,fontSizeFactor:i,classes:a,children:e})}};M();var rb=class extends W.Component{static propTypes={tag:j.string,className:j.string,html:j.string};static defaultProps={tag:`div`,html:``};render(){let{tag:e,className:t,html:n}=this.props;return(0,G.jsx)(e||`div`,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}};function ib({props:e,states:t,muiFormControl:n}){return t.reduce((t,r)=>(t[r]=e[r],n&&e[r]===void 0&&(t[r]=n[r]),t),{})}var ab=W.createContext(void 0);function ob(){return W.useContext(ab)}function sb(e){return Qr(`MuiFormLabel`,e)}var cb=$r(`MuiFormLabel`,[`root`,`colorSecondary`,`focused`,`disabled`,`error`,`filled`,`required`,`asterisk`]);M();var lb=e=>{let{classes:t,color:n,focused:r,disabled:i,error:a,filled:o,required:s}=e;return ba({root:[`root`,`color${P_(n)}`,i&&`disabled`,a&&`error`,o&&`filled`,r&&`focused`,s&&`required`],asterisk:[`asterisk`,a&&`error`]},sb,t)},ub=J(`label`,{name:`MuiFormLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color===`secondary`&&t.colorSecondary,n.filled&&t.filled]}})(y_(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:`1.4375em`,padding:0,position:`relative`,variants:[...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{[`&.${cb.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${cb.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${cb.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),db=J(`span`,{name:`MuiFormLabel`,slot:`Asterisk`})(y_(({theme:e})=>({[`&.${cb.error}`]:{color:(e.vars||e).palette.error.main}}))),fb=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiFormLabel`}),{children:r,className:i,color:a,component:o=`label`,disabled:s,error:c,filled:l,focused:u,required:d,...f}=n,p=ib({props:n,muiFormControl:ob(),states:[`color`,`required`,`focused`,`disabled`,`error`,`filled`]}),m={...n,color:p.color||`primary`,component:o,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required},h=lb(m);return(0,G.jsxs)(ub,{as:o,ownerState:m,className:K(h.root,i),ref:t,...f,children:[r,p.required&&(0,G.jsxs)(db,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[` `,`*`]})]})});function pb(e){return Qr(`MuiInputLabel`,e)}$r(`MuiInputLabel`,[`root`,`focused`,`disabled`,`error`,`required`,`asterisk`,`formControl`,`sizeSmall`,`shrink`,`animated`,`standard`,`filled`,`outlined`]),M();var mb=e=>{let{classes:t,formControl:n,size:r,shrink:i,disableAnimation:a,variant:o,required:s}=e,c=ba({root:[`root`,n&&`formControl`,!a&&`animated`,i&&`shrink`,r&&r!==`medium`&&`size${P_(r)}`,o],asterisk:[s&&`asterisk`]},pb,t);return{...t,...c}},hb=J(fb,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiInputLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${cb.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size===`small`&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(y_(({theme:e})=>({display:`block`,transformOrigin:`top left`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:`100%`,variants:[{props:({ownerState:e})=>e.formControl,style:{position:`absolute`,left:0,top:0,transform:`translate(0, 20px) scale(1)`}},{props:{size:`small`},style:{transform:`translate(0, 17px) scale(1)`}},{props:({ownerState:e})=>e.shrink,style:{transform:`translate(0, -1.5px) scale(0.75)`,transformOrigin:`top left`,maxWidth:`133%`}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:e.transitions.create([`color`,`transform`,`max-width`],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:`filled`},style:{zIndex:1,pointerEvents:`none`,transform:`translate(12px, 16px) scale(1)`,maxWidth:`calc(100% - 24px)`}},{props:{variant:`filled`,size:`small`},style:{transform:`translate(12px, 13px) scale(1)`}},{props:({variant:e,ownerState:t})=>e===`filled`&&t.shrink,style:{userSelect:`none`,pointerEvents:`auto`,transform:`translate(12px, 7px) scale(0.75)`,maxWidth:`calc(133% - 24px)`}},{props:({variant:e,ownerState:t,size:n})=>e===`filled`&&t.shrink&&n===`small`,style:{transform:`translate(12px, 4px) scale(0.75)`}},{props:{variant:`outlined`},style:{zIndex:1,pointerEvents:`none`,transform:`translate(14px, 16px) scale(1)`,maxWidth:`calc(100% - 24px)`}},{props:{variant:`outlined`,size:`small`},style:{transform:`translate(14px, 9px) scale(1)`}},{props:({variant:e,ownerState:t})=>e===`outlined`&&t.shrink,style:{userSelect:`none`,pointerEvents:`auto`,maxWidth:`calc(133% - 32px)`,transform:`translate(14px, -9px) scale(0.75)`}}]}))),gb=W.forwardRef(function(e,t){let n=_g({name:`MuiInputLabel`,props:e}),{disableAnimation:r=!1,margin:i,shrink:a,variant:o,className:s,...c}=n,l=ob(),u=a;u===void 0&&l&&(u=l.filled||l.focused||l.adornedStart);let d=ib({props:n,muiFormControl:l,states:[`size`,`variant`,`required`,`focused`]}),f={...n,disableAnimation:r,formControl:l,shrink:u,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=mb(f);return(0,G.jsx)(hb,{"data-shrink":u,ref:t,className:K(p.root,s),...c,ownerState:f,classes:p})});function _b(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function vb(e,t=!1){return e&&(_b(e.value)&&e.value!==``||t&&_b(e.defaultValue)&&e.defaultValue!==``)}function yb(e){return e.startAdornment}function bb(e){return Qr(`MuiFormControl`,e)}$r(`MuiFormControl`,[`root`,`marginNone`,`marginNormal`,`marginDense`,`fullWidth`,`disabled`]),M();var xb=e=>{let{classes:t,margin:n,fullWidth:r}=e;return ba({root:[`root`,n!==`none`&&`margin${P_(n)}`,r&&`fullWidth`]},bb,t)},Sb=J(`div`,{name:`MuiFormControl`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`margin${P_(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:`inline-flex`,flexDirection:`column`,position:`relative`,minWidth:0,padding:0,margin:0,border:0,verticalAlign:`top`,variants:[{props:{margin:`normal`},style:{marginTop:16,marginBottom:8}},{props:{margin:`dense`},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:`100%`}}]}),Cb=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiFormControl`}),{children:r,className:i,color:a=`primary`,component:o=`div`,disabled:s=!1,error:c=!1,focused:l,fullWidth:u=!1,hiddenLabel:d=!1,margin:f=`none`,required:p=!1,size:m=`medium`,variant:h=`outlined`,...g}=n,_={...n,color:a,component:o,disabled:s,error:c,fullWidth:u,hiddenLabel:d,margin:f,required:p,size:m,variant:h},v=xb(_),[y,b]=W.useState(()=>{let e=!1;return r&&W.Children.forEach(r,t=>{if(!R_(t,[`Input`,`Select`]))return;let n=R_(t,[`Select`])?t.props.input:t;n&&yb(n.props)&&(e=!0)}),e}),[x,S]=W.useState(()=>{let e=!1;return r&&W.Children.forEach(r,t=>{R_(t,[`Input`,`Select`])&&(vb(t.props,!0)||vb(t.props.inputProps,!0))&&(e=!0)}),e}),[C,w]=W.useState(!1);s&&C&&w(!1);let T=l!==void 0&&!s?l:C;W.useRef(!1);let E=W.useCallback(()=>{S(!0)},[]),D=W.useCallback(()=>{S(!1)},[]),O=W.useMemo(()=>({adornedStart:y,setAdornedStart:b,color:a,disabled:s,error:c,filled:x,focused:T,fullWidth:u,hiddenLabel:d,size:m,onBlur:()=>{w(!1)},onFocus:()=>{w(!0)},onEmpty:D,onFilled:E,registerEffect:void 0,required:p,variant:h}),[y,a,s,c,x,T,u,d,void 0,D,E,p,m,h]);return(0,G.jsx)(ab.Provider,{value:O,children:(0,G.jsx)(Sb,{as:o,ownerState:_,className:K(v.root,i),ref:t,...g,children:r})})});M();var wb=J(Cb)(({theme:e})=>({margin:0,padding:0,flex:`1 0 auto`,minWidth:e.spacing(4)})),Tb=J(gb)(()=>({fontSize:`inherit`,whiteSpace:`nowrap`,margin:0,padding:0,alignSelf:`flex-start`,position:`absolute`,top:0,left:0,transformOrigin:`top left`,pointerEvents:`none`,"&.MuiInputLabel-shrink":{transform:`scale(0.75) translate(0, -0.75em)`},"&:not(.MuiInputLabel-shrink)":{transform:`translate(0, 0)`}})),Eb=({label:e,className:t,children:n})=>(0,G.jsxs)(wb,{className:t,children:[(0,G.jsx)(Tb,{shrink:!0,children:e}),n]});Eb.propTypes={label:j.oneOfType([j.string,j.object]).isRequired,className:j.string,children:j.oneOfType([j.arrayOf(j.node),j.node]).isRequired},M();var Db=J(`div`)(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:`collapse`},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)':{backgroundColor:`#f6f8fa`,color:e.palette.common.black},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:`#f6f8fa`,color:e.palette.common.black},'&:not(.MathJax) table:not([role="presentation"]) td, &:not(.MathJax) table:not([role="presentation"]) th':{padding:`.6em 1em`,textAlign:`left`},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:`initial`},"&.prompt":{verticalAlign:`middle`,color:iv()},"&.legend":{width:`100%`,fontSize:`inherit !important`},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${iv()} !important`,display:`flex`,flexDirection:`column`,verticalAlign:`middle`,cursor:`pointer`,"& > p":{margin:`0 0 0 0 !important`}}})),Ob=/\\embed\{newLine\}\[\]/g,kb=`\\newline `,Ab=class extends W.Component{static propTypes={prompt:j.string,tagName:j.string,className:j.string,onClick:j.func,defaultClassName:j.string,autoplayAudioEnabled:j.bool,customAudioButton:j.shape({playImage:j.string,pauseImage:j.string})};static defaultProps={onClick:()=>{}};parsedText=e=>{let{customAudioButton:t}=this.props,n=document.createElement(`div`);n.innerHTML=e;let r=n.querySelector(`audio`);if(r){let e=document.createElement(`source`);if(e.setAttribute(`type`,`audio/mp3`),e.setAttribute(`src`,r.getAttribute(`src`)),r.removeAttribute(`src`),r.setAttribute(`id`,`pie-prompt-audio-player`),r.appendChild(e),t){r.style.display=`none`;let e=document.createElement(`div`);e.id=`play-audio-button`,Object.assign(e.style,{cursor:`pointer`,display:`block`,width:`128px`,height:`128px`,backgroundImage:`url(${t.pauseImage})`,backgroundSize:`cover`,borderRadius:`50%`,border:`1px solid #326295`}),r.parentNode.insertBefore(e,r)}}return n.innerHTML};addCustomAudioButtonControls(){let{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById(`play-audio-button`),r=document.getElementById(`pie-prompt-audio-player`);if(e&&r&&r.play().then(()=>{n&&t&&r.addEventListener(`ended`,a)}).catch(e=>{console.error(`Error playing audio`,e)}),!n||!r||!t)return;let i=()=>{r.paused&&(n.style.backgroundImage.includes(t.pauseImage)||r.play())},a=()=>{n.style.backgroundImage=`url(${t.playImage})`},o=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:`1px solid #ccc`})},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:`1px solid #326295`})};n.addEventListener(`click`,i),r.addEventListener(`play`,o),r.addEventListener(`pause`,s),r.addEventListener(`ended`,a),this._handlePlayClick=i,this._handleAudioPlay=o,this._handleAudioPause=s,this._handleAudioEnded=a}removeCustomAudioButtonListeners(){let e=document.getElementById(`play-audio-button`),t=document.querySelector(`audio`);!e||!t||(e.removeEventListener(`click`,this._handlePlayClick),t.removeEventListener(`play`,this._handleAudioPlay),t.removeEventListener(`pause`,this._handleAudioPause),t.removeEventListener(`ended`,this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){let e=document.getElementById(`preview-prompt`);e&&typeof D==`function`&&D(e)}alignImages(){document.querySelectorAll(`#preview-prompt`).forEach(e=>{let t=e.getElementsByTagName(`img`);if(t&&t.length){for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){let t=e.attributes.alignment.value,n=t===`center`?`center`:t===`right`?`flex-end`:`flex-start`,r=e.parentElement;if(r.tagName===`DIV`&&r.style.display===`flex`&&r.style.width===`100%`)r.style.justifyContent=n;else{let t=document.createElement(`div`);t.style.display=`flex`,t.style.width=`100%`,t.style.justifyContent=n;let i=e.cloneNode(!0);t.appendChild(i),r.replaceChild(t,e)}}}})}render(){let{prompt:e,tagName:t,className:n,onClick:r,defaultClassName:i}=this.props,a=`${n||``} ${i||``} ${t===`legend`?`legend`:``}`.trim();return(0,G.jsx)(Db,{as:t||`div`,id:`preview-prompt`,onClick:r,className:a,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||``).replace(Ob,kb)}})}};M();var jb=e=>(0,G.jsx)(G.Fragment,{children:W.Children.map(e.children,t=>W.cloneElement(t,{"data-pie-readable":e.false===void 0}))});jb.propTypes={children:j.node,false:j.bool},M();var Mb=e=>(0,G.jsx)(G.Fragment,{children:W.Children.map(e.children,t=>W.cloneElement(t,{"data-pie-purpose":e.purpose}))});Mb.propTypes={children:j.node,purpose:j.string};var Nb;typeof window<`u`&&(Nb=new DOMParser);var Pb=e=>Nb.parseFromString(e,`text/html`).body.textContent,Fb=e=>{if(!e)return!1;let t=Pb(e);return!!(t&&t.trim())},Ib;typeof window<`u`&&(Ib=new DOMParser);var Lb=e=>{if(!e)return!1;let t=Ib.parseFromString(e,`text/html`);return!!t.body.querySelector(`img`)||!!t.body.querySelector(`video`)||!!t.body.querySelector(`audio`)},Rb=`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCAJYAyADAREAAhEBAxEB/8QAHgABAQABBQEBAQAAAAAAAAAAAAEIAgMGBwkEBQr/xABiEAACAQIDBAMKCAYMCgYLAQAAAQIDEQQFIQYSMUEHCFETFRYiUmFxkdHhCRRjgaGisfAXMjRTcsEjJDY4QmJ1dpKztMQYMzdEVIKyw9PxQ1hmc3SWJzVFRlZXhJOUldJk/8QAGwEBAQADAQEBAAAAAAAAAAAAAAcEBQYCAQP/xABBEQEAAQIDAgkJBgUFAQEBAAAAAQIDBAYRBSESMUFEYXGCscITNDVRcoGRocEUIjJS0eEVI2KSsjNCU6LwFtLx/9oADAMBAAIRAxEAPwD1TAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARtJNt2S4sDaljMNB2dZfNr9gGn49hfzv1WA+PYX879VgPj2F/O/VYD49hrNqpeyvaz1A0d8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaA75UPIqepe0B3yoeRU9S9oDvlQ8ip6l7QHfKh5FT1L2gO+VDyKnqXtAd8qHkVPUvaBY5hSm7QpVZPsUb/rA+mLbV3Fx8zAoAAAAAAAAAAAAAAAAAAAAPhxOYqDcaNtOM3w+YD8bF5u296cnLsb4epAfnV887lrvvV6eLoB88topvSNRJW5xfsA0d/Z/nv8AaAd/Z/nv9oCPPpxTbrcFf+EBtvaZX0rafpe8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veA8Jvlvre8B4TfLfW94Dwm+W+t7wHhN8t9b3gPCb5b63vAeE3y31veBu0to4VZ7inLXn3TggP0cJnNOpLuae+km27q6XbxA/UoVac1GruKcZLg219nMD9qjUhOKUFO1r+Mn9rA3AAAAAAAAAAAAAAAAAAB8mPxLoU92ErSlxfYgOF7W7S5XszlmMzzNsfTw2AwNKVatVqLxVGK8Z29F7c3pZan6WbNeIuRatRrVM6RD8716jD25u3Z0piNZl5+9MPWv2828zPEYLZHM8Zs7kEZtUYYafcsVXjfSdWpHxot+RF2SdnvWuVbY+VMLgaIrxNMV3OXXfEdERxT1z7tEn2xmvF46uaMLVNu3yabqp6Znjjqj36ukMXjMZj68sVjsVWxNaesqlao5yl6W9WdTRbotxwaI0joctXcruVcKudZ6WyengAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN7CYzGYCvHFYHFVsNWhrGpRqOEo+hrVHmu3Rcjg1xrHS90XK7dXConSeh3Z0Q9avbvYTMKGB2rzLGbQZFKa7rDEVO6YqgnxnTqy8aVvIk2tLLd4nLbXyphcdRNeGpi3c6N0T0THF749+rqdj5rxeBrijE1Tct9O+Y6Ynjnqn3aM+NltqMBtDluDzvKMXTxeExtOOIw9ZSsqkJap6cHZ8LKz4olN6zXh7lVq5GlUTpMKxZvUYi3TdtTrTMaxLmuX42U4NxqzaUVeMo726r2110t6voPzfo/To1FVhvqpGevFKwG4AAAAAAAAAAAAAAAAAfgZpWko1au/KSi7KV9fmt6AMQOvHthiMDsVlWy2FxDpxzvMJVa8Y/wAOlQSk4S7V3SdKX+qrcztckYWLuMrxFUfgjd0TV+0THvcTnjFTawdGHpn8c7+mKf3mJ9zCcqCWgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGaXUi2wr4zYvNdl8Ripz7y46NahF6qnSrpy3UuzfhVl/rMl+d8LFrGUYiI/HG/rj9piFSyPipu4OvD1T+Cd3RFX7xM+9ltlGKi9y8U3JqTk22mr+p+g4p2zkuFxNOreEIRppO0VdXfzAfSAAAAAAAAAAAAAAAA0VZUowfdpRjFqzcnZAcUziruUG4ylGcVfzNfe+ugGD/Xnqznidj4Saaj3xtbz/ABf7+ooeQ+cdjxJ3n7m/b8LFcoSdgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGUXUeqyp4va1Ra8Z5do158R+q5Pc+c37fhUTIPOOx4mbWVTiqcJVpWcZWi6fBevzXJ4ojmeGgpRjiJL9knHV66/N8yA3wAAAAAAAAAAAAAAAG1ilF4epv8N1+vl9IHDtoXGGH3VFq8XqtF6G+foAwg67zi8Tsju8P2/bstu4bk9fuih5D5x2PEnefub9vwsXihJ2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZOdSj/H7Xf8A0H2YknufOb9vwqJkHnHY8TNjZ7WV5VHBRfJ2TRPFEcwy9zUof4zudvFtfd+wD9IAAAAAAAAAAAAAAABs4tTeHnuSs0m351zA4ftG2sNpNqSacUn62Bg5124OOO2UdrJ/H0r6P/N+XzlDyHzjseJO8/c37fhYxFCTsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAya6lN/je1iva8cDr/8AkE9z5zft+FRMg847HiZrbPb1NqO+oNvTRa8bpXehPFEczy9y7pG1Va6um5NfqswP0wAAAAAAAAAAAAAAAGxjJ7mHmrtNq11G4HDtpFL4uqt/F4JJJPXz8fmsBg912t14zZLdem7jrLs/J/P6Sh5D5x2PEnefub9vwsYihJ2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZNdSn8s2s/RwP94J7nzm/b8KiZB5x2PEzd2fhGcVGSun7yeKI5fgYVEoN4eMocp6byA/QAAAAAAAAAAAAAAAAbOLipYeeidk2r8gOG7RNzp9zcYqKW85pXkvMBg/12oRhidkk14/7fu9eFsNb9ZQ8h847HiTvP3N+34WMJQk7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMm+pSv23tY+xYH+8E9z5zft+FRMg847HiZubOS8ZRat2efiTxRHNcBUh3CFPeSkr6XV3qB9QAAAAAAAAAAAAAAADYxkHKhJqUk4pvR8V5wOGZ81GlKDbV1rfmla33uBg/wBdhp4rZK1tFj+bul+1/m+7KHkPnHY8Sd5+5v2/CxjKEnYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABk11Kfyzaz9HA/3gnufOb9vwqJkHnHY8TN7Zzl9+0niiObYH8lh8/2sD6AAAAAAAAAAAAAAAAGxjYKeHld23dUBw3aNN0UpNJdrtfj6L2Awd67Di8bso4xaVsdpe/+jlDyHzjseJO8/c37fhYyFCTsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyb6lLfxvaxaarAvh/wCIJ7nzm/b8KiZB5x2PEzb2fjvKLV7p3XjNdvYTxRHNsFTi8PCd5X1/hO3HsA+oAAAAAAAAAAAAAAAB8+Oq9yw8v2Ock1bxeQHEdoG6mC8Vt3krR+/vAwa666ti9kteMcd/uCh5D5x2PEnefub9vwsZChJ2AAAAAAAAAAAAAAAAAAAAAAAAAAAA+rLMqzPO8fRyrJsuxWPxuJluUcNhaMqtWrLjaMIpuT05I8XLlFqma7kxERyzuh7t2671UUW4mZnkjfLlP4FumP8A+U22X/6HFf8A8GH/ABXAf89H91P6s3+E4/8A4K/7av0PwLdMf/ym2y//AEOK/wD4H8VwH/PR/dT+p/Ccf/wV/wBtX6Nut0O9LmHg6lfos2vpwXGU8jxSS+dwPsbUwNW6L1H90fq+TsvHUxrNmv8Atn9HGsxyvM8oxLwWbZdicFiI6uliKMqc1/qySZl0XKLscKiYmOjew7luu1PBriYnp3PlPbwAZe7A/B/+HGw+QbZ/ha+Jd/Mtw2Y/Fu8PdO491pxnub/xhb1t617K/YjhsbnT7JibmH8hrwZmNeFprpOn5Xd4LJX2zDW8R5fThRE6cHXTWNfzOmOsX0FPoB2uy/ZXwp7+rH5bHMPjHxL4ruXq1Ibm73Sd/wDF3vdceGmu/wBh7Y/jViq9wODpOmmuvJE+qPW5/buxv4Lfps8Ph6xrrppyzHrn1OqTdNIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ/wC2HUh2G6Rdgsi2g2Eq09mNoauUYSpNJOWCxc3Ri26kFd05N8Zw87cZN3Jlhc24nA4mu1ifv0cKeuN/JPL1T8YU/FZRw2Ow1F3Dfcr4MdU7uWOTrj4Swt6R+inb3onzp5Ht1s/Xy+rJvuNa2/QxEV/CpVF4s1w4O6vqk9Dv8DtLDbSt+Uw1evfHXCfY/ZuK2bc8niaNOnknqlxIzmCAAAAAAAAAAAABk11KbfGtrUvxt3A2fL/OCe585v2/ComQecdjxM3tnL3j2a/rJ4ojmmCVX4vBqcd3XTd149twPqAAAAAAAAAAAAAAAAfPjZ7tFxUrOSfNa+bX9QHD9oKtB4ZQ34RndOytvWf2rUDBzrrxaxeybemmOVuf+b8ih5D5x2PEnefub9vwsZChJ2AAAAAAAAAAAAAAAAAAAAAAAAAAAA7W6q374XYf+Uv93M0uY/Rd7q+sN3lz0rZ6/pL1gIotr8qttXsth6tTD19pcqp1aUnCcJ4ympRknZppvRp6WP2jDXpjWKJ+EvxnE2YnSa4+MN3BbQ5BmVb4vl2eZfiqtr7lHEwnK3oTufK7F23GtVMxHU+037Vc6U1RM9bZ2l2T2Y2yyypk21mQZfm+BqJ71DGYeNWF+1KSdn2NWa4o9WMTewtflLFU0z64nR5xGGs4qjyd+mKo9UxqwQ61vU/w3Rzl9fpH6Mqdeps/TnfMMtnJ1J4BSaSqU5PxpUruzTvKN07tX3aRlzM9WOrjCYz8fJPr6J6e9NsyZXpwNE4vB/g5Y9XTHR3MTjtnDvXnoD/yH7Afzay7+zwIZtn0jf8Abq75XXYvo6x7FPdDDL4Rb/K5s9/Nyn/acQd9kbzK57f0hwGevPbfsfWWKZ2riQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2W6Pf3A7NfyPg/6mBBMb51c9qe+V+wXmtv2Y7ofVtTsns1ttktfZ3a3JMJmuW4lfsmHxNNTjflJc4yXKSs1yaPGHxN7CXIu2Kppqjlh7xGGs4u3Nq/TFVM8ksJenDqDZtlTxG0PQviamZYNXnPJcXUXxmmuL7jUdlUXZGVpacZtlC2RnOi5pa2hGk/mji98cnXG7qTza+S67et3Z86x+WeP3Ty9U7+tiFmGXZhlGOr5ZmuBxGCxmGm6dbD4ilKnUpyXGMoySafmZ3VFdN2mK6J1ieWHCV26rVU0VxpMck8b5j08AAAAAAAAAABk31Kt1V9rpO+8lgLdlrYi9/oJ7nzm/b8KiZB5x2PEzbyCU4qLjuLXVydrcSeKI5tl874eMGpXV9d12evID6gAAAAAAAAAAAAAAAGxjP8RJb8Yqz4q9/MgOHbQ1GqKS3XNK6klrxs0Bg512JXxuynDhjuSX+jlDyHzjseJO8/c37fhYyFCTsAAAAAAAAAAAAAAAAAAAAAAAAAAAB2t1V2l1hNh7v/ANpf7uZpcxei73V9YbvLnpWz1/SXrARRbXjv0wf5Wttv5x5l2/6TU7S77L8xs+xT3Qgu1PPr3t1d8uJRlKElOEnGUXdNOzTM6Y13SwYnTfDMHqS9Yva6W2uD6I9sM5xea5XmdKcMrqYmfdKmErU4Snub8vGdOUYyVm3ZqCjZXRwmbNh2Ps846xTFNVP4tOWJ3a9ffv1d7lLbt/7RGBxFU1U1fh15Jjfp1ftozpzbK8DneV4zJczoRr4PH4ephcRSlwqUpxcZRfmabROLdyq1XFyidJidY9ykXLdN2ibdcaxMaT1S8bNscgeym12ebLOt3Z5PmOJy91PLdKrKG98+7cveFvfabFF780RPxjVAsVY+zX67P5ZmPhOj1h6A/wDIfsB/NrLv7PAie2fSN/26u+Vt2L6OsexT3Qwx+EWv+F3Z/s8G6X9qxB32RvMrnt/SHAZ68+t+x9ZYqHauJc+6NugrpU6WnKpsPslicZhKc9ypjarjRw0HzXdJtRk1zUbtdhrcftjBbN3YiuIn1cc/CGzwGx8btPfhqJmPXxR8Z+jujBfB3dMleCnjdp9kMM2r7ixWJnJPsdqNvU2c/XnjAROlNFc+6P1dDRkbH1RrVXRHvn9HFNt+pJ09bGYSpj6GR4LaOhSW9N5JiJV6iXmpTjCpJ+aMWzNwmbdmYqrgzVNE/wBUafOJmPjLBxeUdp4WnhRTFcf0zr8piJ+EOhqtKpRqTo1qcqdSnJxnCSs4tcU1yZ0sTExrDmpiYnSXbXRt1W+lvpX2Xp7X7G5fltfLqtapQUquYU6c1ODtJOL1Xz8mnzNHj8w4HZt7yGImYq4+KeVvMBl3HbSsxfw8RNPFxxyNvpN6sPS30R7NLazbHKcHTy74zDCyqYbGQrOE5qTi2o8F4tr9rXaetn5gwO073kMPVPC013xo87Qy9jtmWfL4imODrpunV1ObppHLejLov2v6XNpJbK7FYOjiMfDDTxc1WrKlCNKLjFtyei1nFelowtobQsbMteWxE6U66eveztn7Ov7TveQw8a1aa+rc7Xl1E+sHFOUsmydJK7bzSlojSf8A2Gy/zT/bLd//AB21Pyx/dDH2pDudSVPfjLdk1vRd07c15jqInWNXLzGk6NIfAAAAAAAAAAAAAAAAAAAAAAAB7LdHv7gdmv5Hwf8AUwIJjfOrntT3yv2C81t+zHdDkBisoA616YOr50a9NWAdPavJ1SzKEN3D5thEqeLo9i3rePFeTNNcbWepttmbaxeyatbFX3eWmeKf064ajamxMJtanS/T97kqjjj9eqWAXTf1SukrocliM2p4aW0GzVNuSzTBUnejDtr0tXS9N3Dh419Cm7IzLhNqaUTPAuflnl6p5e/oTHa+WcXsvWuI4dv80cnXHJ3dLpA6JzgAAAAAAAAAyb6lNvjO1r4ySwNlfjpiPdzJ7nzm/b8KiZB5x2PEzd2dbSTSb8y+cniiOZYGFZ0ac1WtDXxHFdvaB9gAAAAAAAAAAAAAAAD58bZUJPzNfj7v/P0AcM2jpuUISjFSdrfjtvj2X/UBhB12Zb2N2T0X4uO4K1/ycoeQ+cdjxJ3n7m/b8LGMoSdgAAAAAAAAAAAAAAAAAAAAAAAAAAAO1uqt++F2H/lL/dzNLmP0Xe6vrDd5c9K2ev6S9YCKLa8d+l+fdOlnbae7u720WZO172/bNQu+zI0wNmP6Ke6EF2pOuOvT/XV3y4iZzBd59TLYnNtrunjIsfg8JUngNn3PMcfXV1ClFQlGmm+2VRxSjzW9yTOczVi6MNs2umqfvV7o+O/4Q6TKmErxO06KqY+7Rvmfdu+MvUMjqyPHTpZzjC7Q9Ke2OfYGanhsxz/MMVQkuEqc8ROUX6mi8bNtTYwVm3VxxTTHwiEF2ndi/jb12nimqqfnL1O6A/8AIfsB/NrLv7PAjO2fSN/26u+Vn2L6OsexT3Qwy+EWa/C5s8r6+DlP+1Yg77I3mVz2/pDgM9ee2/Y+suvOqf0K4Ppp6ToZfn1OU9n8moPH5nGM3B1knu06Ka1W9J6213Yzs07M2uZNq1bKwfCtfjqnSOj1z7o+ejVZa2TTtbGcG7+CmNZ6fVHvn5avTyUsi2SyKdRxwmVZRlWGc3uxjSo4ejCN3otIxSRH/wCZibnLVVVPXMzKxfy8Nb13U00x1REQxuzr4Qroby7N54HLcj2lzXB0puLx1DDUqcKi8qnCpUjNr9JQfmOstZJx9dHCrqppn1TM/PSJj4auSu532fbucGimqqPXER8tZifjo746NekzY/pZ2Xo7XbFZi8Vgas5UpxnBwq0Ksbb1OpF8JK67U0002mmc3j8Bf2bemxiI0n5THrh0uA2hY2lZi/h51j5xPqlip1++hHKKGV4fpn2dwEMPi/jMMJncaUbRrRmrUq8raKSklBv+Fvw7Ne0yZta5Nc7PuzrGmtPRpxx9eje4rOmyLcURtC1Gk66VdOvFP06dz8v4OrpBjhc12k6MsZiIwjjYQzjBRlpepC1OtFPtcXRaXZCR+2eMFwqLeMpji+7PfH1+L8cjY3g13MHVPH96O6fp8GV3TpsL+Enoj2o2OhSdTEY3ATnhIpXbxNJqpRS9NSEV85xWyMZ9gx1q/wAkTv6p3T8pdttjB/b8Ddw/LMbuuN8fOHkJwLmhLOf4OfYfuOU7UdIuJpNSxNenlOFk428SEe6VbPmm50/nh5ic55xety1hI5I4U+/dHdPxUjIuD0t3cXPLPBj3b574+DvDrX9IL6Oug3aHMsPiHSx+aU1lGCcePda94yafJxpqpJPtic5lzBfbto26JjdH3p6o/fSHR5kxv2HZtyuJ31fdjrn9tZeVBaUUAAAAAAAAAAAAAAAAAAAAAAAAD2W6Pf3A7NfyPg/6mBBMb51c9qe+V+wXmtv2Y7ocgMVlAACSjGcXCcVKMlZpq6aHEcbGfpw6j+wnSG6+f7ASobK59O85U4U/2hiZ8fHpx1pN+VDTm4t6nXbIzdicDpaxP8yj/tHv5ff8XIbXyjhsdrdwv8uv/rPu5Pd8GB/SN0VbedFGcvI9udnsRl9VuXcazW9QxEU/xqVReLNejVX1SehSsDtHDbSt+Uw1evfHXCaY/ZuJ2bc8niaNO6eqXEjNYIAAAAAADJnqVq+K2telt3A8r8sRy5k9z5zft+FRMg847HiZv7Ocvv2k8URzPAStSjHk78IPjft4AfWAAAAAAAAAAAAAAAA28Rf4vUsv4L+wDhe0tRfF1Sas/wAZPt1QGDfXW/LNk/0cd/dyh5D5x2PEnefub9vwsZShJ2AAAAAAAAAAAAAAAAAAAAAAAAAAAA7W6q374XYf+Uv93M0uY/Rd7q+sN3lz0rZ6/pL1gIotrH/aLqQ9CO0+0GZ7S5nDPljM2xlbHYjueYKMO6VZuct1bjsrydlc6exm3aOHtU2aODpTERG7kiNPW5i/lHZ2Iu1Xq+FrVMzO/lmdfU+bB9Qzq/YWuq1fLs7xkFxpVszkov8AoKMvpPdecdqVRpE0x7v11eKcm7LpnWYqn3/po7n2H6PdiujbJoZBsNs5g8owUdXCjFudR6+NUqSbnUlq9ZNs5/F43EY655XEVzVPT9I4o9zoMJgsPgLfksNRFMdH1njn3unetb1lck6Jtlcbsrs7mVHEbZZpQlQo0aUt55fCas8RUt+LJJ3hF6uVnZxTN9lzYNzaV6m9djS1TOs/1ackfXo6WgzJt+3syzNi1Ot2qNI/p15Z+nT0PM0rqQPXnoD/AMh+wH82su/s8CGbZ9I3/bq75XXYvo6x7FPdDDL4RZr8Lmzyvr4OU/7ViDvsjeZXPb+kOAz157b9j6y6M6LumrpD6G62Y4jYDN6GAqZrGlDFSqYOlXclTcnFLukXu/jy4WvpfgjpNo7Jwu1IpjFU68HXTfMcfU5vZ21sVsqapwtWnC013RPF1uyKvTb1renrIMw2JwFPMdoMux8Y0cZHLskppKKlGdpVadNbibSveSunbmamNk7E2NdpxFUxRVG+Nap6uKZ3tvO19t7ZtVYemJrpndOlMdfHEbn5eB6mHWRx0I1F0duhCSunXzTBwfzx7rvL50ftXmrZNG7yuvVTV+j8KMqbXr3+S066qf1ZWdSrob6Veh6ltbgekLKKeX4TMpYKtgoRxlGupVIKsqrSpye67SpXb42Vji817VwW1JtVYWrWaddd0x6tOP3u2ynsrG7Li7TiqdIq003xPr14vc5p1yqFKv1btse6w3u5wwdSOvCSxlGzNdleqadrWdOn/GWwzTTFWyb2vR/lDzo6Ftvq/Rh0pbObbUqjjSy/GRWKXlYaonTrL/7cpW89irbWwUbQwVzDzyxu643x80o2TjZ2fjbeIjknf1Tun5PX6nUp1qca1GpGdOcVKMou6knwafNELmJidJXaJiY1h5M9ZXYV9HnTbtVkEKThhauNlj8Joku4V/2WKjblHfcP9Rlt2DjPt2zrV2ePTSeuN37oht/B/Ydo3bUcWusdU7/lxPR/q5bD/g86FNk9m6kHHErARxmKTVmq9dutOL/Rc93/AFUSfbmL+3bQu3o4tdI6o3R3aq1sLB/Ydn2rPLprPXO+e/Ril8Ij0hvMtq8h6NMHVfccmw8sxxqTVpYitpTi/PGnFv0VjtckYHydivF1cdU6R1Rx/Ge5xOecd5S/bwdPFTGs9c8XwjvYfndODAAAAAAAAAAAAAAAAAAAAAAAAD2W6Pf3A7NfyPg/6mBBMb51c9qe+V+wXmtv2Y7ocgMVlAAAAA/I2p2S2a23yWvs7tbkmEzXLcR/jMPiaanG/KS5xkuUlZrk0fvh8TewlyLtiqaao5YfhicNZxdubV+mKqZ5JYS9OXUIzTJ1idpOhrFzzHBQTqVMmxlVLEUktX3Gq7Kol5MrS04zbKFsjOVF3Szj40n80cXvjk927qTvbGTK7Wt7Z86x+WeP3Ty+/f1sO5RlCThOLjKLs0+KZ3kTrvhwUxpOkoAAAAAGTXUpt8b2s7d3A/3gnufOb9vwqJkHnHY8TN7Zzl9+0niiObYH8lh8/wBrA+gAAAAAAAAAAAAAAABtYm/xepu+SwOE7RNzW40o2jpJq/PzMDB/rr7vxvZK177uOv2f5uUPIfOOx4k7z9zft+FjIUJOwAAAAAAAAAAAAAAAAAAAAAAAAAAAHa3VW/fC7D/yl/u5mlzH6LvdX1hu8uelbPX9JesBFFtYH7d9ffpX2W232h2YweyuydXD5RmuLwFKdXD4lzlClWlCLlauldqKvbS5SMHkzB4nD271VyrWqmJ5OWNfUm2MzpjcNiLlmm3TpTVMcvJOnrcfq/CJ9M0lajsrsZB2d28JipP5v2wZVOR8BHHXX8Y//LEqzzj54qKPhV/+nCtseuf1gNr6FXCLa6GR4aqrSp5Ph44aS/Rq61Y/NNGxwuVdl4WYq4HCn+qdflxfJrsVmvamKiafKcGP6Y0+fH83SWIxFfF16mKxVepWrVpupUqVJOUpybu5NvVtvmdDTTFMcGmNIc7VVNU8KqdZbZ9fHrz0Ba9B+wFv/hvLv7PAhm2fSN/26u+V12L6OsexT3Qwy+EWa/C5s8r6+DlP+1Yg77I3mVz2/pDgM9ee2/Y+suDdUzoFwvTft1Xe0DqR2dyCnTxOPjC6eJnKVqeH3lZxUlGbbWqUWlZtNbLMu2atk4aItf6le6Oj1z+jXZZ2NTtbEz5b/To3z0zyR+r0oUNkejnZapOnSy/IMgybDyqSVOEaNDD0oq7dlovtb7WSX+fjr0RvrrqnrmZVv+RgbMzuoopjqiIY47S/CG9FOV4ythNndmc/zuFJ2jid2nhqVXzx3252/Sgn5jq8PkjG3KYqu1009G+Z+W75uTxGeMDbqmm1RVV07oj57/k7C6vXWVyzrBVs8o5Zsrisn7xxw0qjr4mNXuird0tbdirW7l9PmNXtvYNexYomuuKuFrxRpxafq2mxNv0bbmuKKJp4OnHOvHr+i9cT97dtn/3OE/tlE+ZY9LWeuf8AGX3NHom91R/lDyvLOiz1P6ofSC+kLoKyHEYmv3THZJF5Li25b0t6gkqbb43dJ0m782yM5mwX2LaVcRG6r70e/j+eq0ZYxv27ZtuZn71P3Z93F8tHX/Wq6D6nSH0x9FudUcAq2DzDG96M2aV70KO9ilG3DWlHFK77EbTLu14wOAxNuZ0mI4VPXP3e/gtXmPZE47H4W5EaxM8Grqj73dwmUeIxFDCYeri8VVhSo0YSqVKk3aMIpXbb5JJHG00zVMUxxy7OqqKYmqeKHj10sbdYjpL6SNoducQ52zbHVKtGM/xoUF4tGD/RpxhH5i77NwcYDCW8NH+2Pny/PVBtp4ycfi7mJn/dO7q5PhGjiRmsEAAAAAAAAAAAAAAAAAAAAAAAAPZbo9/cDs1/I+D/AKmBBMb51c9qe+V+wXmtv2Y7ocgMVlAAAAA626YOsF0a9CuAdXavOI1cynHew+U4Rqpi62mj3L+JF+XNpdl3obbZmxcXtarSxT93lqnij9eqGo2ptvCbJo1v1fe5KY45/TrlgF03dbbpL6Yp4jKaWJls9s3UvFZXgqrvWg+Vero6v6NlD+LfUpuyctYTZelcxw7n5p5OqOTv6Ux2vmbGbUmaIngW/wAscvXPL3dDo86JzgAAAAAGTXUp/K9rLcd3A2X/AOQT3PnN+34VEyDzjseJm9s5y+/aTxRHNME6vxeCUI7uuu9rx7LAfUAAAAAAAAAAAAAAAA2MXNwoSShJ7yaule3pA4TtJNOMVKlPVaPSy19oGEXXZSWN2TsreLjv4Sf+jlDyHzjseJO8/c37fhYxlCTsAAAAAAAAAAAAAAAAAAAAAAAAAAAB2t1Vv3wuw/8AKX+7maXMfou91fWG7y56Vs9f0l6wEUW1489Ml/wvbcXd34SZnfS3+dVC77L8xs+xT3Qg21fP7/t1f5S4eZzAAAAD156A/wDIfsB/NrLv7PAhm2fSN/26u+V12L6OsexT3Qwy+EWX/pd2fdl+5ylr/wDVYg77I3mVz2/pDgM9ee2/Y+su0Pg43hfwfbWRhKPxlZzTdRc1DuEdz6d/1M0+etftVr1cH6//AMbjImn2W76+F9HZfXJ2U2o2w6CM3y3ZTCVsXiKGIw+Mr4WhFyqV6FOd5KMUm5NPdlZeQanK2Js4XaVFd6dImJiJ9Uz/AO0bjNOGvYrZldFiNZiYmY9cR/7V5eQoV6leOFp0ak605qnGnGLcnJuyilxvfSxYpqiI4UzuRqKZmeDEb3oX1EehvbTo42dz7anbHL6mWT2leGjhsBiIOGIp0qPdP2SpF6w3nVdotJpRu+KJdnDamHx12izh54XA11mOLWdN0dWip5O2ViMBauXsRHB4emkTx6Rrvnr14nYfXBhKfVv20jCLb7hhXZdixdFs1WWPS1nrn/GW2zPv2Te6o/yh5WlnRVlt8Hl0hd6Nu856OcZXaobQYVYzCRfD4zQTckvPKlKbf/dI4jO+C8rhqMXTx0TpPVP797ucj47yWJrwlU7q41jrj9u5n9KnTnKEp04ydOW9BtXcXZq67HZtehsmUTMKdMRPG6T64+362D6Cc7WHxPcsfn+7k2Fs7N91v3Xhr/iY1de1o6DK+C+2bSo1jdR96fdxfPRz2acb9i2bXpO+v7se/j+Wry3LIjIAAAAAAAAAAAAAAAAAAAAAAAAAPZbo9/cDs1/I+D/qYEExvnVz2p75X7Bea2/ZjuhyAxWUAAPydqdrNmticlr7RbW53hMqy3DL9kxGJqKMU3wiucpPlFXb5Jn74fDXsXci1YpmqqeSH4YjE2cJbm7fqimmOWWEvTh1+c2zV4jZ7oXw1TLcG7wnnWLpr4zUXB9xpu6prslK8teEGihbIyZRb0u7QnWfyxxe+eXqjd1p5tfOldzW1s+NI/NPH7o5Oud/UxCzDMcwzfHV8zzXHYjG4zEzdStiMRVlUqVJPjKUpNtvzs7qiim1TFFEaRHJDhK7lV2qa651meWeN8x6eAAAAAAAGTXUpTeL2stdeLgVfs/KCe585v2/ComQecdjxM3dnJw3VPeW72305k8URzfA/ksPn+1gfQAAAAAAAAAAAAAAAA2sVFSw87xTtFtX5acQOFbS1KkaailHdtdJ63d/QBg711rfG9k+22O05W/a9ih5D5x2PEnefub9vwsZShJ2AAAAAAAAAAAAAAAAAAAAAAAAAAAA7W6q374XYf8AlL/dzNLmP0Xe6vrDd5c9K2ev6S9YCKLa8eemNNdLu3CfFbSZnzv/AJ1U58y77L8xs+xT3Qg21fP7/t1f5S4eZzAAAAD156A7/gP2Av8A/DWW/wBngQzbPpG/7dXfK67G9HWPYp7oYY/CK2/C9s+9L+DdLn//AKsQd9kbzK57f0hwGevPrfsfWXXfVd6fZ9BG21XF5lQq4nZ7O4Qw+a0qSvOCi26daC/hShvS05xlJcbG2zDsb+MYeKaJ0rp30/WPe1OXdtfwbETVXGtFW6r6T7npnshtvslt/k9PP9jNoMFm+AqpNVcNU3t1tX3Zx/GhLtjJJrmiQ4nCX8Fc8liKZpnp/wDb1fwuLsY235XD1xVHR/7c+zvPkGExc87eV5fRxUVKc8X3CEaiTT3m52v231PHlbtVPk+FMx6tfo/TyVqmrynBiJ9en1cP2b6d+jLbDpDxXRlsvtDTzPNsFgqmNr1MPaWGShUjCVNVL2nUW+naN1ZPW6aM6/sfGYXCxjL1PBpmdI1498a66ckdbAsbYweKxU4OzXwqojWdOLdOmmvr6m9057K1ttuh/a/ZnC64jGZTXeHXlVoR7pTj5ryhFX5XPOyMTGEx9q9VxRVGvVO6fk9bYw04vAXbMcc0zp1xvj5vIMuiEuR9HW2OM6Ptusi21wLn3XJ8dSxTjC16lNS/ZIa+VByj85i47C043DV4er/dEx+k+6d7LwOKqwOJoxFP+2Yn9Y98bnsXl+OwuaYDDZngqndMPi6MK9Gdrb0JxUov1NEGrom3VNFXHG5e6K4uUxXTxTvYAfCE9IMc86Rcp6P8FiFPD7NYN18SoyWmKxFpbrXmpRpNfpv56dknBeRwteKqjfXOkdUfvr8EwzvjvLYqjC0zuojWeuf20+LFA7VxAAAAAAAAAAAAAAAAAAAAAAAAAAPZbo9/cDs1/I+D/qYEExvnVz2p75X7Bea2/ZjuhyAxWUkpRhFznJRjFXbbskhxnExn6cOvBsJ0eOvkGwEaG1WfQvCVSFT9oYafDx6kdarXkw05OSeh12yMo4nHaXcT/Lo/7T7uT3/ByG183YbA62sL/Mr/AOse/l93xYH9I/Stt70sZ088262gr5hVi33GjfcoYeL/AINKmvFguHBXdtW3qUnA7Nw2zbfk8NRp3z1ymmP2litpXPKYmvXo5I6ocSM5ggAAAAAAAADJrqUt/HNrFfTdwP8AeCe585v2/ComQecdjxM3dnFJRVnHefO2nMniiOb4C/xSnfjr9rA+gAAAAAAAAAAAAAAABsYxruEouputp2W9a/mA4RtHPeShvR4X4q7+js7AMJOu1u/HtlN2DirY7RvX/oCh5D5x2PEnefub9vwsYihJ2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD6suzTM8nxKxuU5jisFiIqyq4atKnNLs3otPkjxct0XY4NcRMdO97t3K7U8K3MxPRufoZrtttlntD4tnm1udZjRtbueLx9WtG3ZaUmj8reEw9mdbdumJ6IiH63MXiL0cG5cqmOmZl+KZDHAAHZvQD0L590z7fZdk2GyvFTyOhiIVM4xsIuNOhhk05x7pwVSS8WK43d7WTa1G2tq2tlYaq5NUcOY+7Hrnq9UcrcbF2Td2riqbcUzwIn708kR1+ueR6uY3GZZs5kuIzDF1KeEy7K8LOtVk9IUaNODbfmSjF+oitFNd+5FNO+qqfjMrZXVRYtzVVuppj4RDx36Qdr8b0gbcZ5tnj3N1s5x1XFbsndwjKXiQ9EY7sV5oou+CwtOCw1GHp4qYiP39/GguOxVWNxNeIq46pmf293E48ZTFAAAAAAAAAAAAAAAAAAAAAAAAAB7LdHv7gdmv5Hwf9TAgmN86ue1PfK/YLzW37Md0OK9MHWD6NehXAOptXnCq5lOG9h8pwlqmLrdj3b2hF+VNpcbXehmbM2Li9rVaWKfu8tU8Ufr1Qwtqbbwmyadb9X3uSmOOf065YBdOHW06SumSVfKaeJls/s1OTSyvBVWnWjqrYiqrOrx/FsocHu3SZTtkZawmy9K5jh3PzTydUcnXx9KY7XzLi9q60RPAt/ljl655eri6HSB0LnAAAAAAAAAAAAZN9Sl2xW1t2krYFu682I5k9z5zft+FRMg847HiZu7NpRUUr8+Lv2k8URzbAK2Fh57/AGgfQAAAAAAAAAAAAAAAA2Mar4ad76di9wHDNok40nJX1Wrtf0a8uHqAwf67CisZsmle6WPTurf6OUPIfOOx4k7z9zft+FjGUJOwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkB1G8uwOZ9PmCw+Y4Ghi6Ky3GS3K1JVIp7lr2aa5/Scxm6uq3syZonSdYdRk+im5tOIrjWNJemNKjhsFQVKhSpUKNNO0YRUYxXF6LREimZrnWd8q/ERRGkboYYddHrQbPY7Z/E9EHR5mlDM6mPtHOsww1RTo0acZp/F6c07TnJxW+1oo+Lq21Hv8q5eu0XYx2Kp4MR+GJ456Z6PV/wC1n+a8w2qrU4DC1cKZ/FMcUdEdPr+HVg6UVOAAAAAAAAAAAAAAAAAAAAAAAAAAAMrtvOvZtC9kMp2M6J8vqZMsJluGwuKzbGQhPEucaUYzVGn40IK6fjtyb4pRepxWDyfa8vXiMbPC1mZimOLj5Z456t3vdtjc43fIUYfAxwdIiJqnj4uSOKOvf7mLWY5jmGb46vmebY/EY3GYmbqV8RiKsqlSrN8ZSlJtt+dnZ0W6LVMUURpEcURxOMuXK7tU11zrM8czxvmPTwAAAAAAAAAAAABk11KVfF7WXs1u4Ff2gnufOb9vwqJkHnHY8TN7Zzl9+0niiObYH8lh8/2sD6AAAAAAAAAAAAAAAAGzjHFYWq5vxd1p6X08/mPsa67nydNN7hu0zn8XUd17mjvra9+HYfH1g311vyzZP9HHf3coeQ+cdjxJ3n7m/b8LGUoSdgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfwWPx2W4iOLy7G18LXimo1aNRwmr8bNanmuim5HBrjWOl6orqtzwqJ0nofs5p0hbfZ3gll2dbcbQY/CKO6qGKzOtVpqPZuyk1bV+s/C3gcLZq4du3TE+uIiPoyLmOxV6ngXLlUx6pmZ+rj5ksUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZNdSn8s2s/RwP94J7nzm/b8KiZB5x2PEze2c5fftJ4ojm2B/JYfP9rA+gAAAAAAAAAAAAAAABtYpSlhqqjPde69bXPsdL5PQ4VtNu9zirPetxvpa/YfH1g711vyzZP8ARx393KHkPnHY8Sd5+5v2/CxlKEnYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABk11Kfyzaz9HA/wB4J7nzm/b8KiZB5x2PEze2c5fftJ4ojm2B/JYfP9rA+gAAAAAAAAAAAAAAABtYqEamGqxnG63W/n5H2J03w+TGu6XCtppPucY6Wtfhrx7T4+sHeut+WbJ/o47+7lDyHzjseJO8/c37fhYylCTsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAya6lP5ZtZ+jgf7wT3PnN+34VEyDzjseJm9s5y+/aTxRHNsD+Sw+f7WB9AAAAAAAAAAAAAAAAD58d+SVeP4vJtNff1duh9p43yricP2mj+11PdXJXs78fV+s+PrBvrrflmyf6OO/u5Q8h847HiTvP3N+34WMpQk7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMmupT+WbWfo4H+8E9z5zft+FRMg847HiZvbOcvv2k8URzbA/ksPn+1gfQAAAAAAAAAAAAAAAA2cXf4rVUW03Bq64rz8GIJcN2jVOWGctd6Nlqrc/pAwc666axmyd014uO+zDlDyHzjseJO8/c37fhYyFCTsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8vPNqdndmqcaufZzhMEpK8VVqJSku1R4v5kYmL2hhcDETibkU6+ud/ujjZmE2fisdMxhrc1aeqN0dc8T8nK+lTo9zmssPgNq8E6spKMY1XKi5N8lvpX+YwcPmHZmKq4Fu9GvTrHfEM7EZd2nhaeHcszp0aT3TLlSaklKLTT1TRueNpeIAAAAAAAAAAAAAAAAAAADJvqUp/G9rJcksCv7QT3PnN+34VEyDzjseJm3s/UjTUXNtJu17Pzk8URzjA/ksPn+1gfQAAAAAAAAAAAAAAAA28RGpKjKNJJuSa1YHC9oIVJwVo9t227fMub9AGEXXeX7a2Rldu6x/F66fF1+ooeQ+cdjxJ3n7m/b8LF4oSdgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4t0k7ZQ2I2VxObxcXipfsOFi7O9Rp2dnxSSb+a3M1G3NpxsrB1Xo/FO6nrn9ONuNhbLna2MpsT+GN9XVH68TFC+0+3e0MIUaGPzfNcwquNChRpzxFatU5QhBJuT/ipehciL38RdxVybt6qaqp5ZWqxh7WFtxas0xTTHJD6dtOjrpA6OsZSwW32wef7MV8ZDutChnGW1sJOcL8YqrGLa86Pxfs7Q6BOknHPNo7D5tinXwleM+99SbcpwnFX7nfjuOKbV+FrI7zKG27kXo2fenWmfw9GkcXVpHucFnDYluqzO0LMaVR+LpiZ4+vWfe7/ACkpoAAAAAAAAAAAAAAAAAADJzqTxcsVtYkld/EEvViCe585v2/ComQecdjxM28hjKO4tWnxSTX0/OTxRHNMA5woxo1IS4XjLimn9nzsD6wAAAAAAAJfWzT42QBNPVO4FAj3tWrPTRecA3w0vf6AF9bAE07pPhxAjTcHF2bas9NPUBxfPsPKVp8UpSjJcX4urd1btAw566uyuIxmyuV7S0aNSp3oxkqdZ20p0qyScm+zukIR+dfN2uSMVFrGV4eqfxxu6Zp/aZn3OJzxhZu4OjEUx+Cd/RFX7xEe9hyVBLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdLdZ2vOGRZNh0lu1cTUcu3SKt9pwee5nyNnrnuh3uQ4jy96eiO+WQXwLezuTZl0+7V59jsBTrY7KNnl8SqzV3RdWqozcextRSvxtdc2TZS2XHwwuSZTmHVPp5tjMBRq4zLdo8G8JXlHx6O/CqpqL4pSSV1wdl2IDxu6HmvwlZEr8cQ+X8V+o22wqpo2jZmn80NTt2mK9m3oq/LLMAt6GgAAAAAAAAAAAAAAAAAAzC6mOy2IweyeabSV6E4d9sZGNF2/wAZSoXSmu1d0lONvMyX53xUXcZRh6Z/BG/omr9oifeqWR8LNrB14iqPxzu6Yp/eZj3Muslw8rQXjOEHHjZtNJ8fUvn7OJxTtnM8JFRo3i7p6J9qSsn89r/OBvgAAGinJzhGTdna0kuF+YGsABJJuLUZWbWjtwAoEcU7taNq11xA03cUlbRXvz0+24GpNO6T4cQKAAjSejVwDV7atWd9APyc4w0KkKkXFN7rmknx4X9Gm8/PZAdZ7Z7L4LaXKsTlGa4ONbB4ym8NWpyjdShK6dufPlrfW97H62b1eHuU3bU6VUzrEvyvWaMRbqtXY1pqjSYYF9J/Vt202Jx1bEZBg6+e5S3vQlhoOpiKMW9I1IJJy5+PBOOjvuvxVV9lZqwmOoinETFuvp3RPVPJ1TOvXxpNtbKmLwNc1YeJuUdG+Y645euI06uJ1LicLicHVlh8Xh6tCrHjCpBxkvSmdPRXTcjhUTrDl66Krc8GuNJbR6eQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0j1oP8A1TkP/ia3+zE4PPf+jZ657od9kP8A1r3VHfLJj4E1L8M23r/7P0f68mylMtfhef3n+J1/94sv/wBmqB4w9DkN7pJyOV7bmIv6fFa/WbTYvpCz7UNXtv0de9mWX5cULAAAAAAAAAAAAAAAAG7hsLicZVjh8Jh6terLhCnByk/Qkea66bccKudIeqKKrk8GiNZdt9F3Vt2z24x1LE7Q4TEZDk8HvVamIp7mIqxT1jTpy1Tdrb0lZXulK1jmNrZrwmBomnDzFy5yacUdcx3Rv5N3G6nZGU8Xj64qxETbt8uu6qeqJ753cu/iZ2bGbL5dkOXYHKMtwtLD4LB0o0qMYrSEY2SjfW78/N9r1JRevV4i5VduzrVVOsyrFmzRh7dNq1GlNMaRDsbJsNOn3Kaptyb33Faacfm+ftt2M/J+rkUI7sVG97JK/wDzA1AAI72dnZ8gNELS1taUW0+fHW1+zh9AG4AAAAAADTKF5RknZrS/m7PoQCM7u1rXV1fi/mA1AAAG3Vpd0XHk/N9PLVIDjecZSoqbtuvWSnG61tdWSv61wb9AHDMyyOClKo8NepBtKnKO7a997TlwWi83YB+LidnI1tZ4fWbkpX5PxbSfLjJffiH5ktloKyWH3ZOVlePN8rc1r7uAG3PZTDWk6bbUXbm9Eld34cftQGl7JUl/CW62kpWlbW/Hs4fdagHsnBLW0bK7clJLzL0v9TAPZKCvpZKN25KSALZGMnFRWjtq1Li/t94EWycJRvBbzSd7KX23Ar2Spp7t05P8WylrrYAtkVa8o217JXta9wItkoys4RvFvR2l22Ar2ThGydruTS0lZ6ff1gFsje/iWt5pagR7Jwcmoq/pUr8E72v5wKtkYpKU1Za30loBFsmm2lFXXFeNdekCvZKMY70lZbt9IydvMwJ4JLelDdV4uzS3tGBfBGKV5Rf4t7KMnr2ATwTW9u2Tdr2W9wA1LZFaOUbXveyk2gNL2TirXilfhfe9X0oCrZG9/EtbzS1AS2Sir2jp51JcrvmBFsmpJOMU03xW8BqeyK4KN3fslawGnwTjdLdV3wXjagVbIp6uNtbcJX9IDwR10hxdlpK/GwGlbKKSbhFSt2bwGt7IRV1a7ukrKVmBpeyaSbcUrK7vvAWOySk14qs+dpWAeCKsrRd7XekgI9k4xV5RSS7d778mBVsjd23LaX4S9QB7IrlF8Fe6kgI9k4xV5RSS7d778mBVsjd23LaX4S9QB7IrlF8Fe6kgI9k0k24pWV3feAsdklJrxVZ87SsA8EVZWi72u9JAPBHlucXbhIDStlFJNwipW7N4DW9kIq6td3SVlKzAngj/ABPokBPBON0t1XfBeNqBVsinq421twlf0gHsj2Q05aSAj2Stxh9EgC2TUknGKab4reA1PZFcFG7v2StYCeCP8T6JAR7JxVrxSu7L8bj92gKtkb38S1vNLUA9kVd7sW1e2qkgHgj/ABPokBgl8K5lEcr2D2Ge6t6pmWK7b27nTfP0oD874E3/ACzber/s/R/rwMtfhef3n+J/nFl/+zVA8bugDbHI+j/pl2T2y2lq1KWV5VmMK+KnTpd0nGmk02o83qgPQfLfhLerzi83jgMVs7thhMDKpuPMK+EouEVr40oQrOVrJ2STfDTjYMqujvaHYbpY2cwu13R3n+FzzKcX+LXw0pb0HzjODtKE1zjKzWt7Acl8Fry3Y0JPS/O9u3iBfBSX+jT+n2gPBSX+jT+n2ga4bJJqTnBwtG+qlr9IE8E024qKvF2a8bQC+CP8T6JAPBH+J9EgHgjHccpKzXK0gJ4JptxUVeLs142gF8Ef4n0SAeCP8T6JAVbIrdvu62TtaXPl/wAgNK2Ti3uqKva9vG4Afbl2y8YTlCorRcXJOzdnbjr+rUDk2W5LGnGbkoxlzUb3aVr6vz7y5PTzaBy7L8qjRmpyUXaN47qb3eF35+DYHI8FhHh/Hl+NKKVnq49uvq9QH1gAAGipLdTlyinJ9nz/AH5AWEdyKiuC0Xo5AagAAAAAAANurayTfF2VuOumn37QNavZXVnzAoAABtYml3WnupXfov5u1doH5VTJ6uJklUgocbtu6V+xJ6WbbA+Cts9OUtYR5vxJa7rs+GnZbhx83APnxGzfi+JhIQTlGylDhK+9or+d9vNAaIbPw3k3RhaUIySUXuu/B69u8/naXJAIbPJ71Pua7o7Jvdbu2uGvmjf1+dgI7PwlLdjTjreySbT9/i+rXmwIsgp79+5xaVkkldat2XDzvX0eYBPZ2Mp7ihFyuoxitNeHzcX90BZZDSnuzUYxi/Git211yeqAkdn4dzUVTUUtHLdcnbhr5tF6XfncCLIKMHvunCVk278EtHfh5vt7WBZbOwUpRqpKSdmrW1562+kC+D8JLdhSildybSvdLVvhyu/oXYBpWz9BpNqLuteXFei4Fns+mu6OEYxXHxb2vqlw8/Ds8yAd4KMdVGLas1yaa1+1ASWzsYWcoxUUmvxddNOzV3t9IFeQUYp7sYt9vB8nbs5AHs7GNm4xUeGsezjy46ev0gO8FBwsoxvJPXg1dW7OwCS2eju77hFJcfF5vW2i7H9gFWQUEpLdjvLS/Cz52aX0gFs7F33YR5vhfS93y8/2eYCQyCimt+MHrbh6+Xo+6APZ+k5b27HS78yWj7OGn29rAPZxRk4yjBS4JNW9enoA1d4aEorcjFJO/C17cLpoDStnI7nixilFcWr6cE728328wKshoRd5QhJcOHN+hen7sCS2dpSlolJt/O+K7PP97ICvZ6F1KSglJby8W1128ACyGhbd3Ypu+qXFefS3H9TAkdnae94sU/p52XL+N9nYgHg7CLamoXXmt+oCvIaEtN2MbK9ktNfSuz2ASOzkG3GEE29FpfW3o/i/b5wC2fpLioPXs9wFeQ0ZPhFWSsktF6192BI7OQbcYQTb0Wl9bej+L9vnALZ+kuKg9ez3AV5DRk9VFaOySukvV23+0CR2dp73ixT+nnZcv432diAeDsItqahdea36gLLIaL/gQSXJa6v5vN9gEeztJu0YqV3ZW4812ef72QFez0LqUlBKS3l4trrt4AO8FLd3Ywp3el72v6dAIsgoNKUbcecbfqALZyO54sYpRXFq+nBO9vN9vMCxyCindwpy9P8AyAneCi5eNbV8bX9PL0fSA8HqSd1GLtdvhZLR9nm+3tYFezkYScZximuTVn9gCWQ0d227BJcbc/oAng9RacXu3Wj/AF2dvpAq2di77sI83wvpe75ef7PMAjs/SVnKNOXb2fYAeQUm7tR9i9XYBHs9QlHlqvRx+YDzt+GWy74j0b9HslT3VPN8ZyXHuVN8vT9gHXfwJt/wzbe/zfo/14GWvwvP7z/Ffziy/wD2aoHh7s/kecbTZ5gNndn8BiMdmWZ4iGEwuGw9Nzq1qk3uxjGK1bbfADvzpZ6gfWj6F9gqfSZtx0erDZRCEKmNeDxlLE1MBvJNOtCm3uK7s2rxT4tAcD6CusV0odXfNc0znozzmhhK2bYKWDxVLE0FWoyWu5U3HpKpCUm4tp2u07ptAfs1uuZ1pq+ZyzmfTftR3dtXUcVajfjbuSXc7acN22nCwGbHUs+EnzHbDanL+inrAfEPjGa1aeGyzaGjRhh4zrtWjTxME9xOUtFOCSvJXiuIHpjLIaS1tSilJR4N8b25cfxvo7EBVs/SavuxXq9gDwfpdkPo9gFWQUbreUWly+6ALZ6m34lNPe8VRjG+qXC7XYk/6XnAng/S7IfR7AHg/S7IfR7AKsgpXvKMJen/AJATwdhxjBO6eijfglfW36Ovp7WA8H6XZD6PYBVs/STut1NffsA3KeT7jj+yWUWmrPhx5fOB+tgsos9+U5PegnJtr8a6a7eCf/ID9WjhaVBWUU3zk+LA3gAAABtpuorxdotKz7U/pQGtJJJJWS4ICgAAAAAAAaZw3ra8NUnwvyYByau3HRc/YgLdXtfV8gKAAAAJZXvbVcwJKEZXUldPinqvUBVFK1layskuAEUIq9la7u7aXYBwg5Kbit5cHbUA4RlFxkt5Pk9QEYwS3Yx3VF8ErL76gSVOlvd0lCG9deM0r35Aat1NNNXUuKeoGmNKlB3hTjF9qVgK6cJRUZxUkvK1+0CRpU4pqEFG/HdVvsAs6dOdt+EZW4XVwJGlTimoQUb8d1W+wCzp05234RlbhdXAkaVKDvCnGL7UrAV04SiozipJeVr9oGnuNCLUlRgmmrWiBr3U001dS4p6gaPi9D8zT/ooDVGMEkoJJRbso6ICSo0pPelSg2+bigEaNKL3o0oJrmooCuEZRcZLeT5PUDT8Xofmaf8ARQGqNOEVuwioq9/F0AkqVKbvOnGT7WrgT4vQ/M0/6KA1qKVrK1lZJcANDo0JSd6MG+LbiA+L0PzNP+igNdtbgaHQw6snRp68PFQD4vQ/M0/6KA121uBo+L0PzNP+igHxeh+Zp/0UBrUUrWVrKyS4AaHQottujBt8XuoB8Xofmaf9FAao04RW7CKir38XQCSp0qj3p04yfDxogT4vQ/M0/wCigLGjSi96NKCa5qKArhGUXGS3k+T1A0qhh3dKjT04+KgHxeh+Zp/0UBqUIxSUVupcEtEBJUaUnvSpQbfNxQE+L0PzNP8AooAqFFNNUYJrg91Aa91NNNXUuKeoGj4vQ/M0/wCigCoYdpNUIa/xEBY0qUHeFOMX2pWA2sbicBgcHUxmZYihQwuHjv1KuImowhFcZSlLRLzsDojOOvT1PMizSpk+YdOeyaxVKbpzVKv3WMZLk5wTitdOIHcOyO12xe32SYfaPYvPcqzrLMVFTpYrA16danNeaUW0B53/AA3FOnDo16NtyEY3zjHXsrf9FSA6h+BNv+Gbb3+b9H+vAy1+F5/ef4r+cWX/AOzVA8vvg5oQqddbosU1FpZnXklJX1WErtfOnr8wHuN1pqFPE9W3pPo1aMasJbKZnvQlHeTXxeb1QH82GX4WpjcfhsHScVOvWhSjvcLykkr6PTXsYHt9lnwSPVb/AAVQ2WxmW5rX2lqYFp7Rd8KsasMY46VY079z3FLhBxaavze8B4qbU5Didjds822YljFLE5HmdfAPEQbinUo1XBzT4rWN0wMmMR8KH1yFh8Ll+C6RMNgqGCw9LDRjSyyjvT7nFR35ympSc5WvLW13wAyN6rfwum0GI2iwOyfWWy3AVsux1eOHhtLgKTpTwk5KyliaPjRlC7fjQS3Ul4rs2g9XcvqZZmOCoZjl1ShicLiqca1CtTanCcJRTjKL5pqzv5wPo+L0PzNP+igNcYxit2MUkuSQGiVKjOTcqUW+bcf1gT4vh42Xcaer0ukBfi9D8zT/AKKA1RhCCtCKiuxKwElSpTd504yfa1cCLD4df9DD+igHxeh+Zp/0UBqhTpwvuQjG/GysBqAAAAG3Z7705pq+qXn/AFAbgEur2vq+QFAAAIrNuSd+XHsAoAAAAAAAACWV721XMCgRq/OwB30s/SAd+SAJWAJ3SbVvMATvfzAG0rJvjwAoAAAAjSdm1w4AUAAAiXHW9/oAO/JgErJJcgGt+GgFAl9bW+cCgRO9/MBQJ4sk4uz5NAUAAAARq6aTt5wKBErJJcgCvZXd3zAoE1vw0AoEbsm0r+YCgRJK7S48QF9bAUABE00mndPgwKBGuGtrfSASsBQJrfjoBQAE1vw0ANJ6NXAoEvra3zgUDyV+GH6zm08NrsF1btmMyrYLKcPgqOZZ53GdvjdSpd0qUmn+LGKu4u920+QHnVlXRZ0kZ3sziNtMn2GzrHZFhLqtmFDBznQh6ZRVtL/Q+xgc06vHWe6VOrRtpR2q6Os9qLD1aqnmOVV5ftTHwvrGpDhF2taUdVZa20Ay4+ET60mwXWq6uPRhtrsfP4rjMPnONo5pldWadbA1+40rxklxi+MZcGrAb/wJv+Wbb1f9n6P9eBnn8Il0LbY9O3VizrY7YHBvG53hcZh80w2Cj+Pi+5b29Shf+E1NtegDzq+Dj6ofT5lvWl2a292u6Oc42cyLZGWJxmMxWZ4V0VOboVKcKVNSacpOU1qrpJO/ID1e60Kb6uHSbZf+6mZ/2eYH83Gzn7ocr/8AG0P9tAf1IYKSlhaf42kVx56cfQB/Mp00X/DVt3ZpPwpzTVuyX7bqcwPQ7qf/AAVXRl0v9A+S9KPSttPn1LMtrMNPF4PDZXWp04YLDOUo0m3KD36rUVJ3W6t61m9QMDus50JYnq6dNu03RBWzbvnSyWtD4vi3FRdWjUhGpCTXKW7JJ8NU+QHs58Fhthmu2PUx2RhnOIqV6uQ4vHZPRqSlq6FKvJ0o6cownGCXZBAZcgANFSTi4JO15WfaBqSsBQAEaT0auBQAAAAAAAAAABLa3uwHjW5N39GgC+trfOAsr3tquYC1kkm9PnuA8a3Ju/o0AX0V01fl2AE07pPhxAoAAAAAAAAAAAAAAEsr3tquYC2twDXDW1vpAO+ln6QDvyQC+trfOAbtbzgG0tW7AUAAAAAAAAAAARpOza4cAKBErAGr87AUCK+t36ADvZ2V3yAoETvysAbsBQJdXtfVcgKAAAAAACNJppq6fFAUCNXTT5gUABErJJu/nAoEV7K7u+YFAivzQBuybSv5gKB4f/DBbCYzZzrRx2tdKSwO0+UYatSm27d1oxVOpFf0Yv8A1gMsfgb9v8k2o6As96MMVTozxezuaV6lXD1Ypqth8Ruy3t21mt68Xf6bgdM/Cb/B+5XsJg8X1hehbJ3h8ndVPaHJ8PTXc8G5f5zTX8GDdlKPJyVuIHmcpyUHHedr33eK4cfSB6N/Amu/TLt7aTivB+h4i4P9n4vz+1gexTV7eYCgfFneTZbtHkuYbPZxho4nAZphauDxVGXCpRqQcJxfmcZNfOBhRsT8Ef1cdiulPC9IMc52kzTB4DGxx+DyPGVaUsPTnGalFTnu79SCaWj111fADOKK3YqPZotb6elgfzm9YzoG6WdnOsbtvspitg86xGMxe0uNq4P4vgqk44ulXryqUp0pbtpKUJxd1e19QPdzqo7C5/0ZdW/o62C2poRoZtkuz+Fw+MpJ37nV3FKUL87OTXzAeL3wo379Tbj/ALvAf2WmB6QfBBXfU9wzaSb2jzHnrwpJX+b6LelhmyAA26qbimlqne64r2+y4GtNNJp3T4MCgAAAAAAAAAAAAAAAAAAAAAAI0mmmrp8UAtxs2ru4Bb2u9bjpbsAm8rXl4tld35AagAAAAAAAAAAAAAAAAAAAARpNNNXT4oA1e3mAW1vf5gHja8Hrpy0AN2TaV/MAbtbzgLq9r6vkBQAAAAAAAAAAAAAAAAABEkkklZLggCVgFtb3+YBrfjoA1vw0AN2TaV/MBQIndJrmATTuk+HECgAAAAAAAAMIPhZugqp0pdXZ7c5PglVzjYTErMFuxvUqYSfiVYJ2bst5TtpfdQHmd8Ht1gaXV+6x2R5vnGKrU9n8+fejNFCWkY1WlCo1z3ZW7NGwPf8AzPLMj2tyHFZPm+Dw2ZZTm2FlQxOHqpTpV6FSFpRkuDTjL6QP56Ou/wBWzHdWTp1zjZCkt/IMxnLMcjrXu5YSbdoS0spRd4210SfmQZO/AouUumfbpxa12fpOd76Lu9oxXn+iy43A9inxWr48kBQAGinpdNJNvetftA1Li1d9vADTKjRnUhWnShKpTvuScU3G/Gz5XA1geAnwof79Pbn9DA82/wDNqfaB6R/BB73+B1g22t17RZlursV6d/pv99EGbAACO9nZ2fIDRTtFula1tY35rzejh6gNwAAAAAAAAAAAAAAAAAAAAAAAAAAI1dNPmBN3xt5Pjo9PT7QG81+NG3DhrqBU09U7gUAAAAAAAAAAAAAAAAAAAAAAAAARRSbklq+ICztpLnzQDW/DQAnx0tb6QG8rKTdk7cdAKAAAAAAAAAAAAAAAAAAAAAAAjim02tVzAoESskm7+cAr2V3d8wCvzQBPjpa30gL62AXV7X1fID4s8ybLtosmx2QZvho4jBZjh6mFxFKSTU6c4uMlr5mB/OR1seg3OOrx06bRbB46h3PDUsXPFZbUUWozws5OVK1+LUXG4HsH8GV1lodPHQLg8gzzMe7bU7GRhlmPhLWdSjFfsNbhqnGyfJNWAx7+G52VzDE5T0b7X4fK9/C4SpjcHiMXGDbg5dzlGEmvxU9Wr2u78bAcH+BJyjMqnSV0iZ9DBVXgKGUYTCzxG74iqzqyahe1r2i3a/C3agPX4AAA0JS3lvK9lx7H939+Yala7tfjrcCgAP53/hCtocPtP1y+lHM8JUhUpU82hgoyjzeHoUqMr+fepsD1Z+CYy14DqX7PYpRtDMc3zXE03e90sTKlf10n7uCDMcABt1fxqS7Z/qYG4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASyve2q5gLaOzavz7AJvWbu7LRaq2v3sBqAivZXVnzAoEvra3zgUAAAAAAAAAAAAAAAAAAAAAAAAlle9tVzANXt5gDXDW1vpAa346AN5Wcm7JXvfQBrfhoBQAETuk2reYCgAAAAAAAAAAAAAAAAAAAAARpOza4cAMD/hYOrDU6WuiOl0rbJ5Q8RtLsWpVMQqME6mIy+zc1prLc4pekDzU6h3WRn1Z+n3LNo82xk6GzWcLvXn0dbRoSfi1WrXvCWt+ScgPfvN8i2K6Udk4YLP8py3aDIc1owrxpYinGtRqwlG8ZK/mejWuoGjYno42D6N8qlkmwWyeW5DgpzdSdLA0FSU5PnJrVv0sDkgGlXUnGUk76rtArduVwCik20rXAoEbsm3yA+XN80wWR5Tjc7zKsqWEy/D1MViKj/gU6cXKT+ZJgfzDdJe089tekXafbGrJynnmb4vMZt8XKrWlNv1yA/oK6iew9Xo+6o3Rhs5iMJLB4pZJDHYmk0lJVcTOeImn571Xfz3A76AARuzWj9KAkVFNqL0VlbkvZyArvyYFAjvZ2V3yAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQ1JXklvNcOT466/fgBqjJSV0/cBQAEtrcCgAAAAAAAAAAAAAAAAAAAAAAAAAAAARpNNNXT4oAk1bxr2Wt1qwJvNfjR7XpqBbq9r6rkBQIlYCgAAAAAAAAAAAAAAAAAAAA2cZhMNj8JXwGNoQrYfE05UatOavGcJK0otdjTaA/n7+EE6sGP6tvTnmNHA4KpHZXaWpUzHJa1vEjCUvHo38qMr8lo1xAzu+CU62lLbbYqfV+26z+M8/2ejKpkksTUXdMVgEl+xptpydN3VrN7ttdAPRwABpkrq64rVAIyu2nxT7Laff7ANQAABj/wBfTpFh0X9UrpFz9VJwr4vKZ5Nh3Fre7pi/2unrxsqkn81/OB/P30b7KYvb3pB2d2NwmGqYqvnma4XARpw3t6bq1ow5Jv8AhAf085TluHyfKsHlGEio0MDh6eGpJKyUIRUUrctEgPrAAbcW3VlroklZ/avvy8wG4AAAAIkkkkrJcEBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEaTs2uHADTFSjZPxr8X7gNUZKS3ou6YFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpcU4OC8VWsraW9AF8aztZ9i4AE+OlrfSAjJSW9F6AUAAAAAAAAAAAAAAAAAAAOgeuv1YMq60/Qtj9jXuUM/y6XfHI8W1rTxUIv8AY2/Jmm4v0p8gPAvLcx6Rerz0s0swwscVkW1uxuZtqNanKEqdanKzjKLs3GSumucZPtA9/Op91ptkutV0V4Xa/J6tHDZ3gYww+eZUqu9UwWItzvq4Ss3GVldehgd7AANEotu8dHwf6vT6POwNSaaTTunwYBPjpa30gUDzd+Gt6S5ZL0V7DdF2ExTjV2kzavmeJhHnQwlOMUpeZzxCa88AMNvgrejSPSD1vtncwxdCrPBbJYTFZ7VcYXj3SEVTpKT4Jd0rRf8Aq2A96wAADbp+Om34yk96LfZyA3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACJJXaXHiBpjvRspXbk3qtUvv9+QGpNPVO4FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjSdm1w4AGrgRKS0bvx1+fRAVPWzTXEAmndJ8OIFAAAAAAAAAAAAAAAAefPwoPUbh0v7OVunjo0wShtfs/hpTzfB04aZpgoRbc0lr3amlx/hRuuKTA8t+rJ1jdu+rB0pYDpB2MrznTVSFDNstlJ9yzHB76dShNcna+7LjGVnw3osP6HuiTpQ2W6aejvIek/YzFqvk+fYSOKoKS8elJ6Spz7JRd4tcboDmAACJWvq3d315ARaybfFaLT0AV35IDxO+GV2uxWddZ7K9l3Ubwuz2zWGhCO7bdqVqlSpPXzp0/o8wHcfwIOxtBYbpO6QZqcqzngcnptrxYRtOrNJ9re5f9GIHqeAAkrqL3eNtANKs1Bz/GWiv28/1gawAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0yhvJ68Vaz1T+YA52fjKys22+VgNQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaVFR4fP5/SAbko8N6XqAt9bAE00mndPgwKAAAAAAAAAAANM4QqQlTqQUoSTjKMldNPimgPCr4Uvqz5d0EdOVPazZbDLD7ObeqtmGGw8IJU8LiYOPd6UbKyi5SUknr4z5LQO/vgV+mjHfGNs+g3NMQ5YGlQhn+XOrV0oy3+514RvwUt6nLdXNSemtw9U/juDtf43Rtpr3RcwJ8dwf+l0f/ALiAksXgZRcZYui01Z/si9oCOOwk3piqStrbfXZ9+AGt4nDJpPEU7vgt9agfz4fCObQ4jaLrm9JNWriJVaOCzClgcPrdRhSw9OLS828pAel/wPWzeDynqo1c8oUYxrZ5tFjatWcYpb/ctyjG9uOkPPx48kGcoADbrWcHFrSV4u3G1uXaBrV9bv0AUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEaTTTV0+KAjUknuPWzsnwuAlJRaT58+SA1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAm6tdLXd3bQBbW9/mAR3reNb0rmBN5Levoo63fCwGoAAAAAAAAB51fDVbI5tm3QjsZtbgMtqV8LkOe1aWNrwjvfF4YiklFy7IudKKvwu4rmgPHTBY3F4GpOrgsTXoVZRcd6jUcHu8Xqnw0WgH1LaLaF2tn+YXbtb41NfrAstos/co2z3Mop83iqmvK/H28wC2jz+y389zG2uqxc73tpz4X/AFgSO0W0V1J57mG6mk28VUt89mAe0W0G6nHPsy0/Gvi58deGvYB8NarUrVXWxU51KspN1HKTc5O+rbfP2Ae/vwZWyeb7H9TTYbA5zg6+GrY143MYwrx3Z9zrYmc4Pd5Jxaa7VZ8wMpwAG3VtaN3rvK1uN/N9+FwNavzQFAAAAAAAAAAAAAAAAAAAAAAiad0nw4gLa3v8wFAAAAACK/NAUAAAAAAACN2Tb5AUAAAjSaaaunxQBKwFAAAJrfjoBQAAAAAAAIndJtW8wFAAAAAAAAAAJonrLjokBQAAAAAjvpZekCgAAAAAAAAAETuk1zAoE3Vrpa7u7aAUAAAAR35MCgAPkzXKcqz3LsRk+d5bhcwwGLpuliMLiqMatGtB8YzhJOMk+xoDrV9U/qsyblLq1dFbb1bexuXf8EA+qf1WZNyl1auitt6tvY3Lv+CA/wAE7qsf9Wnoq/8AJuXf8EB/gndVj/q09FX/AJNy7/ggR9U/qspNrq0dFT83gbl3/BAv+Cd1WP8Aq09FX/k3Lv8Agga8P1VurBhK9PFYXq4dF1GtRmqlOpT2Py6MoSTupJqjdNPVNAdoU6dOlTjSpQjCEEoxjFWSS4JLkBqAARpOza4cAKAAAS2t7/MBQImnqncCgAAACK+t16AKAAAAAAAAAltb3+YCgAAACN2TaV/MBQAAAAAAAAEtrcCgAAEV7K6s+YFAAAAAAAAARtLVuwBpPRq4FAjvpZ+kCgAAAAAAARu1vOBQAAABGr87AUAAAAAAETuk2reYCgAAAAAAltbgUAAAjvZ2V3yAoAAAAAAAAABLK97armAur2vq+QFAivrd+gCgAAAAAAAAIncCgAAEStzuBQAAAAAARPjpa30gUAAAAAAAAAAAS6va+r5AUCW1uBQAAABE7gUAAAASyve2r5gUCJ8dLW+kCgAAAAAAjvZ2V3yAoAAAAAAAACK9ld3fMCgAAAAAAARrhra30gUAAAAAAAABHZvdvqrPRgUAAAAAI3YCgAAEsr3tq+YFAARvhpe/0AUAAAAAAACK9ldWfMCgAAAAAAjvZ2dnyAoAAAAAAAACJcdb3+gCgAAAAAAAAIlYBZXvbV8wKAAAAAAAAAAAAAAAAAAAAABLq9r6rkBQI3YCgAI3w0vf6AKAAARXsrqz5gUABHezs7PkBQAAABEuOt7/AEAUAAAARKwFAAAAEsr3tquYFAAAAAAAAAAAAAAAAAAAAAAAAJdXtfVcgKBL62AoACJ35WAoACK+t16AKAAjvZ2dnyAoAAAAiVkk3fzgUAAAjV7eYCgAAACNJ6NXAoAAAAAAAAAAAAAAAAAAAAAACO9nZ2fICLeVrq7fHsWgF0iufH08QFle9tVzAXV7X1XICgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEd7Ozs+QESem8724O/HTmBdJLxo8+YC+tgKBLq9r6rkBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEsr3tquYFAARKwFAARLjre/0AUABHezs7PkBQAAABFeyurPmBQAACN8NL3+gCgAAACN2AoAAAAAS6va+q5AUAAAAAAAAAAAAAAAAAAAAAAAAjSejVwKAAjV7eYCgAAESskm7+cCgAI72dnZ8gKAAAAIr63XoAoAAAAid+VgKAAAAJfWwFAAAAACPdT3nZXsr/AGAUAAAAAI1cCgAAAAAAjXDW1vpAoAAAAAAAEV7K7u+YFAAAAAABHezsrvkBQAAAAAAAAET46Wt9IFAAAAAAAAARO4FAAAAAABLK97armBQJdXtfV8gKAAAAIlYCgAAAAAAiXHW9/oAoAAAAAAI72dnZ8gKAAAAAAAAAivZXVnzAoAAAAAAAEb4aXv8AQBQAAAAAARXsrqz5gUAAAAAAAAAAARuybSv5gFle9tXzAoAAAAAAAAABLa3AoETvfzAUAAAAAAAABErc7gUAAAiaeqdwKAAAAAACK+t36AKAAAAAAAAAAAI72dld8gKAAAAAAAAAAAAEsr3tq+YBO6Tat5gKAAAAAAAAAjVwKAAjdrecCgAAAAAAARrhra30gUAAAARtLVuwFAAAAAAAAAAAAAAAltbgUCJ3SbVvMBQAAAAAAAAAAAAltb3+YCgAI3ZNvkBQAAAAAAAAAAAAivzYFAAAAETTuk+HECgAAAAAAAAJZXvbVcwCvrdegCgAAAAAAAAAAAAAltbgUCN2TaV/MBQAAAAAAAAAAAAjV+dgKAAAAIndJrmBQAAAAAAAAACO+ln6QKAAAAAEaTs2uHACgAAAAAAAAAEbSTbdkuLAoEd+SAoAAAAjVwKAAAAAAAAAAAAAABG+Gl7/AEAUAAAltb3+YCgAAAAAAAAAAAAAAAAETuk1zAoE1vx0AoAAAAARJLRKwFAAAAAAAAAAAEbSTbdkuLAoEV+aAoAABLa3AoAAAAAAAAAAAAAAACJ8dLW+kCgAJbW9/mAoAAAAARtKyb48AKAAAAAAAAAAAAEStzuBQAACX1tb5wKAAAAAAAAAAAAAAAAiSSSSslwQFAmt+OgFAAAAACJ3AoAAAAAAAAAAAARq9vMBQAACa34aAUAAAAAAETTuk+HECgAAAAAAAAAEavzsBQAAABG7crgUAAAAAAAAAAAAAACJJXaXHiBQAE1vx0AoAAAAAf/Z`;function zb(e=``,t=2){if(!e)return e;let n=new DOMParser().parseFromString(e,`text/html`);return n.body.querySelectorAll(`[data-heading]`).forEach(e=>{let r=e.getAttribute(`data-heading`)||``,i=parseInt(r.replace(`heading`,``),10);if(!Number.isFinite(i))return;let a=Math.min(6,Math.max(1,t+i-1)),o=n.createElement(`h${a}`);o.setAttribute(`data-heading`,r),Array.from(e.attributes).forEach(e=>{e.name!==`data-heading`&&o.setAttribute(e.name,e.value)}),o.innerHTML=e.innerHTML,e.replaceWith(o)}),n.body.innerHTML}function Bb(e){let{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:x_(n,r),{props:s,internalRef:c}=w_({...a,externalSlotProps:o}),l=a_(c,o?.ref,e.additionalProps?.ref);return b_(t,{...s,ref:l},r)}var Vb=W.createContext({});function Hb(e){return Qr(`MuiList`,e)}$r(`MuiList`,[`root`,`padding`,`dense`,`subheader`]),M();var Ub=e=>{let{classes:t,disablePadding:n,dense:r,subheader:i}=e;return ba({root:[`root`,!n&&`padding`,r&&`dense`,i&&`subheader`]},Hb,t)},Wb=J(`ul`,{name:`MuiList`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:`none`,margin:0,padding:0,position:`relative`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),Gb=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiList`}),{children:r,className:i,component:a=`ul`,dense:o=!1,disablePadding:s=!1,subheader:c,...l}=n,u=W.useMemo(()=>({dense:o}),[o]),d={...n,component:a,dense:o,disablePadding:s},f=Ub(d);return(0,G.jsx)(Vb.Provider,{value:u,children:(0,G.jsxs)(Wb,{as:a,className:K(f.root,i),ref:t,ownerState:d,...l,children:[c,r]})})}),Kb=l_;M();function qb(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Jb(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function Yb(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(``))}function Xb(e,t,n,r,i,a){let o=!1,s=i(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(o)return!1;o=!0}let t=r?!1:s.disabled||s.getAttribute(`aria-disabled`)===`true`;if(!s.hasAttribute(`tabindex`)||!Yb(s,a)||t)s=i(e,s,n);else return s.focus(),!0}return!1}var Zb=W.forwardRef(function(e,t){let{actions:n,autoFocus:r=!1,autoFocusItem:i=!1,children:a,className:o,disabledItemsFocusable:s=!1,disableListWrap:c=!1,onKeyDown:l,variant:u=`selectedMenu`,...d}=e,f=W.useRef(null),p=W.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});z_(()=>{r&&f.current.focus()},[r]),W.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{let n=!f.current.style.width;if(e.clientHeight<f.current.clientHeight&&n){let n=`${Kb(Cg(e))}px`;f.current.style[t===`rtl`?`paddingLeft`:`paddingRight`]=n,f.current.style.width=`calc(100% + ${n})`}return f.current}}),[]);let m=e=>{let t=f.current,n=e.key;if(e.ctrlKey||e.metaKey||e.altKey){l&&l(e);return}let r=h_(xg(t));if(n===`ArrowDown`)e.preventDefault(),Xb(t,r,c,s,qb);else if(n===`ArrowUp`)e.preventDefault(),Xb(t,r,c,s,Jb);else if(n===`Home`)e.preventDefault(),Xb(t,null,c,s,qb);else if(n===`End`)e.preventDefault(),Xb(t,null,c,s,Jb);else if(n.length===1){let i=p.current,a=n.toLowerCase(),o=performance.now();i.keys.length>0&&(o-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&a!==i.keys[0]&&(i.repeating=!1)),i.lastTime=o,i.keys.push(a);let c=r&&!i.repeating&&Yb(r,i);i.previousKeyMatched&&(c||Xb(t,r,!1,s,qb,i))?e.preventDefault():i.previousKeyMatched=!1}l&&l(e)},h=o_(f,t),g=-1;W.Children.forEach(a,(e,t)=>{if(!W.isValidElement(e)){g===t&&(g+=1,g>=a.length&&(g=-1));return}e.props.disabled||(u===`selectedMenu`&&e.props.selected||g===-1)&&(g=t),g===t&&(e.props.disabled||e.props.muiSkipListHighlight||e.type.muiSkipListHighlight)&&(g+=1,g>=a.length&&(g=-1))});let _=W.Children.map(a,(e,t)=>{if(t===g){let t={};return i&&(t.autoFocus=!0),e.props.tabIndex===void 0&&u===`selectedMenu`&&(t.tabIndex=0),W.cloneElement(e,t)}return e});return(0,G.jsx)(Gb,{role:`menu`,ref:h,className:o,onKeyDown:m,tabIndex:r?0:-1,...d,children:_})});function Qb(e){return Qr(`MuiMenu`,e)}$r(`MuiMenu`,[`root`,`paper`,`list`]),M();var $b={vertical:`top`,horizontal:`right`},ex={vertical:`top`,horizontal:`left`},tx=e=>{let{classes:t}=e;return ba({root:[`root`],paper:[`paper`],list:[`list`]},Qb,t)},nx=J(Q_,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiMenu`,slot:`Root`})({}),$te=J(Z_,{name:`MuiMenu`,slot:`Paper`})({maxHeight:`calc(100% - 96px)`,WebkitOverflowScrolling:`touch`}),ene=J(Zb,{name:`MuiMenu`,slot:`List`})({outline:0}),rx=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiMenu`}),{autoFocus:r=!0,children:i,className:a,disableAutoFocusItem:o=!1,MenuListProps:s={},onClose:c,open:l,PaperProps:u={},PopoverClasses:d,transitionDuration:f=`auto`,TransitionProps:{onEntering:p,...m}={},variant:h=`selectedMenu`,slots:g={},slotProps:_={},...v}=n,y=zi(),b={...n,autoFocus:r,disableAutoFocusItem:o,MenuListProps:s,onEntering:p,PaperProps:u,transitionDuration:f,TransitionProps:m,variant:h},x=tx(b),S=r&&!o&&l,C=W.useRef(null),w=(e,t)=>{C.current&&C.current.adjustStyleForScrollbar(e,{direction:y?`rtl`:`ltr`}),p&&p(e,t)},T=e=>{e.key===`Tab`&&(e.preventDefault(),c&&c(e,`tabKeyDown`))},E=-1;W.Children.map(i,(e,t)=>{W.isValidElement(e)&&(e.props.disabled||(h===`selectedMenu`&&e.props.selected||E===-1)&&(E=t))});let D={slots:g,slotProps:{list:s,transition:m,paper:u,..._}},O=Bb({elementType:g.root,externalSlotProps:_.root,ownerState:b,className:[x.root,a]}),[k,A]=T_(`paper`,{className:x.paper,elementType:$te,externalForwardedProps:D,shouldForwardComponentProp:!0,ownerState:b}),[j,M]=T_(`list`,{className:K(x.list,s.className),elementType:ene,shouldForwardComponentProp:!0,externalForwardedProps:D,getSlotProps:e=>({...e,onKeyDown:t=>{T(t),e.onKeyDown?.(t)}}),ownerState:b}),N=typeof D.slotProps.transition==`function`?D.slotProps.transition(b):D.slotProps.transition;return(0,G.jsx)(nx,{onClose:c,anchorOrigin:{vertical:`bottom`,horizontal:y?`right`:`left`},transformOrigin:y?$b:ex,slots:{root:g.root,paper:k,backdrop:g.backdrop,...g.transition&&{transition:g.transition}},slotProps:{root:O,paper:A,backdrop:typeof _.backdrop==`function`?_.backdrop(b):_.backdrop,transition:{...N,onEntering:(...e)=>{w(...e),N?.onEntering?.(...e)}}},open:l,ref:t,transitionDuration:f,ownerState:b,...v,classes:d,children:(0,G.jsx)(j,{actions:C,autoFocus:r&&(E===-1||o),autoFocusItem:S,variant:h,...M,children:i})})}),tne=({slotProps:e,...t})=>(0,G.jsx)(rx,{...t,disableScrollLock:!0,hideBackdrop:!0,slotProps:{...e,root:{...e?.root,style:{backgroundColor:`transparent`,pointerEvents:`none`,...e?.root?.style}},paper:{...e?.paper,style:{pointerEvents:`auto`,...e?.paper?.style}}}}),ix=c({Collapsible:()=>dy,EnableAudioAutoplayImage:()=>Rb,Feedback:()=>$v,HtmlAndMath:()=>rb,InlineMenu:()=>tne,InputContainer:()=>Eb,PreviewLayout:()=>nb,PreviewPrompt:()=>Ab,Purpose:()=>Mb,Readable:()=>jb,UiLayout:()=>eb,color:()=>tv,hasMedia:()=>Lb,hasText:()=>Fb,indicators:()=>ty,transformDataHeadings:()=>zb,withUndoReset:()=>Zy}),nne=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ax=s(((e,t)=>{t.exports=nne()}));function ox(e){this.content=e}ox.prototype={constructor:ox,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new ox(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new ox(n)},addToStart:function(e,t){return new ox([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new ox(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new ox(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=ox.from(e),e.size?new ox(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=ox.from(e),e.size?new ox(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=ox.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},ox.from=function(e){if(e instanceof ox)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ox(t)};function sx(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=sx(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function cx(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=cx(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var Z=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return sx(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return cx(this,e,t,n)}findIndex(e){if(e==0)return ux(0,e);if(e==this.size)return ux(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?ux(t+1,i):ux(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Z.empty=new Z([],0);var lx={index:0,offset:0};function ux(e,t){return lx.index=e,lx.offset=t,lx}function dx(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!dx(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!dx(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var fx=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&dx(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};fx.none=[];var px=class extends Error{},Q=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=hx(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(mx(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Z.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};Q.empty=new Q(Z.empty,0,0);function mx(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(mx(a.content,t-i-1,n-i-1)))}function hx(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=hx(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function rne(e,t,n){if(n.openStart>e.depth)throw new px(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new px(`Inconsistent open depths`);return gx(e,t,n,0)}function gx(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=gx(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return xx(a,Cx(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return xx(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=ine(n,e);return xx(a,Sx(e,i,o,t,r))}}function _x(e,t){if(!t.type.compatibleContent(e.type))throw new px(`Cannot join `+t.type.name+` onto `+e.type.name)}function vx(e,t,n){let r=e.node(n);return _x(r,t.node(n)),r}function yx(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function bx(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(yx(e.nodeAfter,r),a++));for(let e=a;e<o;e++)yx(i.child(e),r);t&&t.depth==n&&t.textOffset&&yx(t.nodeBefore,r)}function xx(e,t){return e.type.checkContent(t),e.copy(t)}function Sx(e,t,n,r,i){let a=e.depth>i&&vx(e,t,i+1),o=r.depth>i&&vx(n,r,i+1),s=[];return bx(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(_x(a,o),yx(xx(a,Sx(e,t,n,r,i+1)),s)):(a&&yx(xx(a,Cx(e,t,i+1)),s),bx(t,n,i,s),o&&yx(xx(o,Cx(n,r,i+1)),s)),bx(r,null,i,s),new Z(s)}function Cx(e,t,n){let r=[];return bx(null,e,n,r),e.depth>n&&yx(xx(vx(e,t,n+1),Cx(e,t,n+1)),r),bx(t,null,n,r),new Z(r)}function ine(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Z.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var wx=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return fx.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ex(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Tx.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Tx.set(t,r=new ane);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%one,i}},ane=class{constructor(){this.elts=[],this.i=0}},one=12,Tx=new WeakMap,Ex=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},sne=Object.create(null),Dx=class e{constructor(e,t,n,r=fx.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&dx(this.attrs,t||e.defaultAttrs||sne)&&fx.sameSet(this.marks,n||fx.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Q.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new Q(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return rne(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return wx.resolveCached(this,e)}resolveNoCache(e){return wx.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),kx(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Z.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=fx.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!fx.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Z.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Dx.prototype.text=void 0;var Ox=class e extends Dx{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):kx(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function kx(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Ax=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new jx(t,n);if(r.next==null)return e.empty;let i=Mx(r);r.next&&r.err(`Unexpected trailing text`);let a=Hx(zx(i));return Ux(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Z.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
149
- `)}};Ax.empty=new Ax(!0);var jx=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Mx(e){let t=[];do t.push(Nx(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Nx(e){let t=[];do t.push(Px(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Px(e){let t=Rx(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Ix(e,t);else break;return t}function Fx(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Ix(e,t){let n=Fx(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Fx(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Lx(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Rx(e){if(e.eat(`(`)){let t=Mx(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Lx(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function zx(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Bx(e,t){return t-e}function Vx(e,t){let n=[];return r(t),n.sort(Bx);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Hx(e){let t=Object.create(null);return n(Vx(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Vx(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Ax(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Bx);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Ux(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Wx(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Gx(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Kx(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function qx(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Xx(e,r,t[r]);return n}var Jx=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=qx(e,n.attrs),this.defaultAttrs=Wx(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ax.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Gx(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Dx(this,this.computeAttrs(e),Z.from(t),fx.setFrom(n))}createChecked(e=null,t,n){return t=Z.from(t),this.checkContent(t),new Dx(this,this.computeAttrs(e),t,fx.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=Z.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(Z.empty,!0);return i?new Dx(this,e,t.append(i),fx.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Kx(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:fx.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Yx(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Xx=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Yx(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Zx=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=qx(e,r.attrs),this.excluded=null;let i=Wx(this.attrs);this.instance=i?new fx(this,i):null}create(e=null){return!e&&this.instance?this.instance:new fx(this,Gx(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Kx(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Qx=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=ox.from(e.nodes),t.marks=ox.from(e.marks||{}),this.nodes=Jx.compile(this.spec.nodes,this),this.marks=Zx.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Ax.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?$x(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:$x(this,n.split(` `))}this.nodeFromJSON=e=>Dx.fromJSON(this,e),this.markFromJSON=e=>fx.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Jx))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ox(n,n.defaultAttrs,e,fx.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function $x(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function eS(e){return e.tag!=null}function tS(e){return e.style!=null}var nS=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(eS(e))this.tags.push(e);else if(tS(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new dS(this,t,!1);return n.addAll(e,fx.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new dS(this,t,!0);return n.addAll(e,fx.none,t.from,t.to),Q.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(pS(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=mS(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=mS(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},rS={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},iS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},aS={ol:!0,ul:!0},oS=1,sS=2,cS=4;function lS(e,t,n){return t==null?e&&e.whitespace==`pre`?oS|sS:n&~cS:(t?oS:0)|(t===`full`?sS:0)}var uS=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=fx.none,this.match=i||(a&cS?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Z.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&oS)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=Z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Z.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!rS.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},dS=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=lS(null,t.preserveWhitespace,0)|(n?cS:0);i=r?new uS(r.type,r.attrs,fx.none,!0,t.topMatch||r.type.contentMatch,a):n?new uS(null,null,fx.none,!0,null,a):new uS(e.schema.topNodeType,null,fx.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&sS?`full`:this.localPreserveWS||(r.options&oS)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
150
- `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;aS.hasOwnProperty(a)&&this.parser.normalizeLists&&fS(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:iS.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(rS.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
151
- `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=fx.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):hS(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=lS(e,i,a.options);a.options&cS&&a.content.length==0&&(o|=cS);let s=fx.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):hS(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new uS(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=oS);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function fS(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&aS.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function pS(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function mS(e){let t={};for(let n in e)t[n]=e[n];return t}function hS(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var gS=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=vS(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=SS(vS(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&SS(vS(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return SS(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=_S(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return _S(e.marks)}};function _S(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function vS(e){return e.document||window.document}var yS=new WeakMap;function bS(e){let t=yS.get(e);return t===void 0&&yS.set(e,t=xS(e)),t}function xS(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function SS(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=bS(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=SS(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var CS=65535,wS=2**16;function TS(e,t){return e+t*wS}function ES(e){return e&CS}function DS(e){return(e-(e&CS))/wS}var OS=1,kS=2,AS=4,jS=8,MS=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&jS)>0}get deletedBefore(){return(this.delInfo&(OS|AS))>0}get deletedAfter(){return(this.delInfo&(kS|AS))>0}get deletedAcross(){return(this.delInfo&AS)>0}},NS=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=ES(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+DS(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:TS(o/3,e-s),f=e==s?kS:e==u?OS:AS;return(t<0?e!=s:e!=u)&&(f|=jS),new MS(a,f,d)}r+=l-c}return n?e+r:new MS(e+r,0,null)}touches(e,t){let n=0,r=ES(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};NS.empty=new NS([]);var PS=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new MS(e,r,null)}},FS=Object.create(null),IS=class{getMap(){return NS.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=FS[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in FS)throw RangeError(`Duplicate use of step JSON ID `+e);return FS[e]=t,t.prototype.jsonID=e,t}},LS=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof px)return e.fail(t.message);throw t}}};function RS(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(RS(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return Z.fromArray(r)}var zS=class e extends IS{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new Q(RS(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return LS.fromReplace(e,this.from,this.to,i)}invert(){return new BS(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};IS.jsonID(`addMark`,zS);var BS=class e extends IS{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Q(RS(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return LS.fromReplace(e,this.from,this.to,n)}invert(){return new zS(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};IS.jsonID(`removeMark`,BS);var VS=class e extends IS{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return LS.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return LS.fromReplace(e,this.pos,this.pos+1,new Q(Z.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new HS(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};IS.jsonID(`addNodeMark`,VS);var HS=class e extends IS{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return LS.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return LS.fromReplace(e,this.pos,this.pos+1,new Q(Z.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new VS(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};IS.jsonID(`removeNodeMark`,HS);var US=class e extends IS{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&GS(e,this.from,this.to)?LS.fail(`Structure replace would overwrite content`):LS.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new NS([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Q.empty:new Q(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Q.empty:new Q(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,Q.fromJSON(t,n.slice),!!n.structure)}};US.MAP_BIAS=1,IS.jsonID(`replace`,US);var WS=class e extends IS{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(GS(e,this.from,this.gapFrom)||GS(e,this.gapTo,this.to)))return LS.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return LS.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?LS.fromReplace(e,this.from,this.to,n):LS.fail(`Content does not fit in gap`)}getMap(){return new NS([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,Q.fromJSON(t,n.slice),n.insert,!!n.structure)}};IS.jsonID(`replaceAround`,WS);function GS(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function KS(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new BS(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new zS(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function qS(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof Zx){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new BS(t.from,t.to,t.style)))}function JS(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new US(s,l,Q.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new BS(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new Q(Z.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new US(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(Z.empty,!0);e.replace(s,s,new Q(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function YS(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function XS(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!YS(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function ZS(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=Z.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=Z.from(r.node(e).copy(u)),d++):c--;let f=Z.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=Z.from(i.node(e).copy(f)),p++):l++;e.step(new WS(c,l,o,s,new Q(u.append(f),d,p),u.size-d,!0))}function QS(e,t,n=null,r=e){let i=eC(e,t),a=i&&tC(r,t);return a?i.map($S).concat({type:t,attrs:n}).concat(a.map($S)):null}function $S(e){return{type:e,attrs:null}}function eC(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function tC(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function nC(e,t,n){let r=Z.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=Z.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new WS(i,a,i,a,new Q(r,0,0),n.length,!0))}function rC(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&oC(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&aC(e,t,n,a),JS(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new WS(c,l,c+1,l-1,new Q(Z.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&iC(e,t,n,a),!1}})}function iC(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function aC(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
152
- `))}})}function oC(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function sC(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new WS(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new Q(Z.from(o),0,0),1,!0))}function cC(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function lC(e,t,n=1,r){let i=e.doc.resolve(t),a=Z.empty,o=Z.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=Z.from(i.node(e).copy(a));let t=r&&r[s];o=Z.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new US(t,t,new Q(a.append(o),n,n),!0))}function uC(e,t){let n=e.resolve(t),r=n.index();return fC(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function dC(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function fC(e,t){return!!(e&&t&&!e.isLeaf&&dC(e,t))}function pC(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&fC(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function mC(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);aC(e,r.node(),r.before(),s)}o.inlineContent&&JS(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new US(l,c.map(t+n,-1),Q.empty,!0)),r===!0){let t=e.doc.resolve(l);iC(e,t.node(),t.before(),e.steps.length)}return e}function hC(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function gC(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function _C(e,t,n=t,r=Q.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return vC(i,a,r)?new US(t,n,r):new yC(i,a,r).fit()}function vC(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var yC=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Z.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=Z.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new Q(i,a,o);return e>-1?new WS(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new US(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=SC(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(Z.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=SC(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new Q(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=SC(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new Q(bC(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new Q(bC(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(CC(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=xC(this.placed,t,Z.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?Q.empty:new Q(bC(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new Q(bC(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!wC(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=wC(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=wC(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=xC(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=xC(this.placed,this.depth,Z.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Z.empty,!0);e.childCount&&(this.placed=xC(this.placed,this.frontier.length,e))}};function bC(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(bC(e.firstChild.content,t-1,n)))}function xC(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(xC(e.lastChild.content,t-1,n)))}function SC(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function CC(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,CC(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Z.empty,!0)))),e.copy(r)}function wC(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!TC(n,a.content,o)?s:null}function TC(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function EC(e){return e.spec.defining||e.spec.definingForContent}function DC(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(vC(i,a,r))return e.step(new US(t,n,r));let o=jC(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=EC(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new Q(OC(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function OC(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(OC(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Z.empty,!0))}return e}function kC(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=hC(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new Q(Z.from(r),0,0))}function AC(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=jC(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function jC(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var MC=class e extends IS{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return LS.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return LS.fromReplace(e,this.pos,this.pos+1,new Q(Z.from(r),0,+!t.isLeaf))}getMap(){return NS.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};IS.jsonID(`attr`,MC);var NC=class e extends IS{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return LS.ok(n)}getMap(){return NS.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};IS.jsonID(`docAttr`,NC);var PC=class extends Error{};PC=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},PC.prototype=Object.create(Error.prototype),PC.prototype.constructor=PC,PC.prototype.name=`TransformError`;var FC=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new PS}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new PC(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Q.empty){let r=_C(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Q(Z.from(n),0,0))}delete(e,t){return this.replace(e,t,Q.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return DC(this,e,t,n),this}replaceRangeWith(e,t,n){return kC(this,e,t,n),this}deleteRange(e,t){return AC(this,e,t),this}lift(e,t){return ZS(this,e,t),this}join(e,t=1){return mC(this,e,t),this}wrap(e,t){return nC(this,e,t),this}setBlockType(e,t=e,n,r=null){return rC(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return sC(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new MC(e,t,n)),this}setDocAttribute(e,t){return this.step(new NC(e,t)),this}addNodeMark(e,t){return this.step(new VS(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof fx)t.isInSet(n.marks)&&this.step(new HS(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new HS(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return lC(this,e,t,n),this}addMark(e,t,n){return KS(this,e,t,n),this}removeMark(e,t,n){return qS(this,e,t,n),this}clearIncompatible(e,t,n){return JS(this,e,t,n),this}},IC=Object.create(null),LC=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new RC(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Q.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?Q.empty:t),o==0&&JC(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),JC(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new VC(e):qC(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?qC(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):qC(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new GC(e.node(0))}static atStart(e){return qC(e,e,0,0,1)||new GC(e)}static atEnd(e){return qC(e,e,e.content.size,e.childCount,-1)||new GC(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=IC[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in IC)throw RangeError(`Duplicate use of selection JSON ID `+e);return IC[e]=t,t.prototype.jsonID=e,t}getBookmark(){return VC.between(this.$anchor,this.$head).getBookmark()}};LC.prototype.visible=!0;var RC=class{constructor(e,t){this.$from=e,this.$to=t}},zC=!1;function BC(e){!zC&&!e.parent.inlineContent&&(zC=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var VC=class e extends LC{constructor(e,t=e){BC(e),BC(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return LC.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=Q.empty){if(super.replace(e,t),t==Q.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new HC(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=LC.findFrom(n,r,!0)||LC.findFrom(n,-r,!0);if(e)n=e.$head;else return LC.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(LC.findFrom(t,-r,!0)||LC.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};LC.jsonID(`text`,VC);var HC=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return VC.between(e.resolve(this.anchor),e.resolve(this.head))}},UC=class e extends LC{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?LC.near(a):new e(a)}content(){return new Q(Z.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new WC(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};UC.prototype.visible=!1,LC.jsonID(`node`,UC);var WC=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new HC(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&UC.isSelectable(n)?new UC(t):LC.near(t)}},GC=class e extends LC{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Q.empty){if(t==Q.empty){e.delete(0,e.doc.content.size);let t=LC.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return KC}};LC.jsonID(`all`,GC);var KC={map(){return this},resolve(e){return new GC(e)}};function qC(e,t,n,r,i,a=!1){if(t.inlineContent)return VC.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=qC(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&UC.isSelectable(r))return UC.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function JC(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof US||i instanceof WS))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(LC.near(e.doc.resolve(o),n))}var YC=1,XC=2,ZC=4,QC=class extends FC{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|YC)&~XC,this.storedMarks=null,this}get selectionSet(){return(this.updated&YC)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=XC,this}ensureMarks(e){return fx.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&XC)>0}addStep(e,t){super.addStep(e,t),this.updated&=~XC,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||fx.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(LC.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ZC,this}get scrolledIntoView(){return(this.updated&ZC)>0}};function $C(e,t){return!t||!e?e:e.bind(t)}var ew=class{constructor(e,t,n){this.name=e,this.init=$C(t.init,n),this.apply=$C(t.apply,n)}},tw=[new ew(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ew(`selection`,{init(e,t){return e.selection||LC.atStart(t.doc)},apply(e){return e.selection}}),new ew(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ew(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],nw=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=tw.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ew(e.key,e.spec.state,e))})}},rw=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new QC(this)}static create(t){let n=new nw(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new nw(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new nw(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Dx.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=LC.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function iw(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=iw(i,t,{})),n[r]=i}return n}var aw=class{constructor(e){this.spec=e,this.props={},e.props&&iw(e.props,this,this.props),this.key=e.key?e.key.key:sw(`plugin`)}getState(e){return e[this.key]}},ow=Object.create(null);function sw(e){return e in ow?e+`$`+ ++ow[e]:(ow[e]=0,e+`$`)}var cw=class{constructor(e=`key`){this.key=sw(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},lw=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},uw=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},dw=null,fw=function(e,t,n){let r=dw||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},pw=function(){dw=null},mw=function(e,t,n,r){return n&&(gw(e,t,n,r,-1)||gw(e,t,n,r,1))},hw=/^(img|br|input|textarea|hr)$/i;function gw(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:_w(e))){let n=e.parentNode;if(!n||n.nodeType!=1||xw(e)||hw.test(e.nodeName)||e.contentEditable==`false`)return!1;t=lw(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?_w(e):0}else return!1}}function _w(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vw(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=_w(e)}else if(e.parentNode&&!xw(e))t=lw(e),e=e.parentNode;else return null}}function yw(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!xw(e))t=lw(e)+1,e=e.parentNode;else return null}}function bw(e,t,n){for(let r=t==0,i=t==_w(e);r||i;){if(e==n)return!0;let t=lw(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==_w(e)}}function xw(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Sw=function(e){return e.focusNode&&mw(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Cw(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function ww(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Tw(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(_w(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(_w(r.startContainer),r.startOffset)}}}var Ew=typeof navigator<`u`?navigator:null,Dw=typeof document<`u`?document:null,Ow=Ew&&Ew.userAgent||``,kw=/Edge\/(\d+)/.exec(Ow),Aw=/MSIE \d/.exec(Ow),jw=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ow),Mw=!!(Aw||jw||kw),Nw=Aw?document.documentMode:jw?+jw[1]:kw?+kw[1]:0,Pw=!Mw&&/gecko\/(\d+)/i.test(Ow);Pw&&+(/Firefox\/(\d+)/.exec(Ow)||[0,0])[1];var Fw=!Mw&&/Chrome\/(\d+)/.exec(Ow),Iw=!!Fw,Lw=Fw?+Fw[1]:0,Rw=!Mw&&!!Ew&&/Apple Computer/.test(Ew.vendor),zw=Rw&&(/Mobile\/\w+/.test(Ow)||!!Ew&&Ew.maxTouchPoints>2),Bw=zw||(Ew?/Mac/.test(Ew.platform):!1),Vw=Ew?/Win/.test(Ew.platform):!1,Hw=/Android \d/.test(Ow),Uw=!!Dw&&`webkitFontSmoothing`in Dw.documentElement.style,cne=Uw?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function lne(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ww(e,t){return typeof e==`number`?e:e[t]}function une(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Gw(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=uw(o);continue}let e=o,n=e==a.body,s=n?lne(a):une(e),c=0,l=0;if(t.top<s.top+Ww(r,`top`)?l=-(s.top-t.top+Ww(i,`top`)):t.bottom>s.bottom-Ww(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Ww(i,`top`)-s.top:t.bottom-s.bottom+Ww(i,`bottom`)),t.left<s.left+Ww(r,`left`)?c=-(s.left-t.left+Ww(i,`left`)):t.right>s.right-Ww(r,`right`)&&(c=t.right-s.right+Ww(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:uw(o)}}function dne(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Kw(e.dom)}}function Kw(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=uw(r));return t}function fne({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;qw(n,r==0?0:r-t)}function qw(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Jw=null;function pne(e){if(e.setActive)return e.setActive();if(Jw)return e.focus(Jw);let t=Kw(e);e.focus(Jw==null?{get preventScroll(){return Jw={preventScroll:!0},!0}}:void 0),Jw||(Jw=!1,qw(t,0))}function Yw(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=fw(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?mne(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Yw(n,i)}function mne(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=$w(r,1);if(n.top!=n.bottom&&Xw(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Xw(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function hne(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function gne(e,t,n){let{node:r,offset:i}=Yw(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function _ne(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Zw(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Xw(t,i))return Zw(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function vne(e,t){let n=e.dom.ownerDocument,r,i=0,a=Tw(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Xw(t,n)||(o=Zw(e.dom,t,n),!o))return null}if(Rw)for(let e=o;r&&e;e=uw(e))e.draggable&&(r=void 0);if(o=hne(o,t),r){if(Pw&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Uw&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=_ne(e,r,i,t))}s??=gne(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Qw(e){return e.top<e.bottom||e.left<e.right}function $w(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Qw(e))return e}return Array.prototype.find.call(n,Qw)||e.getBoundingClientRect()}var yne=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function eT(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Uw||Pw;if(r.nodeType==3)if(o&&(yne.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=$w(fw(r,i,i),n);if(Pw&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=$w(fw(r,i-1,i-1),-1);if(t.top==e.top){let n=$w(fw(r,i,i+1),-1);if(n.top!=e.top)return tT(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,tT($w(fw(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==_w(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return nT(e.getBoundingClientRect(),!1)}if(a==null&&i<_w(r)){let e=r.childNodes[i];if(e.nodeType==1)return nT(e.getBoundingClientRect(),!0)}return nT(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==_w(r))){let e=r.childNodes[i-1],t=e.nodeType==3?fw(e,_w(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return tT($w(t,1),!1)}if(a==null&&i<_w(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?fw(e,0,+!o):e.nodeType==1?e:null:null;if(t)return tT($w(t,-1),!0)}return tT($w(r.nodeType==3?fw(r):r,-n),n>=0)}function tT(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function nT(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function rT(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function bne(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return rT(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=eT(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=fw(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var xne=/[\u0590-\u08ac]/;function Sne(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!xne.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:rT(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var iT=null,aT=null,oT=!1;function Cne(e,t,n){return iT==t&&aT==n?oT:(iT=t,aT=n,oT=n==`up`||n==`down`?bne(e,t,n):Sne(e,t,n))}var sT=0,cT=1,lT=2,uT=3,dT=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=sT,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>lw(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof _T){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof fT&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?lw(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?lw(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=lw(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=lw(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Pw||Rw)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
153
- `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:lw(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(Pw&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Rw)&&mw(o.node,o.offset,l.anchorNode,l.anchorOffset)&&mw(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Pw)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?lT:cT,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=uT:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?lT:uT}n=a}this.dirty=lT}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?lT:cT;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},fT=class extends dT{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==sT&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},wne=class extends dT{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},pT=class e extends dT{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=gS.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&uT||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=uT&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=sT){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=sT}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=MT(a,n,o,r)),t>0&&(a=MT(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},mT=class e extends dT{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=gS.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=CT(u,r,n),l?c=new Tne(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new gT(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Z.empty)}return e}matchesNode(e,t,n){return this.dirty==sT&&e.eq(this.node)&&wT(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new ET(this,a&&a.node,e);kT(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?fx.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==lT)&&(a&&this.protectLocalComposition(e,a),vT(this.contentDOM,this.children,e),zw&&AT(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof VC)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=jT(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new wne(this,i,t,r);e.input.compositionNodes.push(a),this.children=MT(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==uT||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=sT}updateOuterDeco(e){if(wT(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=ST(this.dom,this.nodeDOM,xT(this.outerDeco,this.node,t),xT(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function hT(e,t,n,r,i){CT(r,t,e);let a=new mT(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var gT=class e extends mT{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==uT||this.dirty!=sT&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=sT||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=sT,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=uT)}get domAtom(){return!1}isText(e){return this.node.text==e}},_T=class extends dT{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==sT&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Tne=class extends mT{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==uT)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function vT(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=TT(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof pT){let t=r?r.previousSibling:e.lastChild;vT(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=TT(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var yT=function(e){e&&(this.nodeName=e)};yT.prototype=Object.create(null);var bT=[new yT];function xT(e,t,n){if(e.length==0)return bT;let r=n?bT[0]:new yT,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new yT(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new yT(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function ST(e,t,n,r){if(n==bT&&r==bT)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=bT[0],i=t)}Ene(i,o||bT[0],a)}return i}function Ene(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function CT(e,t,n){return ST(e,e,bT,xT(t,n,e.nodeType!=1))}function wT(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function TT(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var ET=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=DT(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=sT,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=pT.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==uT&&a.dom==a.contentDOM&&(a.dirty=lT),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof mT){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=uT&&wT(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=lT,u.updateChildren(r,a+1),u.dirty=sT),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!wT(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=mT.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=mT.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new fT(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof pT;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof gT)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Rw||Iw)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new _T(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function DT(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof pT)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function OT(e,t){return e.type.side-t.type.side}function kT(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(OT);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function AT(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function jT(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function MT(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function NT(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Sw(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&UC.isSelectable(e)&&i.parent&&!(e.isInline&&bw(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new UC(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=WT(e,u,s,n)}return l}function PT(e){return e.editable?e.hasFocus():KT(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function FT(e,t=!1){let n=e.state.selection;if(HT(e,n),PT(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Iw){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&mw(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)VT(e);else{let{anchor:r,head:i}=n,a,o;IT&&!(n instanceof VC)&&(n.$from.parent.inlineContent||(a=LT(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=LT(e,n.to))),e.docView.setSelection(r,i,e,t),IT&&(a&&zT(a),o&&zT(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&BT(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var IT=Rw||Iw&&Lw<63;function LT(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Rw&&i&&i.contentEditable==`false`)return RT(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return RT(i);if(a)return RT(a)}}function RT(e){return e.contentEditable=`true`,Rw&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function zT(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function BT(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!PT(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function VT(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,lw(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Mw&&Nw<=11&&(n.disabled=!0,n.disabled=!1)}function HT(e,t){if(t instanceof UC){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(UT(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else UT(e)}function UT(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function WT(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||VC.between(t,n,r)}function GT(e){return e.editable&&!e.hasFocus()?!1:KT(e)}function KT(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function qT(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return mw(t.node,t.offset,n.anchorNode,n.anchorOffset)}function JT(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&LC.findFrom(a,t)}function YT(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function XT(e,t,n){let r=e.state.selection;if(r instanceof VC){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return YT(e,new VC(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=JT(e.state,t);return n&&n instanceof UC?YT(e,n):!1}else if(!(Bw&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?UC.isSelectable(i)?YT(e,new UC(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Uw?YT(e,new VC(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof UC&&r.node.isInline)return YT(e,new VC(t>0?r.$to:r.$from));else{let n=JT(e.state,t);return n?YT(e,n):!1}}function ZT(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function QT(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function $T(e,t){return t<0?eE(e):tE(e)}function eE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Pw&&n.nodeType==1&&r<ZT(n)&&QT(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(QT(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(nE(n))break;else{let t=n.previousSibling;for(;t&&QT(t,-1);)i=n.parentNode,a=lw(t),t=t.previousSibling;if(t)n=t,r=ZT(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?aE(e,n,r):i&&aE(e,i,a)}function tE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=ZT(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(QT(e,1))a=n,o=++r;else break}else if(nE(n))break;else{let t=n.nextSibling;for(;t&&QT(t,1);)a=t.parentNode,o=lw(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=ZT(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&aE(e,a,o)}function nE(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function rE(e,t){for(;e&&t==e.childNodes.length&&!xw(e);)t=lw(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function iE(e,t){for(;e&&!t&&!xw(e);)t=lw(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function aE(e,t,n){if(t.nodeType!=3){let e,r;(r=rE(t,n))?(t=r,n=0):(e=iE(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Sw(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&FT(e)},50)}function oE(e,t){let n=e.state.doc.resolve(t);if(!(Iw||Vw)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function sE(e,t,n){let r=e.state.selection;if(r instanceof VC&&!r.empty||n.indexOf(`s`)>-1||Bw&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=JT(e.state,t);if(n&&n instanceof UC)return YT(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof GC?LC.near(n,t):LC.findFrom(n,t);return o?YT(e,o):!1}return!1}function cE(e,t){if(!(e.state.selection instanceof VC))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function lE(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function uE(e){if(!Rw||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;lE(e,n,`true`),setTimeout(()=>lE(e,n,`false`),20)}return!1}function dE(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function fE(e,t){let n=t.keyCode,r=dE(t);if(n==8||Bw&&n==72&&r==`c`)return cE(e,-1)||$T(e,-1);if(n==46&&!t.shiftKey||Bw&&n==68&&r==`c`)return cE(e,1)||$T(e,1);if(n==13||n==27)return!0;if(n==37||Bw&&n==66&&r==`c`){let t=n==37?oE(e,e.state.selection.from)==`ltr`?-1:1:-1;return XT(e,t,r)||$T(e,t)}else if(n==39||Bw&&n==70&&r==`c`){let t=n==39?oE(e,e.state.selection.from)==`ltr`?1:-1:1;return XT(e,t,r)||$T(e,t)}else if(n==38||Bw&&n==80&&r==`c`)return sE(e,-1,r)||$T(e,-1);else if(n==40||Bw&&n==78&&r==`c`)return uE(e)||sE(e,1,r)||$T(e,1);else if(r==(Bw?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function pE(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||gS.fromSchema(e.state.schema),s=wE(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=SE[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
154
-
155
- `),slice:t}}function mE(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new Q(Z.from(e.state.schema.text(t.replace(/\r\n?/g,`
156
- `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=gS.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=DE(n),Uw&&OE(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||nS.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!hE.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=kE(xE(s,+u[1],+u[2]),u[4]);else if(s=Q.maxOpen(gE(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=xE(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var hE=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function gE(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&vE(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=yE(a[a.length-1],i.length));let n=_E(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return Z.from(a)}return e}function _E(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Z.from(e));return e}function vE(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=vE(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(Z.from(_E(n,e,i+1))))}}function yE(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,yE(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Z.empty,!0);return e.copy(n.append(r))}function bE(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=bE(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(Z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function xE(e,t,n){return t<e.openStart&&(e=new Q(bE(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Q(bE(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var SE={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},CE=null;function wE(){return CE||=document.implementation.createHTMLDocument(`title`)}var TE=null;function EE(e){let t=window.trustedTypes;return t?(TE||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),TE.createHTML(e)):e}function DE(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=wE().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&SE[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=EE(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function OE(e){let t=e.querySelectorAll(Iw?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function kE(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=Z.from(t.create(r[e+1],i)),a++,o++}return new Q(i,a,o)}var AE={},jE={},ME={touchstart:!0,touchmove:!0},NE=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function PE(e){for(let t in AE){let n=AE[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{zE(e,t)&&!RE(e,t)&&(e.editable||!(t.type in jE))&&n(e,t)},ME[t]?{passive:!0}:void 0)}Rw&&e.dom.addEventListener(`input`,()=>null),LE(e)}function FE(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function IE(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function LE(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>RE(e,t))})}function RE(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function zE(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function BE(e,t){!RE(e,t)&&AE[t.type]&&(e.editable||!(t.type in jE))&&AE[t.type](e,t)}jE.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!eD(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Hw&&Iw&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),zw&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Cw(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||fE(e,n)?n.preventDefault():FE(e,`key`)},jE.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},jE.keypress=(e,t)=>{let n=t;if(eD(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Bw&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof VC)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function VE(e){return{left:e.clientX,top:e.clientY}}function HE(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function UE(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function WE(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function GE(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&UC.isSelectable(r)?(WE(e,new UC(n),`pointer`),!0):!1}function KE(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof UC&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(UC.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(WE(e,UC.create(e.state.doc,i),`pointer`),!0)}function qE(e,t,n,r,i){return UE(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?KE(e,n):GE(e,n))}function JE(e,t,n,r){return UE(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function YE(e,t,n,r){return UE(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||XE(e,n,r)}function XE(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(WE(e,VC.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)WE(e,VC.create(r,a+1,a+1+n.content.size),`pointer`);else if(UC.isSelectable(n))WE(e,UC.create(r,a),`pointer`);else continue;return!0}}function ZE(e){return sD(e)}var QE=Bw?`metaKey`:`ctrlKey`;AE.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=ZE(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&HE(n,e.input.lastClick)&&!n[QE]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(VE(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new $E(e,o,n,!!r)):(a==`doubleClick`?JE:YE)(e,o.pos,o.inside,n)?n.preventDefault():FE(e,`pointer`))};var $E=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[QE],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof UC&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Pw&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),FE(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>FT(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(VE(e))),this.updateAllowDefault(e),this.allowDefault||!t?FE(this.view,`pointer`):qE(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Rw&&this.mightDrag&&!this.mightDrag.node.isAtom||Iw&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(WE(this.view,LC.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):FE(this.view,`pointer`)}move(e){this.updateAllowDefault(e),FE(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};AE.touchstart=e=>{e.input.lastTouch=Date.now(),ZE(e),FE(e,`pointer`)},AE.touchmove=e=>{e.input.lastTouch=Date.now(),FE(e,`pointer`)},AE.contextmenu=e=>ZE(e);function eD(e,t){return e.composing?!0:Rw&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var tD=Hw?5e3:-1;jE.compositionstart=jE.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof VC&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Iw&&Vw&&nD(e)))e.markCursor=e.state.storedMarks||n.marks(),sD(e,!0),e.markCursor=null;else if(sD(e,!t.selection.empty),Pw&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}rD(e,tD)};function nD(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}jE.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,rD(e,20))};function rD(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>sD(e),t))}function iD(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=oD());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function aD(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=vw(t.focusNode,t.focusOffset),r=yw(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function oD(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function sD(e,t=!1){if(!(Hw&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),iD(e),t||e.docView&&e.docView.dirty){let n=NT(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function cD(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var lD=Mw&&Nw<15||zw&&cne<604;AE.copy=jE.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=lD?null:n.clipboardData,{dom:o,text:s}=pE(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):cD(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function uD(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function dD(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?fD(e,r.value,null,i,t):fD(e,r.textContent,r.innerHTML,i,t)},50)}function fD(e,t,n,r,i){let a=mE(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||Q.empty)))return!0;if(!a)return!1;let o=uD(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function pD(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}jE.paste=(e,t)=>{let n=t;if(e.composing&&!Hw)return;let r=lD?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&fD(e,pD(r),r.getData(`text/html`),i,n)?n.preventDefault():dD(e,n)};var mD=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},hD=Bw?`altKey`:`ctrlKey`;function gD(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[hD]:!n}AE.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(VE(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof UC?i.to-1:i.to))){if(r&&r.mightDrag)o=UC.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=UC.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=pE(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Iw||Lw>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(lD?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,lD||n.dataTransfer.setData(`text/plain`,c),e.dragging=new mD(l,gD(e,n),o)},AE.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},jE.dragover=jE.dragenter=(e,t)=>t.preventDefault(),jE.drop=(e,t)=>{try{_D(e,t,e.dragging)}finally{e.dragging=null}};function _D(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(VE(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=mE(e,pD(t.dataTransfer),lD?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&gD(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||Q.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?gC(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&UC.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new UC(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(WT(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}AE.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&FT(e)},20))},AE.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},AE.beforeinput=(e,t)=>{if(Iw&&Hw&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Cw(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in jE)AE[e]=jE[e];function vD(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var yD=class e{constructor(e,t){this.toDOM=e,this.spec=t||wD,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new SD(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&vD(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},bD=class e{constructor(e,t){this.attrs=e,this.spec=t||wD}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new SD(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&vD(this.attrs,t.attrs)&&vD(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},xD=class e{constructor(e,t){this.attrs=e,this.spec=t||wD}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new SD(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&vD(this.attrs,t.attrs)&&vD(this.spec,t.spec)}destroy(){}},SD=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new yD(n,r))}static inline(t,n,r,i){return new e(t,n,new bD(r,i))}static node(t,n,r,i){return new e(t,n,new xD(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof bD}get widget(){return this.type instanceof yD}},CD=[],wD={},TD=class e{constructor(e,t){this.local=e.length?e:CD,this.children=t.length?t:CD}static create(e,t){return t.length?ND(t,e,0,wD):ED}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==ED||e.maps.length==0?this:this.mapInner(e,t,0,0,n||wD)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?OD(this.children,o||[],t,n,r,i,a):o?new e(o.sort(PD),CD):ED}add(t,n){return n.length?this==ED?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=jD(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,ND(s,e,o+1,wD)),a+=3}});let o=kD(a?MD(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(PD):this.local,i||this.children)}remove(e){return e.length==0||this==ED?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==ED?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):ED}forChild(t,n){if(this==ED)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof bD){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(PD),CD);return r?new DD([t,r]):t}return r||ED}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return FD(this.localsInner(e))}localsInner(e){if(this==ED)return CD;if(e.inlineContent||!this.local.some(bD.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof bD||t.push(this.local[e]);return t}forEachSet(e){e(this)}};TD.empty=new TD([],[]),TD.removeOverlap=FD;var ED=TD.empty,DD=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,wD));return e.from(r)}forChild(t,n){if(n.isLeaf)return TD.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=ED&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?FD(n?t:t.sort(PD)):CD}static from(t){switch(t.length){case 0:return ED;case 1:return t[0];default:return new e(t.every(e=>e instanceof TD)?t:t.reduce((e,t)=>e.concat(t instanceof TD?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function OD(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==ED?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=ND(AD(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new TD(t.sort(PD),s)}function kD(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new SD(i.from+t,i.to+t,i.type))}return n}function AD(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function jD(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function MD(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function ND(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=jD(e,t,o+n);if(s){a=!0;let e=ND(s,t,n+o+1,r);e!=ED&&i.push(o,o+t.nodeSize,e)}});let o=kD(a?MD(e):e,-n).sort(PD);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new TD(o,i):ED}function PD(e,t){return e.from-t.from||e.to-t.to}function FD(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),ID(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),ID(t,i,r.copy(a.from,r.to)));break}}}return t}function ID(e,t,n){for(;t<e.length&&PD(n,e[t])>0;)t++;e.splice(t,0,n)}function LD(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=ED&&t.push(r)}),e.cursorWrapper&&t.push(TD.create(e.state.doc,[e.cursorWrapper.deco])),DD.from(t)}var RD={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},zD=Mw&&Nw<=11,BD=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},VD=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new BD,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Mw&&Nw<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Rw&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),zD&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,RD)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(GT(this.view)){if(this.suppressingSelectionUpdates)return FT(this.view);if(Mw&&Nw<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&mw(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=uw(n))t.add(n);for(let r=e.anchorNode;r;r=uw(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&GT(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Pw&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||qD(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Sw(n)&&(c=NT(e))&&c.eq(LC.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,FT(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),WD(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,JD(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||FT(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Mw&&Nw<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?lw(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?lw(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},HD=new WeakMap,UD=!1;function WD(e){if(!HD.has(e)&&(HD.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Pw,UD)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),UD=!0}}function GD(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return mw(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function KD(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return GD(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?GD(e,n):null}function qD(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function JD(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function YD(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],Sw(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Iw&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||nS.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:XD,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function XD(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Rw&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Rw&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var ZD=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function QD(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=NT(e,t);if(n&&!e.state.selection.eq(n)){if(Iw&&Hw&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Cw(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=YD(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=rO(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(zw&&e.input.lastIOSEnter>Date.now()-225||Hw)&&i.some(e=>e.nodeType==1&&!ZD.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Cw(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof VC&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=$D(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof VC&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Mw&&Nw<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((zw&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,Cw(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&tO(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Cw(8,`Backspace`)))){Hw&&Iw&&e.domObserver.suppressSelectionUpdates();return}Iw&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Hw&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Cw(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=$D(e,n.doc,l.sel);t&&!(Iw&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Mw&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){Mw&&Nw<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>FT(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=eO(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function $D(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:WT(e,t.resolve(n.anchor),t.resolve(n.head))}function eO(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(Z.from(l).eq(e))return{mark:s,type:o}}function tO(e,t,n,r,i){if(n-t<=i.pos-r.pos||nO(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(nO(a,!0,!0));return!o.parent.isTextblock||o.pos>n||nO(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function nO(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function rO(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&iO(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&iO(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function iO(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var aO=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new NE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(fO),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=cO(this),sO(this),this.nodeViews=uO(this),this.docView=hT(this.state.doc,oO(this),LD(this),this.dom,this),this.domObserver=new VD(this,(e,t,n,r)=>QD(this,e,t,n,r)),this.domObserver.start(),PE(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&LE(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(fO),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(iD(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=uO(this);dO(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&LE(this),this.editable=cO(this),sO(this);let o=LD(this),s=oO(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&dne(this);if(i){this.domObserver.stop();let t=l&&(Mw||Iw)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&lO(n.selection,e.selection);if(l){let n=Iw?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=aD(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=hT(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&qT(this))?FT(this,t):(HT(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&fne(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof UC){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Gw(this,t.getBoundingClientRect(),e)}else Gw(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new mD(e.slice,e.move,r<0?void 0:UC.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Mw){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&pne(this.dom),FT(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return vne(this,e)}coordsAtPos(e,t=1){return eT(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Cne(this,t||this.state,e)}pasteHTML(e,t){return fD(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return fD(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return pE(this,e)}destroy(){this.docView&&(IE(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],LD(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,pw())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return BE(this,e)}domSelectionRange(){let e=this.domSelection();return e?Rw&&this.root.nodeType===11&&ww(this.dom.ownerDocument)==this.dom&&KD(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};aO.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function oO(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[SD.node(0,e.state.doc.content.size,t)]}function sO(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:SD.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function cO(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function lO(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function uO(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function dO(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function fO(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var pO={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},mO={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},hO=typeof navigator<`u`&&/Mac/.test(navigator.platform),gO=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_O=0;_O<10;_O++)pO[48+_O]=pO[96+_O]=String(_O);for(var _O=1;_O<=24;_O++)pO[_O+111]=`F`+_O;for(var _O=65;_O<=90;_O++)pO[_O]=String.fromCharCode(_O+32),mO[_O]=String.fromCharCode(_O);for(var vO in pO)mO.hasOwnProperty(vO)||(mO[vO]=pO[vO]);function yO(e){var t=!(hO&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||gO&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?mO:pO)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var bO=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),xO=typeof navigator<`u`&&/Win/.test(navigator.platform);function SO(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))bO?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function CO(e){let t=Object.create(null);for(let n in e)t[SO(n)]=e[n];return t}function wO(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function TO(e){return new aw({props:{handleKeyDown:EO(e)}})}function EO(e){let t=CO(e);return function(e,n){let r=yO(n),i,a=t[wO(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[wO(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(xO&&n.ctrlKey&&n.altKey)&&(i=pO[n.keyCode])&&i!=r){let r=t[wO(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var DO=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function OO(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var kO=(e,t,n)=>{let r=OO(e,n);if(!r)return!1;let i=FO(r);if(!i){let n=r.blockRange(),i=n&&XS(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if($O(e,i,t,-1))return!0;if(r.parent.content.size==0&&(NO(a,`end`)||UC.isSelectable(a)))for(let n=r.depth;;n--){let o=_C(e.doc,r.before(n),r.after(n),Q.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(NO(a,`end`)?LC.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):UC.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},AO=(e,t,n)=>{let r=OO(e,n);if(!r)return!1;let i=FO(r);return i?MO(e,i,t):!1},jO=(e,t,n)=>{let r=IO(e,n);if(!r)return!1;let i=zO(r);return i?MO(e,i,t):!1};function MO(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=_C(e.doc,i,o,Q.empty);if(!s||s.from!=i||s instanceof US&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(VC.create(t.doc,i)),n(t.scrollIntoView())}return!0}function NO(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var PO=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=FO(r)}let o=a&&a.nodeBefore;return!o||!UC.isSelectable(o)?!1:(t&&t(e.tr.setSelection(UC.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function FO(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function IO(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var LO=(e,t,n)=>{let r=IO(e,n);if(!r)return!1;let i=zO(r);if(!i)return!1;let a=i.nodeAfter;if($O(e,i,t,1))return!0;if(r.parent.content.size==0&&(NO(a,`start`)||UC.isSelectable(a))){let n=_C(e.doc,r.before(),r.after(),Q.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(NO(a,`start`)?LC.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):UC.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},RO=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=zO(r)}let o=a&&a.nodeAfter;return!o||!UC.isSelectable(o)?!1:(t&&t(e.tr.setSelection(UC.create(e.doc,a.pos)).scrollIntoView()),!0)};function zO(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var BO=(e,t)=>{let n=e.selection,r=n instanceof UC,i;if(r){if(n.node.isTextblock||!uC(e.doc,n.from))return!1;i=n.from}else if(i=pC(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(UC.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},VO=(e,t)=>{let n=e.selection,r;if(n instanceof UC){if(n.node.isTextblock||!uC(e.doc,n.to))return!1;r=n.to}else if(r=pC(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},HO=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&XS(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},UO=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
157
- `).scrollIntoView()),!0)};function WO(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var GO=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=WO(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(LC.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},KO=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof GC||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=WO(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(VC.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},qO=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(cC(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&XS(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function JO(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof UC&&t.selection.node.isBlock)return!r.parentOffset||!cC(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=WO(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof VC||t.selection instanceof GC)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=cC(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,cC(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var YO=JO(),XO=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(UC.create(e.doc,i))),!0)},ZO=(e,t)=>(t&&t(e.tr.setSelection(new GC(e.doc))),!0);function QO(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||uC(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function $O(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&QO(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=Z.empty;for(let e=o.length-1;e>=0;e--)s=Z.from(o[e].create(null,s));s=Z.from(i.copy(s));let c=e.tr.step(new WS(t.pos-1,r,t.pos,r,new Q(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&uC(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:LC.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&XS(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&NO(a,`start`,!0)&&NO(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=Z.empty;for(let e=o.length-1;e>=0;e--)r=Z.from(o[e].copy(r));n(e.tr.step(new WS(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new Q(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ek(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(VC.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var tk=ek(-1),nk=ek(1);function rk(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&QS(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function ik(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function ak(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var ok=ak(DO,kO,PO),sk=ak(DO,LO,RO),ck={Enter:ak(UO,KO,qO,YO),"Mod-Enter":GO,Backspace:ok,"Mod-Backspace":ok,"Shift-Backspace":ok,Delete:sk,"Mod-Delete":sk,"Mod-a":ZO},lk={"Ctrl-h":ck.Backspace,"Alt-Backspace":ck[`Mod-Backspace`],"Ctrl-d":ck.Delete,"Ctrl-Alt-Backspace":ck[`Mod-Delete`],"Alt-Delete":ck[`Mod-Delete`],"Alt-d":ck[`Mod-Delete`],"Ctrl-a":tk,"Ctrl-e":nk};for(let e in ck)lk[e]=ck[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function uk(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return dk(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function dk(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Ex(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Ex(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=QS(a,n,r,t);return s?(e&&fk(e,t,s,i,n),!0):!1}function fk(e,t,n,r,i){let a=Z.empty;for(let e=n.length-1;e>=0;e--)a=Z.from(n[e].type.create(n[e].attrs,a));e.step(new WS(t.start-(r?2:0),t.end,t.start,t.end,new Q(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&cC(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function pk(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?mk(t,n,e,a):hk(t,n,a):!0:!1}}function mk(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new WS(a-1,o,a,o,new Q(Z.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ex(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=XS(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return uC(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function hk(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?Z.empty:Z.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new WS(d-+!!s,f+ +!!c,d+1,f-1,new Q((s?Z.empty:Z.from(i.copy(Z.empty))).append(c?Z.empty:Z.from(i.copy(Z.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function gk(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=Z.from(r?e.create():null),o=new Q(Z.from(e.create(null,Z.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new WS(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var _k=Object.defineProperty,vk=(e,t)=>{for(var n in t)_k(e,n,{get:t[n],enumerable:!0})};function yk(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var bk=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:yk({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},xk=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function Sk(e,t){let n=new FC(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}var Ck=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Ck(r)}return e};function wk(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Ck(n)}function Tk(e,t,n){if(e instanceof Dx||e instanceof Z)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return Z.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Tk(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Qx({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?nS.fromSchema(a).parseSlice(wk(e),n.parseOptions):nS.fromSchema(a).parse(wk(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=nS.fromSchema(t);return n.slice?r.parseSlice(wk(e),n.parseOptions).content:r.parse(wk(e),n.parseOptions)}return Tk(``,t,n)}function Ek(e,t,n={},r={}){return Tk(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function Dk(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Ok(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function kk(e){return t=>Ok(t.$from,e)}function Ak(e,t,n){return e.config[t]===void 0&&e.parent?Ak(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?Ak(e.parent,t,n):null}):e.config[t]}function jk(e){return e.map(e=>{let t=Ak(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...jk(t())]:e}).flat(10)}function Mk(e,t){let n=gS.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function Nk(e){return typeof e==`function`}function Pk(e,t=void 0,...n){return Nk(e)?t?e.bind(t)(...n):e(...n):e}function Fk(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Ik(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function Lk(e){let t=[],{nodeExtensions:n,markExtensions:r}=Ik(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n=Ak(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=Ak(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Rk(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=t?t.split(`;`).map(e=>e.trim()).filter(Boolean):[],i=n[e]?n[e].split(`;`).map(e=>e.trim()).filter(Boolean):[],a=new Map;i.forEach(e=>{let[t,n]=e.split(`:`).map(e=>e.trim());a.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(`:`).map(e=>e.trim());a.set(t,n)}),n[e]=Array.from(a.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function zk(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Rk(e,t),{})}function Bk(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Vk(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Bk(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Hk(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Fk(t)?!1:t!=null))}function Uk(e,t){let n=Lk(e),{nodeExtensions:r,markExtensions:i}=Ik(e);return new Qx({topNode:r.find(e=>Ak(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Hk({...e.reduce((e,t)=>{let n=Ak(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:Pk(Ak(r,`content`,a)),marks:Pk(Ak(r,`marks`,a)),group:Pk(Ak(r,`group`,a)),inline:Pk(Ak(r,`inline`,a)),atom:Pk(Ak(r,`atom`,a)),selectable:Pk(Ak(r,`selectable`,a)),draggable:Pk(Ak(r,`draggable`,a)),code:Pk(Ak(r,`code`,a)),whitespace:Pk(Ak(r,`whitespace`,a)),linebreakReplacement:Pk(Ak(r,`linebreakReplacement`,a)),defining:Pk(Ak(r,`defining`,a)),isolating:Pk(Ak(r,`isolating`,a)),attrs:Object.fromEntries(i.map(e=>[e.name,{default:e?.attribute?.default,validate:e?.attribute?.validate}]))}),s=Pk(Ak(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Vk(e,i)));let c=Ak(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:zk(e,i)}));let l=Ak(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Hk({...e.reduce((e,t)=>{let n=Ak(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:Pk(Ak(r,`inclusive`,a)),excludes:Pk(Ak(r,`excludes`,a)),group:Pk(Ak(r,`group`,a)),spanning:Pk(Ak(r,`spanning`,a)),code:Pk(Ak(r,`code`,a)),attrs:Object.fromEntries(i.map(e=>[e.name,{default:e?.attribute?.default,validate:e?.attribute?.validate}]))}),s=Pk(Ak(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Vk(e,i)));let c=Ak(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:zk(e,i)})),[r.name,o]}))})}function Wk(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Gk(e){return e.sort((e,t)=>{let n=Ak(e,`priority`)||100,r=Ak(t,`priority`)||100;return n>r?-1:+(n<r)})}function Kk(e){let t=Gk(jk(e)),n=Wk(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function qk(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
158
-
159
- `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Jk(e,t){return qk(e,{from:0,to:e.content.size},t)}function Yk(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Xk(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function Zk(e,t){let n=Xk(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function Qk(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function $k(e,t){let n=Qk(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function eA(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function tA(e,t){let n=eA(typeof t==`string`?t:t.name,e.schema);return n===`node`?$k(e,t):n===`mark`?Zk(e,t):{}}function nA(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function rA(e){let t=nA(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function iA(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),rA(r)}function aA(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function oA(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:aA(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function sA(e,t,n={}){return e.find(e=>e.type===t&&oA(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function cA(e,t,n={}){return!!sA(e,t,n)}function lA(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t)||(n||=r.node.marks[0]?.attrs,!sA([...r.node.marks],t,n)))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&cA([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&cA([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}var uA=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function dA(e,t){return t.nodes[e]||t.marks[e]||null}function fA(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var pA=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function mA(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?Xk(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>oA(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize),c=a-n;o+=c,s.push(...e.marks.map(e=>({mark:e,from:n,to:a})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>oA(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function hA(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Qk(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>oA(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}function gA(e,t,n={}){if(!t)return hA(e,null,n)||mA(e,null,n);let r=eA(t,e.schema);return r===`node`?hA(e,t,n):r===`mark`?mA(e,t,n):!1}var _A=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=kk(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},vA=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function yA(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function bA(e,t){let{nodeExtensions:n}=Ik(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=Pk(Ak(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function xA(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return/^\s*$/m.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(xA(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function SA(e){return e instanceof UC}function CA(e){return e instanceof VC}function wA(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function TA(e,t=null){if(!t)return null;let n=LC.atStart(e),r=LC.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?VC.create(e,wA(0,i,a),wA(e.content.size,i,a)):VC.create(e,wA(t,i,a),wA(t,i,a))}function EA(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof US||i instanceof WS))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(LC.near(e.doc.resolve(o),n))}var DA=class{constructor(e){this.find=e.find,this.handler=e.handler}},OA=(e,t)=>{if(aA(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function kA(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=pA(c)+i;return a.forEach(e=>{if(l)return;let a=OA(u,e.find);if(!a)return;let c=s.state.tr,d=yk({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new bk({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function AA(e){let{editor:t,rules:n}=e,r=new aw({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:Mk(Z.from(e),a.schema);let{from:i}=s;kA({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return kA({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&kA({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?kA({editor:t,from:a.pos,to:a.pos,text:`
160
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function jA(e){return Object.prototype.toString.call(e).slice(8,-1)}function MA(e){return jA(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function NA(e,t){let n={...e};return MA(e)&&MA(t)&&Object.keys(t).forEach(r=>{MA(t[r])&&MA(e[r])?n[r]=NA(e[r],t[r]):n[r]=t[r]}),n}var PA=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Pk(Ak(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...Pk(Ak(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>NA(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},FA=class e extends PA{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function IA(e){return typeof e==`number`}var LA=(e,t,n)=>{if(aA(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function RA(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new bk({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(!e.isTextblock||e.type.spec.code)return;let f=Math.max(r,t),p=Math.min(i,t+e.content.size);LA(e.textBetween(f-t,p-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=f+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(p)})}),d.every(e=>e!==null)}var zA=null,BA=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function VA(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!RA({editor:t,state:yk({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new aw({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(zA=t)},i=()=>{zA&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=zA;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:Mk(Z.from(t),r.schema);let{from:n}=d,i=n+t.length,a=BA(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!IA(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var HA=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Kk(e),this.schema=Uk(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=Ak(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:dA(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=Gk([...this.extensions].reverse()),n=[],r=[],i=t.map(t=>{let i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:dA(t.name,this.schema)},a=[],o=Ak(t,`addKeyboardShortcuts`,i),s={};if(t.type===`mark`&&Ak(t,`exitable`,i)&&(s.ArrowRight=()=>FA.handleExit({editor:e,mark:t})),o){let t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));s={...s,...t}}let c=TO(s);a.push(c);let l=Ak(t,`addInputRules`,i);yA(t,e.options.enableInputRules)&&l&&n.push(...l());let u=Ak(t,`addPasteRules`,i);yA(t,e.options.enablePasteRules)&&u&&r.push(...u());let d=Ak(t,`addProseMirrorPlugins`,i);if(d){let e=d();a.push(...e)}return a}).flat();return[AA({editor:e,rules:n}),...VA({editor:e,rules:r}),...i]}get attributes(){return Lk(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=Ik(this.extensions);return Object.fromEntries(t.filter(e=>!!Ak(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Ak(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Qk(t.name,this.schema)});return r?[t.name,(i,a,o,s,c)=>{let l=zk(i,n);return r()({node:i,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}get markViews(){let{editor:e}=this,{markExtensions:t}=Ik(this.extensions);return Object.fromEntries(t.filter(e=>!!Ak(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Ak(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Xk(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=zk(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{xM(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:dA(e.name,this.schema)};e.type===`mark`&&(Pk(Ak(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=Ak(e,`onBeforeCreate`,t),r=Ak(e,`onCreate`,t),i=Ak(e,`onUpdate`,t),a=Ak(e,`onSelectionUpdate`,t),o=Ak(e,`onTransaction`,t),s=Ak(e,`onFocus`,t),c=Ak(e,`onBlur`,t),l=Ak(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};HA.resolve=Kk,HA.sort=Gk,HA.flatten=jk,vk({},{ClipboardTextSerializer:()=>WA,Commands:()=>oM,Delete:()=>sM,Drop:()=>cM,Editable:()=>lM,FocusEvents:()=>dM,Keymap:()=>fM,Paste:()=>pM,Tabindex:()=>mM,focusEventsPluginKey:()=>uM});var UA=class e extends PA{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},WA=UA.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new aw({key:new cw(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=Yk(n);return qk(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),GA={};vk(GA,{blur:()=>KA,clearContent:()=>qA,clearNodes:()=>JA,command:()=>YA,createParagraphNear:()=>XA,cut:()=>ZA,deleteCurrentNode:()=>QA,deleteNode:()=>$A,deleteRange:()=>ej,deleteSelection:()=>tj,enter:()=>nj,exitCode:()=>rj,extendMarkRange:()=>ij,first:()=>aj,focus:()=>cj,forEach:()=>lj,insertContent:()=>uj,insertContentAt:()=>fj,joinBackward:()=>hj,joinDown:()=>mj,joinForward:()=>gj,joinItemBackward:()=>_j,joinItemForward:()=>vj,joinTextblockBackward:()=>yj,joinTextblockForward:()=>bj,joinUp:()=>pj,keyboardShortcut:()=>Cj,lift:()=>wj,liftEmptyBlock:()=>Tj,liftListItem:()=>Ej,newlineInCode:()=>Dj,resetAttributes:()=>kj,scrollIntoView:()=>Aj,selectAll:()=>jj,selectNodeBackward:()=>Mj,selectNodeForward:()=>Nj,selectParentNode:()=>Pj,selectTextblockEnd:()=>Fj,selectTextblockStart:()=>Ij,setContent:()=>Lj,setMark:()=>zj,setMeta:()=>Bj,setNode:()=>Vj,setNodeSelection:()=>Hj,setTextSelection:()=>Uj,sinkListItem:()=>Wj,splitBlock:()=>Kj,splitListItem:()=>qj,toggleList:()=>Xj,toggleMark:()=>Zj,toggleNode:()=>Qj,toggleWrap:()=>$j,undoInputRule:()=>eM,unsetAllMarks:()=>tM,unsetMark:()=>nM,updateAttributes:()=>rM,wrapIn:()=>iM,wrapInList:()=>aM});var KA=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),qA=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),JA=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=XS(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},YA=e=>t=>e(t),XA=()=>({state:e,dispatch:t})=>KO(e,t),ZA=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new VC(r.doc.resolve(Math.max(o-1,0)))),!0},QA=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},$A=e=>({tr:t,state:n,dispatch:r})=>{let i=Qk(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},ej=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},tj=()=>({state:e,dispatch:t})=>DO(e,t),nj=()=>({commands:e})=>e.keyboardShortcut(`Enter`),rj=()=>({state:e,dispatch:t})=>GO(e,t),ij=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=Xk(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=lA(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=VC.create(o,e.from,e.to);n.setSelection(t)}}return!0},aj=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function oj(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function sj(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}var cj=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(sj()||oj())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!CA(n.state.selection))return o(),!0;let s=TA(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},lj=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),uj=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),dj=e=>!(`type`in e),fj=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,{selection:o}=a.state,s=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Tk(t,a.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){s(e)}try{i=Tk(t,a.schema,{parseOptions:c,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return s(e),!1}let{from:l,to:u}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},d=!0,f=!0;if((dj(i)?i:[i]).forEach(e=>{e.check(),d=d?e.isText&&e.marks.length===0:!1,f=f?e.isBlock:!1}),l===u&&f){let{parent:e}=r.doc.resolve(l);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--l,u+=1)}let p;if(d){if(Array.isArray(t))p=t.map(e=>e.text||``).join(``);else if(t instanceof Z){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),p=e}else p=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(p,l,u)}else{p=i;let e=o.$from.parentOffset===0,t=o.$from.node().isText||o.$from.node().isTextblock,n=o.$from.node().content.size>0;e&&t&&n&&(l=Math.max(0,l-1)),r.replaceWith(l,u,p)}n.updateSelection&&EA(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:l,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:l,text:p})}return!0},pj=()=>({state:e,dispatch:t})=>BO(e,t),mj=()=>({state:e,dispatch:t})=>VO(e,t),hj=()=>({state:e,dispatch:t})=>kO(e,t),gj=()=>({state:e,dispatch:t})=>LO(e,t),_j=()=>({state:e,dispatch:t,tr:n})=>{try{let r=pC(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},vj=()=>({state:e,dispatch:t,tr:n})=>{try{let r=pC(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},yj=()=>({state:e,dispatch:t})=>AO(e,t),bj=()=>({state:e,dispatch:t})=>jO(e,t);function xj(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Sj(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))sj()||xj()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Cj=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Sj(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},wj=(e,t={})=>({state:n,dispatch:r})=>hA(n,Qk(e,n.schema),t)?HO(n,r):!1,Tj=()=>({state:e,dispatch:t})=>qO(e,t),Ej=e=>({state:t,dispatch:n})=>pk(Qk(e,t.schema))(t,n),Dj=()=>({state:e,dispatch:t})=>UO(e,t);function Oj(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var kj=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=eA(typeof e==`string`?e:e.name,r.schema);return s?(s===`node`&&(a=Qk(e,r.schema)),s===`mark`&&(o=Xk(e,r.schema)),i&&n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&n.setNodeMarkup(r,void 0,Oj(e.attrs,t)),o&&e.marks.length&&e.marks.forEach(i=>{o===i.type&&n.addMark(r,r+e.nodeSize,o.create(Oj(i.attrs,t)))})})}),!0):!1},Aj=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),jj=()=>({tr:e,dispatch:t})=>{if(t){let t=new GC(e.doc);e.setSelection(t)}return!0},Mj=()=>({state:e,dispatch:t})=>PO(e,t),Nj=()=>({state:e,dispatch:t})=>RO(e,t),Pj=()=>({state:e,dispatch:t})=>XO(e,t),Fj=()=>({state:e,dispatch:t})=>nk(e,t),Ij=()=>({state:e,dispatch:t})=>tk(e,t),Lj=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=Ek(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function Rj(e,t,n){let{selection:r}=t,i=null;if(CA(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return!!n.isInSet(t)||!t.some(e=>e.type.excludes(n))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var zj=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=Xk(e,r.schema);if(i)if(o){let e=Zk(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Rj(r,n,c)},Bj=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Vj=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Qk(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>ik(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>ik(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},Hj=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=wA(e,0,n.content.size),i=UC.create(n,r);t.setSelection(i)}return!0},Uj=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=VC.atStart(n).from,o=VC.atEnd(n).to,s=wA(r,a,o),c=wA(i,a,o),l=VC.create(n,s,c);t.setSelection(l)}return!0},Wj=e=>({state:t,dispatch:n})=>gk(Qk(e,t.schema))(t,n);function Gj(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var Kj=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=fA(l,s.node().type.name,s.node().attrs);if(a instanceof UC&&a.node.isBlock)return!s.parentOffset||!cC(o,s.pos)?!1:(r&&(e&&Gj(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Dk(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=cC(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&cC(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof VC&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&Gj(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},qj=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Qk(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=Z.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=Z.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...fA(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(Z.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new Q(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(VC.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...fA(d,u.type.name,u.attrs),...t},m={...fA(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!cC(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},Jj=(e,t)=>{let n=kk(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&uC(e.doc,n.pos)&&e.join(n.pos),!0},Yj=(e,t)=>{let n=kk(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&uC(e.doc,r)&&e.join(r),!0},Xj=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Qk(e,o.schema),m=Qk(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=kk(e=>bA(e.type.name,d))(h);if(y.depth>=1&&x&&y.depth-x.depth<=1){if(x.node.type===p)return l.liftListItem(m);if(bA(x.node.type.name,d)&&p.validContent(x.node.content)&&s)return c().command(()=>(a.setNodeMarkup(x.pos,p),!0)).command(()=>Jj(a,p)).command(()=>Yj(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>Jj(a,p)).command(()=>Yj(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>Jj(a,p)).command(()=>Yj(a,p)).run()},Zj=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=Xk(e,r.schema);return mA(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Qj=(e,t,n={})=>({state:r,commands:i})=>{let a=Qk(e,r.schema),o=Qk(t,r.schema),s=hA(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},$j=(e,t={})=>({state:n,commands:r})=>{let i=Qk(e,n.schema);return hA(n,i,t)?r.lift(i):r.wrapIn(i,t)},eM=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},tM=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},nM=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=Xk(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=lA(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},rM=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=eA(typeof e==`string`?e:e.name,r.schema);return s?(s===`node`&&(a=Qk(e,r.schema)),s===`mark`&&(o=Xk(e,r.schema)),i&&n.selection.ranges.forEach(e=>{let i=e.$from.pos,s=e.$to.pos,c,l,u,d;n.selection.empty?r.doc.nodesBetween(i,s,(e,t)=>{a&&a===e.type&&(u=Math.max(t,i),d=Math.min(t+e.nodeSize,s),c=t,l=e)}):r.doc.nodesBetween(i,s,(e,r)=>{r<i&&a&&a===e.type&&(u=Math.max(r,i),d=Math.min(r+e.nodeSize,s),c=r,l=e),r>=i&&r<=s&&(a&&a===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type){let c=Math.max(r,i),l=Math.min(r+e.nodeSize,s);n.addMark(c,l,o.create({...a.attrs,...t}))}}))}),l&&(c!==void 0&&n.setNodeMarkup(c,void 0,{...l.attrs,...t}),o&&l.marks.length&&l.marks.forEach(e=>{o===e.type&&n.addMark(u,d,o.create({...e.attrs,...t}))}))}),!0):!1},iM=(e,t={})=>({state:n,dispatch:r})=>rk(Qk(e,n.schema),t)(n,r),aM=(e,t={})=>({state:n,dispatch:r})=>uk(Qk(e,n.schema),t)(n,r),oM=UA.create({name:`commands`,addCommands(){return{...GA}}}),sM=UA.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=Sk(e.before,[e,...t]);iA(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof BS){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)),u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),cM=UA.create({name:`drop`,addProseMirrorPlugins(){return[new aw({key:new cw(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),lM=UA.create({name:`editable`,addProseMirrorPlugins(){return[new aw({key:new cw(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),uM=new cw(`focusEvents`),dM=UA.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new aw({key:uM,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),fM=UA.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:LC.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return sj()||xj()?i:r},addProseMirrorPlugins(){return[new aw({key:new cw(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=LC.atStart(t.doc).from,l=LC.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!xA(n.doc))return;let u=n.tr,d=yk({state:n,transaction:u}),{commands:f}=new bk({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),pM=UA.create({name:`paste`,addProseMirrorPlugins(){return[new aw({key:new cw(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),mM=UA.create({name:`tabindex`,addProseMirrorPlugins(){return[new aw({key:new cw(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),hM=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=this.pos+r+ +!a;if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;let s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;let c=new e(s,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),t.push(new e(s,this.editor,i,i?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},gM=`.ProseMirror {
161
- position: relative;
162
- }
163
-
164
- .ProseMirror {
165
- word-wrap: break-word;
166
- white-space: pre-wrap;
167
- white-space: break-spaces;
168
- -webkit-font-variant-ligatures: none;
169
- font-variant-ligatures: none;
170
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
171
- }
172
-
173
- .ProseMirror [contenteditable="false"] {
174
- white-space: normal;
175
- }
176
-
177
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
178
- white-space: pre-wrap;
179
- }
180
-
181
- .ProseMirror pre {
182
- white-space: pre-wrap;
183
- }
184
-
185
- img.ProseMirror-separator {
186
- display: inline !important;
187
- border: none !important;
188
- margin: 0 !important;
189
- width: 0 !important;
190
- height: 0 !important;
191
- }
192
-
193
- .ProseMirror-gapcursor {
194
- display: none;
195
- pointer-events: none;
196
- position: absolute;
197
- margin: 0;
198
- }
199
-
200
- .ProseMirror-gapcursor:after {
201
- content: "";
202
- display: block;
203
- position: absolute;
204
- top: -2px;
205
- width: 20px;
206
- border-top: 1px solid black;
207
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
208
- }
209
-
210
- @keyframes ProseMirror-cursor-blink {
211
- to {
212
- visibility: hidden;
213
- }
214
- }
215
-
216
- .ProseMirror-hideselection *::selection {
217
- background: transparent;
218
- }
219
-
220
- .ProseMirror-hideselection *::-moz-selection {
221
- background: transparent;
222
- }
223
-
224
- .ProseMirror-hideselection * {
225
- caret-color: transparent;
226
- }
227
-
228
- .ProseMirror-focused .ProseMirror-gapcursor {
229
- display: block;
230
- }`;function _M(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var vM=class extends xk{constructor(e={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=TA(t,this.options.autofocus);this.editorState=rw.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){var e;if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}this.editorView=null,this.isInitialized=!1,(e=this.css)==null||e.remove(),this.css=null}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=_M(gM,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.editorState=this.state.apply(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=Nk(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let e=[...this.options.enableCoreExtensions?[lM,WA.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),oM,dM,fM,mM,cM,pM,sM].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new HA(e,this)}createCommandManager(){this.commandManager=new bk({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Ek(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=Ek(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){this.editorView=new aO(e,{...this.options.editorProps,attributes:{role:`textbox`,...this.options.editorProps?.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState});let t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews(),this.prependClass(),this.injectCSS();let n=this.view.dom;n.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return tA(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return gA(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Mk(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
231
-
232
- `,textSerializers:n={}}=e||{};return Jk(this.state.doc,{blockSeparator:t,textSerializers:{...Yk(this.schema),...n}})}get isEmpty(){return xA(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new hM(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function yM(e){return new DA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Pk(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()}})}function bM(e){return new DA({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=Pk(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&QS(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&uC(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}function xM(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var SM=class e extends PA{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},CM=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);(t=e.dataTransfer)==null||t.setDragImage(s,a,o);let c=this.getPos();if(typeof c!=`number`)return;let l=UC.create(n.state.doc,c),u=n.state.tr.setSelection(l);n.dispatch(u)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!r&&!n)return!0;let{isEditable:i}=this.editor,{isDragging:a}=this,o=!!this.node.type.spec.draggable,s=UC.isSelectable(this.node),c=e.type===`copy`,l=e.type===`paste`,u=e.type===`cut`,d=e.type===`mousedown`;if(!o&&s&&n&&e.target===this.dom&&e.preventDefault(),o&&n&&!a&&e.target===this.dom)return e.preventDefault(),!1;if(o&&i&&!a&&d){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(a||r||c||l||u||d&&s)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(sj()||oj())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}},wM=s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!(o===`_owner`&&t.$$typeof)&&!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),TM=s((e=>{var t=p(),n=ax();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),EM=s(((e,t)=>{t.exports=TM()})),DM=ax(),OM=u(wM(),1),kM=EM(),AM=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},jM=({contentComponent:e})=>{let t=(0,DM.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,G.jsx)(G.Fragment,{children:Object.values(t)})};function MM(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:Vg.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var NM=class extends W.Component{constructor(e){super(e),this.editorContentRef=W.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!e.editor?.contentComponent}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=MM(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){let e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element?.firstChild))return;let t=document.createElement(`div`);t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:AM(t,this.editorContentRef),...n}),e?.contentComponent&&(0,G.jsx)(jM,{contentComponent:e.contentComponent})]})}},PM=(0,W.forwardRef)((e,t)=>{let n=W.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return W.createElement(NM,{key:n,innerRef:t,...e})}),FM=W.memo(PM),IM=typeof window<`u`?W.useLayoutEffect:W.useEffect,LM=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function RM(e){let[t]=(0,W.useState)(()=>new LM(e.editor)),n=(0,kM.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??OM.default);return IM(()=>t.watch(e.editor),[e.editor,t]),(0,W.useDebugValue)(n),n}var zM=!1,BM=typeof window>`u`,VM=BM||!!(typeof window<`u`&&window.next),HM=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(BM||VM){if(zM)throw Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&BM&&zM)throw Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){return new vM({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function UM(e={},t=[]){let n=(0,W.useRef)(e);n.current=e;let[r]=(0,W.useState)(()=>new HM(n)),i=(0,DM.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,W.useDebugValue)(i),(0,W.useEffect)(r.onRender(t)),RM({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}(0,W.createContext)({editor:null}).Consumer;var WM=(0,W.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),GM=()=>(0,W.useContext)(WM),KM=W.forwardRef((e,t)=>{let{onDragStart:n}=GM();return(0,G.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function qM(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function JM(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function YM(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function XM(e){if(qM(e)||JM(e))return!0;if(YM(e)){let t=e.type;if(t)return qM(t)||JM(t)}return!1}function ZM(){try{if(W.version)return parseInt(W.version.split(`.`)[0],10)>=19}catch{}return!1}var QM=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isInitialized?(0,Vg.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var e;let t=this.component,n=this.props,r=this.editor,i=ZM(),a=XM(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,G.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};W.createContext({markViewContentRef:()=>{}});var $M=class extends CM{constructor(e,t,n){if(super(e,t,n),!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,W.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,W.memo)(e=>(0,G.jsx)(WM.Provider,{value:t,children:(0,W.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new QM(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){let{from:e,to:t}=this.editor.state.selection,n=this.getPos();if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n})})}return e===this.node&&this.decorations===t&&this.innerDecorations===n?!0:(this.node=e,this.decorations=t,this.innerDecorations=n,r({node:e,decorations:t,innerDecorations:n}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=zk(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function eN(e,t){return n=>n.editor.contentComponent?new $M(e,n,t):{}}var tN=Object.defineProperty,nN=(e,t)=>{for(var n in t)tN(e,n,{get:t[n],enumerable:!0})};function rN(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var iN=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:rN({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},aN={};nN(aN,{blur:()=>oN,clearContent:()=>sN,clearNodes:()=>cN,command:()=>lN,createParagraphNear:()=>uN,cut:()=>dN,deleteCurrentNode:()=>fN,deleteNode:()=>mN,deleteRange:()=>hN,deleteSelection:()=>gN,enter:()=>_N,exitCode:()=>vN,extendMarkRange:()=>TN,first:()=>EN,focus:()=>NN,forEach:()=>PN,insertContent:()=>FN,insertContentAt:()=>VN,joinBackward:()=>WN,joinDown:()=>UN,joinForward:()=>GN,joinItemBackward:()=>KN,joinItemForward:()=>Dne,joinTextblockBackward:()=>One,joinTextblockForward:()=>kne,joinUp:()=>HN,keyboardShortcut:()=>jne,lift:()=>Mne,liftEmptyBlock:()=>Nne,liftListItem:()=>Pne,newlineInCode:()=>Fne,resetAttributes:()=>Ine,scrollIntoView:()=>Lne,selectAll:()=>Rne,selectNodeBackward:()=>zne,selectNodeForward:()=>Bne,selectParentNode:()=>Vne,selectTextblockEnd:()=>Hne,selectTextblockStart:()=>Une,setContent:()=>Gne,setMark:()=>pre,setMeta:()=>mre,setNode:()=>hre,setNodeSelection:()=>gre,setTextDirection:()=>_re,setTextSelection:()=>vre,sinkListItem:()=>yre,splitBlock:()=>bre,splitListItem:()=>xre,toggleList:()=>Cre,toggleMark:()=>wre,toggleNode:()=>Tre,toggleWrap:()=>Ere,undoInputRule:()=>Dre,unsetAllMarks:()=>Ore,unsetMark:()=>kre,unsetTextDirection:()=>Are,updateAttributes:()=>jre,wrapIn:()=>Mre,wrapInList:()=>Nre});var oN=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),sN=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),cN=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=XS(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},lN=e=>t=>e(t),uN=()=>({state:e,dispatch:t})=>KO(e,t),dN=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new VC(r.doc.resolve(Math.max(o-1,0)))),!0},fN=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function pN(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var mN=e=>({tr:t,state:n,dispatch:r})=>{let i=pN(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},hN=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},gN=()=>({state:e,dispatch:t})=>DO(e,t),_N=()=>({commands:e})=>e.keyboardShortcut(`Enter`),vN=()=>({state:e,dispatch:t})=>GO(e,t);function yN(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function bN(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:yN(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function xN(e,t,n={}){return e.find(e=>e.type===t&&bN(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function SN(e,t,n={}){return!!xN(e,t,n)}function CN(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!xN([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&SN([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&SN([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function wN(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var TN=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=wN(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=CN(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=VC.create(o,e.from,e.to);n.setSelection(t)}}return!0},EN=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function DN(e){return e instanceof VC}function ON(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function kN(e,t=null){if(!t)return null;let n=LC.atStart(e),r=LC.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?VC.create(e,ON(0,i,a),ON(e.content.size,i,a)):VC.create(e,ON(t,i,a),ON(t,i,a))}function AN(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function jN(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function MN(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var NN=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(jN()||AN())&&r.dom.focus(),MN()&&!jN()&&!AN()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!DN(n.state.selection))return o(),!0;let s=kN(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},PN=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),FN=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),IN=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&IN(r)}return e};function LN(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return IN(n)}function RN(e,t,n){if(e instanceof Dx||e instanceof Z)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return Z.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),RN(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Qx({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?nS.fromSchema(a).parseSlice(LN(e),n.parseOptions):nS.fromSchema(a).parse(LN(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=nS.fromSchema(t);return n.slice?r.parseSlice(LN(e),n.parseOptions).content:r.parse(LN(e),n.parseOptions)}return RN(``,t,n)}function zN(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof US||i instanceof WS))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(LC.near(e.doc.resolve(o),n))}var BN=e=>!(`type`in e),VN=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{RN(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=RN(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((BN(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof Z){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&zN(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},HN=()=>({state:e,dispatch:t})=>BO(e,t),UN=()=>({state:e,dispatch:t})=>VO(e,t),WN=()=>({state:e,dispatch:t})=>kO(e,t),GN=()=>({state:e,dispatch:t})=>LO(e,t),KN=()=>({state:e,dispatch:t,tr:n})=>{try{let r=pC(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Dne=()=>({state:e,dispatch:t,tr:n})=>{try{let r=pC(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},One=()=>({state:e,dispatch:t})=>AO(e,t),kne=()=>({state:e,dispatch:t})=>jO(e,t);function qN(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Ane(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))jN()||qN()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var jne=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Ane(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function JN(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?pN(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>bN(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Mne=(e,t={})=>({state:n,dispatch:r})=>JN(n,pN(e,n.schema),t)?HO(n,r):!1,Nne=()=>({state:e,dispatch:t})=>qO(e,t),Pne=e=>({state:t,dispatch:n})=>pk(pN(e,t.schema))(t,n),Fne=()=>({state:e,dispatch:t})=>UO(e,t);function YN(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function XN(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Ine=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=YN(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=pN(e,r.schema)),s===`mark`&&(o=wN(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,XN(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(XN(a.attrs,t))))})})}),c},Lne=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Rne=()=>({tr:e,dispatch:t})=>{if(t){let t=new GC(e.doc);e.setSelection(t)}return!0},zne=()=>({state:e,dispatch:t})=>PO(e,t),Bne=()=>({state:e,dispatch:t})=>RO(e,t),Vne=()=>({state:e,dispatch:t})=>XO(e,t),Hne=()=>({state:e,dispatch:t})=>nk(e,t),Une=()=>({state:e,dispatch:t})=>tk(e,t);function Wne(e,t,n={},r={}){return RN(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Gne=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=Wne(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function ZN(e,t){let n=wN(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function QN(e,t){let n=new FC(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Kne(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function qne(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function Jne(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function $N(e){return t=>Jne(t.$from,e)}function eP(e,t,n){return e.config[t]===void 0&&e.parent?eP(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?eP(e.parent,t,n):null}):e.config[t]}function tP(e){return e.map(e=>{let t=eP(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...tP(t())]:e}).flat(10)}function nP(e,t){let n=gS.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function Yne(e){return typeof e==`function`}function rP(e,t=void 0,...n){return Yne(e)?t?e.bind(t)(...n):e(...n):e}function Xne(e={}){return Object.keys(e).length===0&&e.constructor===Object}function iP(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function aP(e){let t=[],{nodeExtensions:n,markExtensions:r}=iP(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=eP(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=eP(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Zne(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function oP(e){let t=[],n=Zne(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function sP(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...oP(n[e]),...oP(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function cP(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>sP(e,t),{})}function Qne(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function lP(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Qne(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function uP(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Xne(t)?!1:t!=null))}function dP(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function $ne(e,t){let n=aP(e),{nodeExtensions:r,markExtensions:i}=iP(e);return new Qx({topNode:r.find(e=>eP(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=uP({...e.reduce((e,t)=>{let n=eP(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:rP(eP(r,`content`,a)),marks:rP(eP(r,`marks`,a)),group:rP(eP(r,`group`,a)),inline:rP(eP(r,`inline`,a)),atom:rP(eP(r,`atom`,a)),selectable:rP(eP(r,`selectable`,a)),draggable:rP(eP(r,`draggable`,a)),code:rP(eP(r,`code`,a)),whitespace:rP(eP(r,`whitespace`,a)),linebreakReplacement:rP(eP(r,`linebreakReplacement`,a)),defining:rP(eP(r,`defining`,a)),isolating:rP(eP(r,`isolating`,a)),attrs:Object.fromEntries(i.map(dP))}),s=rP(eP(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>lP(e,i)));let c=eP(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:cP(e,i)}));let l=eP(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=uP({...e.reduce((e,t)=>{let n=eP(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:rP(eP(r,`inclusive`,a)),excludes:rP(eP(r,`excludes`,a)),group:rP(eP(r,`group`,a)),spanning:rP(eP(r,`spanning`,a)),code:rP(eP(r,`code`,a)),attrs:Object.fromEntries(i.map(dP))}),s=rP(eP(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>lP(e,i)));let c=eP(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:cP(e,i)})),[r.name,o]}))})}function ere(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function fP(e){return e.sort((e,t)=>{let n=eP(e,`priority`)||100,r=eP(t,`priority`)||100;return n>r?-1:+(n<r)})}function pP(e){let t=fP(tP(e)),n=ere(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function tre(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
233
-
234
- `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function nre(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function rre(e,t){let n=pN(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function ire(e,t){let n=YN(typeof t==`string`?t:t.name,e.schema);return n===`node`?rre(e,t):n===`mark`?ZN(e,t):{}}function are(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function ore(e){let t=are(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function mP(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),ore(r)}function hP(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=CN(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var sre=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function gP(e,t){return t.nodes[e]||t.marks[e]||null}function _P(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var cre=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function lre(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?wN(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>bN(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>bN(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}var ure=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=$N(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},dre=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function vP(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function yP(e,t){let{nodeExtensions:n}=iP(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=rP(eP(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function bP(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(bP(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function xP(e){return e instanceof UC}function fre(e,t,n){let{selection:r}=t,i=null;if(DN(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var pre=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=wN(e,r.schema);if(i)if(o){let e=ZN(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return fre(r,n,c)},mre=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),hre=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=pN(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>ik(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>ik(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},gre=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=ON(e,0,n.content.size),i=UC.create(n,r);t.setSelection(i)}return!0},_re=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},vre=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=VC.atStart(n).from,o=VC.atEnd(n).to,s=ON(r,a,o),c=ON(i,a,o),l=VC.create(n,s,c);t.setSelection(l)}return!0},yre=e=>({state:t,dispatch:n})=>gk(pN(e,t.schema))(t,n);function SP(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var bre=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=_P(l,s.node().type.name,s.node().attrs);if(a instanceof UC&&a.node.isBlock)return!s.parentOffset||!cC(o,s.pos)?!1:(r&&(e&&SP(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Kne(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=cC(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&cC(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof VC&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&SP(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},xre=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=pN(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=Z.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=Z.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={..._P(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(Z.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new Q(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(VC.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={..._P(d,u.type.name,u.attrs),...t},m={..._P(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!cC(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},CP=(e,t)=>{let n=$N(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&uC(e.doc,n.pos)&&e.join(n.pos),!0},wP=(e,t)=>{let n=$N(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&uC(e.doc,r)&&e.join(r),!0};function Sre(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return VC.between(r,i)}var Cre=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=pN(e,o.schema),m=pN(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=$N(e=>yP(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&yP(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,O=!!T;if((D||O)&&E){if(E.node.type===p)return S&&O?c().command(({tr:e,dispatch:t})=>{let n=Sre(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(yP(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>CP(a,p)).command(()=>wP(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>CP(a,p)).command(()=>wP(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>CP(a,p)).command(()=>wP(a,p)).run()},wre=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=wN(e,r.schema);return lre(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Tre=(e,t,n={})=>({state:r,commands:i})=>{let a=pN(e,r.schema),o=pN(t,r.schema),s=JN(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},Ere=(e,t={})=>({state:n,commands:r})=>{let i=pN(e,n.schema);return JN(n,i,t)?r.lift(i):r.wrapIn(i,t)},Dre=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},Ore=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},kre=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=wN(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=CN(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Are=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},jre=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=YN(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=pN(e,r.schema)),s===`mark`&&(o=wN(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Mre=(e,t={})=>({state:n,dispatch:r})=>rk(pN(e,n.schema),t)(n,r),Nre=(e,t={})=>({state:n,dispatch:r})=>uk(pN(e,n.schema),t)(n,r),TP=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Pre=(e,t)=>{if(yN(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function EP(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=cre(c)+i;return a.forEach(e=>{if(l)return;let a=Pre(u,e.find);if(!a)return;let c=s.state.tr,d=rN({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new iN({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function Fre(e){let{editor:t,rules:n}=e,r=new aw({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:nP(Z.from(e),a.schema);let{from:i}=s;EP({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return EP({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&EP({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?EP({editor:t,from:a.pos,to:a.pos,text:`
235
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Ire(e){return Object.prototype.toString.call(e).slice(8,-1)}function DP(e){return Ire(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function OP(e,t){let n={...e};return DP(e)&&DP(t)&&Object.keys(t).forEach(r=>{DP(t[r])&&DP(e[r])?n[r]=OP(e[r],t[r]):n[r]=t[r]}),n}var kP=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...rP(eP(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...rP(eP(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>OP(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},AP=class e extends kP{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Lre(e){return typeof e==`number`}var Rre=class{constructor(e){this.find=e.find,this.handler=e.handler}},zre=(e,t,n)=>{if(yN(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Bre(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new iN({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||zre(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var jP=null,Vre=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Hre(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!Bre({editor:t,state:rN({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new aw({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(jP=t)},i=()=>{jP&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=jP;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:nP(Z.from(t),r.schema);let{from:n}=d,i=n+t.length,a=Vre(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Lre(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var MP=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=pP(e),this.schema=$ne(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=eP(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:gP(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return fP([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:gP(t.name,this.schema)},r=[],i=eP(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&eP(t,`exitable`,n)&&(a.ArrowRight=()=>AP.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=TO(a);r.push(o);let s=eP(t,`addInputRules`,n);if(vP(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Fre({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=eP(t,`addPasteRules`,n);if(vP(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Hre({editor:e,rules:t});r.push(...n)}}let l=eP(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return aP(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=iP(this.extensions);return Object.fromEntries(t.filter(e=>!!eP(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=eP(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:pN(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:cP(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return fP([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:gP(n.name,this.schema)},i=eP(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return fP([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:gP(n.name,this.schema)},i=eP(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=iP(this.extensions);return Object.fromEntries(t.filter(e=>!!eP(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=eP(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:wN(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=cP(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{oie(i,e,t)}})}]:[]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:gP(e.name,this.schema)};e.type===`mark`&&(rP(eP(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=eP(e,`onBeforeCreate`,t),r=eP(e,`onCreate`,t),i=eP(e,`onUpdate`,t),a=eP(e,`onSelectionUpdate`,t),o=eP(e,`onTransaction`,t),s=eP(e,`onFocus`,t),c=eP(e,`onBlur`,t),l=eP(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};MP.resolve=pP,MP.sort=fP,MP.flatten=tP,nN({},{ClipboardTextSerializer:()=>Ure,Commands:()=>Wre,Delete:()=>Gre,Drop:()=>Kre,Editable:()=>qre,FocusEvents:()=>Jre,Keymap:()=>Yre,Paste:()=>Xre,Tabindex:()=>Zre,TextDirection:()=>Qre,focusEventsPluginKey:()=>PP});var NP=class e extends kP{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Ure=NP.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new aw({key:new cw(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=nre(n);return tre(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),Wre=NP.create({name:`commands`,addCommands(){return{...aN}}}),Gre=NP.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=QN(e.before,[e,...t]);mP(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof BS){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),Kre=NP.create({name:`drop`,addProseMirrorPlugins(){return[new aw({key:new cw(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),qre=NP.create({name:`editable`,addProseMirrorPlugins(){return[new aw({key:new cw(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),PP=new cw(`focusEvents`),Jre=NP.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new aw({key:PP,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Yre=NP.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:LC.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return jN()||qN()?i:r},addProseMirrorPlugins(){return[new aw({key:new cw(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=LC.atStart(t.doc).from,l=LC.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!bP(n.doc))return;let u=n.tr,d=rN({state:n,transaction:u}),{commands:f}=new iN({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),Xre=NP.create({name:`paste`,addProseMirrorPlugins(){return[new aw({key:new cw(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Zre=NP.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new aw({key:new cw(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),Qre=NP.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=iP(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new aw({key:new cw(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}});function FP(e){return new TP({find:e.find,handler:({state:t,range:n,match:r})=>{let i=rP(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(hP(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function $re(e){return new TP({find:e.find,handler:({state:t,range:n,match:r})=>{let i=rP(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function IP(e){return new TP({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=rP(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function LP(e){return new TP({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=rP(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&QS(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&uC(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}function eie(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof UC){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}nN({},{createAtomBlockMarkdownSpec:()=>tie,createBlockMarkdownSpec:()=>nie,createInlineMarkdownSpec:()=>aie,parseAttributes:()=>RP,parseIndentedBlocks:()=>BP,renderNestedMarkdownContent:()=>VP,serializeAttributes:()=>zP});function RP(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function zP(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function tie(e){let{nodeName:t,name:n,parseAttributes:r=RP,serializeAttributes:i=zP,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function nie(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=RP,serializeAttributes:a=zP,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
236
-
237
- ${t.renderChildren(e.content||[],`
238
-
239
- `)}
240
-
241
- :::`}}}function rie(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function iie(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function aie(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=rie,serializeAttributes:a=iie,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function BP(e,t,n){let r=e.split(`
242
- `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
243
- `;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
244
- `;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
245
- `,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
246
- `,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
247
- `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function VP(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
248
- `).map(e=>e?t.indent(e):t.indent(``)).join(`
249
- `);s+=e.type===`paragraph`?`
250
-
251
- ${n}`:`
252
- ${n}`}}),s}function oie(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var HP=class e extends kP{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function UP(e){return new Rre({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=rP(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(hP(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var WP=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},sie=/^\s*>\s$/,cie=HP.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return WP(`blockquote`,{...sP(this.options.HTMLAttributes,e),children:WP(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
253
- `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
254
- `))}),n.join(`
255
- >
256
- `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[LP({find:sie,type:this.type})]}}),lie=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,uie=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,die=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,fie=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,pie=AP.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return WP(`strong`,{...sP(this.options.HTMLAttributes,e),children:WP(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[FP({find:lie,type:this.type}),FP({find:die,type:this.type})]},addPasteRules(){return[UP({find:uie,type:this.type}),UP({find:fie,type:this.type})]}}),mie=/(^|[^`])`([^`]+)`(?!`)$/,hie=/(^|[^`])`([^`]+)`(?!`)/g,gie=AP.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,sP(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[FP({find:mie,type:this.type})]},addPasteRules(){return[UP({find:hie,type:this.type})]}}),GP=4,_ie=/^```([a-z]+)?[\s\n]$/,vie=/^~~~([a-z]+)?[\s\n]$/,yie=HP.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:GP,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,sP(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
257
- `):`\`\`\`${r}
258
-
259
- \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??GP,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
260
- `,`
261
- `).split(`
262
- `).map(e=>o+e).join(`
263
- `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??GP,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
264
- `,`
265
- `).split(`
266
- `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(VC.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
267
- `,`
268
- `).split(`
269
- `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
270
- `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
271
-
272
- `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(LC.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[IP({find:_ie,type:this.type,getAttributes:e=>({language:e[1]})}),IP({find:vie,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new aw({key:new cw(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
273
- `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(VC.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),bie=HP.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
274
-
275
- `):``}),xie=HP.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,sP(this.options.HTMLAttributes,e)]},renderText(){return`
276
- `},renderMarkdown:()=>`
277
- `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Sie=HP.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,sP(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>IP({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Cie=HP.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,sP(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!eie(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return xP(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(VC.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(UC.create(t.doc,n.pos)):t.setSelection(VC.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(VC.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[$re({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),wie=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Tie=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Eie=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Die=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Oie=AP.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,sP(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[FP({find:wie,type:this.type}),FP({find:Eie,type:this.type})]},addPasteRules(){return[UP({find:Tie,type:this.type}),UP({find:Die,type:this.type})]}}),kie=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Aie=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,KP=`numeric`,qP=`ascii`,JP=`alpha`,YP=`asciinumeric`,XP=`alphanumeric`,ZP=`domain`,QP=`emoji`,jie=`scheme`,Mie=`slashscheme`,$P=`whitespace`;function Nie(e,t){return e in t||(t[e]=[]),t[e]}function eF(e,t,n){t[KP]&&(t[YP]=!0,t[XP]=!0),t[qP]&&(t[YP]=!0,t[JP]=!0),t[YP]&&(t[XP]=!0),t[JP]&&(t[XP]=!0),t[XP]&&(t[ZP]=!0),t[QP]&&(t[ZP]=!0);for(let r in t){let t=Nie(r,n);t.indexOf(e)<0&&t.push(e)}}function Pie(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function tF(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}tF.groups={},tF.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=tF.groups;let i;return t&&t.j?i=t:(i=new tF(t),n&&r&&eF(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=tF.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new tF,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new tF,a&&(r&&(o.t&&typeof o.t==`string`?eF(a,Object.assign(Pie(o.t,r),n),r):n&&eF(a,n,r)),o.t=a),i.j[e]=o,o}};var nF=(e,t,n,r,i)=>e.ta(t,n,r,i),rF=(e,t,n,r,i)=>e.tr(t,n,r,i),iF=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),aF=`WORD`,oF=`UWORD`,sF=`ASCIINUMERICAL`,cF=`ALPHANUMERICAL`,lF=`LOCALHOST`,uF=`TLD`,dF=`UTLD`,fF=`SCHEME`,pF=`SLASH_SCHEME`,mF=`NUM`,hF=`WS`,gF=`NL`,_F=`OPENBRACE`,vF=`CLOSEBRACE`,yF=`OPENBRACKET`,bF=`CLOSEBRACKET`,xF=`OPENPAREN`,SF=`CLOSEPAREN`,CF=`OPENANGLEBRACKET`,wF=`CLOSEANGLEBRACKET`,TF=`FULLWIDTHLEFTPAREN`,EF=`FULLWIDTHRIGHTPAREN`,DF=`LEFTCORNERBRACKET`,OF=`RIGHTCORNERBRACKET`,kF=`LEFTWHITECORNERBRACKET`,AF=`RIGHTWHITECORNERBRACKET`,jF=`FULLWIDTHLESSTHAN`,MF=`FULLWIDTHGREATERTHAN`,NF=`AMPERSAND`,PF=`APOSTROPHE`,FF=`ASTERISK`,IF=`AT`,LF=`BACKSLASH`,RF=`BACKTICK`,zF=`CARET`,BF=`COLON`,VF=`COMMA`,HF=`DOLLAR`,UF=`DOT`,WF=`EQUALS`,GF=`EXCLAMATION`,KF=`HYPHEN`,qF=`PERCENT`,JF=`PIPE`,YF=`PLUS`,XF=`POUND`,ZF=`QUERY`,QF=`QUOTE`,$F=`FULLWIDTHMIDDLEDOT`,eI=`SEMI`,tI=`SLASH`,nI=`TILDE`,rI=`UNDERSCORE`,iI=`EMOJI`,aI=`SYM`,oI=Object.freeze({__proto__:null,ALPHANUMERICAL:cF,AMPERSAND:NF,APOSTROPHE:PF,ASCIINUMERICAL:sF,ASTERISK:FF,AT:IF,BACKSLASH:LF,BACKTICK:RF,CARET:zF,CLOSEANGLEBRACKET:wF,CLOSEBRACE:vF,CLOSEBRACKET:bF,CLOSEPAREN:SF,COLON:BF,COMMA:VF,DOLLAR:HF,DOT:UF,EMOJI:iI,EQUALS:WF,EXCLAMATION:GF,FULLWIDTHGREATERTHAN:MF,FULLWIDTHLEFTPAREN:TF,FULLWIDTHLESSTHAN:jF,FULLWIDTHMIDDLEDOT:$F,FULLWIDTHRIGHTPAREN:EF,HYPHEN:KF,LEFTCORNERBRACKET:DF,LEFTWHITECORNERBRACKET:kF,LOCALHOST:lF,NL:gF,NUM:mF,OPENANGLEBRACKET:CF,OPENBRACE:_F,OPENBRACKET:yF,OPENPAREN:xF,PERCENT:qF,PIPE:JF,PLUS:YF,POUND:XF,QUERY:ZF,QUOTE:QF,RIGHTCORNERBRACKET:OF,RIGHTWHITECORNERBRACKET:AF,SCHEME:fF,SEMI:eI,SLASH:tI,SLASH_SCHEME:pF,SYM:aI,TILDE:nI,TLD:uF,UNDERSCORE:rI,UTLD:dF,UWORD:oF,WORD:aF,WS:hF}),sI=/[a-z]/,cI=/\p{L}/u,lI=/\p{Emoji}/u,uI=/\d/,dI=/\s/,fI=`\r`,pI=`
278
- `,mI=`️`,hI=`‍`,gI=``,_I=null,vI=null;function yI(e=[]){let t={};tF.groups=t;let n=new tF;_I??=CI(kie),vI??=CI(Aie),$(n,`'`,PF),$(n,`{`,_F),$(n,`}`,vF),$(n,`[`,yF),$(n,`]`,bF),$(n,`(`,xF),$(n,`)`,SF),$(n,`<`,CF),$(n,`>`,wF),$(n,`(`,TF),$(n,`)`,EF),$(n,`「`,DF),$(n,`」`,OF),$(n,`『`,kF),$(n,`』`,AF),$(n,`<`,jF),$(n,`>`,MF),$(n,`&`,NF),$(n,`*`,FF),$(n,`@`,IF),$(n,"`",RF),$(n,`^`,zF),$(n,`:`,BF),$(n,`,`,VF),$(n,`$`,HF),$(n,`.`,UF),$(n,`=`,WF),$(n,`!`,GF),$(n,`-`,KF),$(n,`%`,qF),$(n,`|`,JF),$(n,`+`,YF),$(n,`#`,XF),$(n,`?`,ZF),$(n,`"`,QF),$(n,`/`,tI),$(n,`;`,eI),$(n,`~`,nI),$(n,`_`,rI),$(n,`\\`,LF),$(n,`・`,$F);let r=rF(n,uI,mF,{[KP]:!0});rF(r,uI,r);let i=rF(r,sI,sF,{[YP]:!0}),a=rF(r,cI,cF,{[XP]:!0}),o=rF(n,sI,aF,{[qP]:!0});rF(o,uI,i),rF(o,sI,o),rF(i,uI,i),rF(i,sI,i);let s=rF(n,cI,oF,{[JP]:!0});rF(s,sI),rF(s,uI,a),rF(s,cI,s),rF(a,uI,a),rF(a,sI),rF(a,cI,a);let c=$(n,pI,gF,{[$P]:!0}),l=$(n,fI,hF,{[$P]:!0}),u=rF(n,dI,hF,{[$P]:!0});$(n,gI,u),$(l,pI,c),$(l,gI,u),rF(l,dI,u),$(u,fI),$(u,pI),rF(u,dI,u),$(u,gI,u);let d=rF(n,lI,iI,{[QP]:!0});$(d,`#`),rF(d,lI,d),$(d,mI,d);let f=$(d,hI);$(f,`#`),rF(f,lI,d);let p=[[sI,o],[uI,i]],m=[[sI,null],[cI,s],[uI,a]];for(let e=0;e<_I.length;e++)SI(n,_I[e],uF,aF,p);for(let e=0;e<vI.length;e++)SI(n,vI[e],dF,oF,m);eF(uF,{tld:!0,ascii:!0},t),eF(dF,{utld:!0,alpha:!0},t),SI(n,`file`,fF,aF,p),SI(n,`mailto`,fF,aF,p),SI(n,`http`,pF,aF,p),SI(n,`https`,pF,aF,p),SI(n,`ftp`,pF,aF,p),SI(n,`ftps`,pF,aF,p),eF(fF,{scheme:!0,ascii:!0},t),eF(pF,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[jie]:!0}:{[Mie]:!0};r.indexOf(`-`)>=0?i[ZP]=!0:sI.test(r)?uI.test(r)?i[YP]=!0:i[qP]=!0:i[KP]=!0,iF(n,r,r,i)}return iF(n,`localhost`,lF,{ascii:!0}),n.jd=new tF(aI),{start:n,tokens:Object.assign({groups:t},oI)}}function bI(e,t){let n=xI(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function xI(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function SI(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new tF(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new tF(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function CI(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var wI={defaultProtocol:`http`,events:null,format:EI,formatHref:EI,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function TI(e,t=null){let n=Object.assign({},wI);e&&(n=Object.assign(n,e instanceof TI?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}TI.prototype={o:wI,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:wI[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function EI(e){return e}function DI(e,t){this.t=`token`,this.v=e,this.tk=t}DI.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=wI.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function OI(e,t){class n extends DI{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var kI=OI(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),AI=OI(`text`),jI=OI(`nl`),MI=OI(`url`,{isLink:!0,toHref(e=wI.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==lF&&e[1].t===BF}}),NI=e=>new tF(e);function PI({groups:e}){let t=e.domain.concat([NF,FF,IF,LF,RF,zF,HF,WF,KF,mF,qF,JF,YF,XF,tI,aI,nI,rI]),n=[PF,BF,VF,UF,GF,qF,ZF,QF,eI,CF,wF,_F,vF,bF,yF,xF,SF,TF,EF,DF,OF,kF,AF,jF,MF],r=[NF,PF,FF,LF,RF,zF,HF,WF,KF,_F,vF,qF,JF,YF,XF,ZF,tI,aI,nI,rI],i=NI(),a=$(i,nI);nF(a,r,a),nF(a,e.domain,a);let o=NI(),s=NI(),c=NI();nF(i,e.domain,o),nF(i,e.scheme,s),nF(i,e.slashscheme,c),nF(o,r,a),nF(o,e.domain,o);let l=$(o,IF);$(a,IF,l),$(s,IF,l),$(c,IF,l);let u=$(a,UF);nF(u,r,a),nF(u,e.domain,a);let d=NI();nF(l,e.domain,d),nF(d,e.domain,d);let f=$(d,UF);nF(f,e.domain,d);let p=NI(kI);nF(f,e.tld,p),nF(f,e.utld,p),$(l,lF,p);let m=$(d,KF);$(m,KF,m),nF(m,e.domain,d),nF(p,e.domain,d),$(p,UF,f),$(p,KF,m),nF($(p,BF),e.numeric,kI);let h=$(o,KF),g=$(o,UF);$(h,KF,h),nF(h,e.domain,o),nF(g,r,a),nF(g,e.domain,o);let _=NI(MI);nF(g,e.tld,_),nF(g,e.utld,_),nF(_,e.domain,o),nF(_,r,a),$(_,UF,g),$(_,KF,h),$(_,IF,l);let v=$(_,BF),y=NI(MI);nF(v,e.numeric,y);let b=NI(MI),x=NI();nF(b,t,b),nF(b,n,x),nF(x,t,b),nF(x,n,x),$(_,tI,b),$(y,tI,b);let S=$(s,BF),C=$($($(c,BF),tI),tI);nF(s,e.domain,o),$(s,UF,g),$(s,KF,h),nF(c,e.domain,o),$(c,UF,g),$(c,KF,h),nF(S,e.domain,b),$(S,tI,b),$(S,ZF,b),nF(C,e.domain,b),nF(C,t,b),$(C,tI,b);let w=[[_F,vF],[yF,bF],[xF,SF],[CF,wF],[TF,EF],[DF,OF],[kF,AF],[jF,MF]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=$(b,r);$(x,r,a),$(a,i,b);let o=NI(MI);nF(a,t,o);let s=NI();nF(a,n),nF(o,t,o),nF(o,n,s),nF(s,t,o),nF(s,n,s),$(o,i,b),$(s,i,b)}return $(i,lF,_),$(i,gF,jI),{start:i,tokens:oI}}function FI(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(II(AI,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(II(e,t,r))}}return o.length>0&&a.push(II(AI,t,o)),a}function II(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var LI=typeof console<`u`&&console&&console.warn||(()=>{}),RI=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,zI={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function BI(){return tF.groups={},zI.scanner=null,zI.parser=null,zI.tokenQueue=[],zI.pluginQueue=[],zI.customSchemes=[],zI.initialized=!1,zI}function VI(e,t=!1){if(zI.initialized&&LI(`linkifyjs: already initialized - will not register custom scheme "${e}" ${RI}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
279
- 1. Must only contain digits, lowercase ASCII letters or "-"
280
- 2. Cannot start or end with "-"
281
- 3. "-" cannot repeat`);zI.customSchemes.push([e,t])}function HI(){zI.scanner=yI(zI.customSchemes);for(let e=0;e<zI.tokenQueue.length;e++)zI.tokenQueue[e][1]({scanner:zI.scanner});zI.parser=PI(zI.scanner.tokens);for(let e=0;e<zI.pluginQueue.length;e++)zI.pluginQueue[e][1]({scanner:zI.scanner,parser:zI.parser});return zI.initialized=!0,zI}function UI(e){return zI.initialized||HI(),FI(zI.parser.start,e,bI(zI.scanner.start,e))}UI.scan=bI;function WI(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new TI(n),i=UI(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var GI=`[\0- \xA0 ᠎ -\u2029  ]`,KI=new RegExp(GI),qI=RegExp(`${GI}$`),JI=new RegExp(GI,`g`);function YI(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function XI(e){return new aw({key:new cw(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(mP(QN(n.doc,[...t])).forEach(({newRange:t})=>{let n=qne(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!qI.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(KI).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=UI(n).map(t=>t.toObject(e.defaultProtocol));if(!YI(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{hP(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function ZI(e){return new aw({key:new cw(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=ire(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function QI(e){return new aw({key:new cw(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=WI(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function $I(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(JI,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var eL=AP.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){VI(e);return}VI(e.scheme,e.optionalSlashes)})},onDestroy(){BI()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!$I(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!$I(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!$I(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,sP(this.options.HTMLAttributes,e),0]:[`a`,sP(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!$I(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!$I(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[UP({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=WI(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!$I(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(XI({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!$I(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(ZI({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(QI({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),tL=Object.defineProperty,nL=(e,t)=>{for(var n in t)tL(e,n,{get:t[n],enumerable:!0})},rL=`listItem`,iL=`textStyle`,aL=/^\s*([-+*])\s$/,oL=HP.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,sP(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
282
- `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rL,this.editor.getAttributes(iL)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=LP({find:aL,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=LP({find:aL,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(iL),editor:this.editor})),[e]}});function sL(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function cL(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var lL=HP.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,sP(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(sL(e))return{type:`listItem`,content:[{type:`paragraph`,content:cL(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>VP(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});nL({},{findListItemPos:()=>uL,getNextListDepth:()=>dL,handleBackspace:()=>hL,handleDelete:()=>vL,hasListBefore:()=>fL,hasListItemAfter:()=>yL,hasListItemBefore:()=>pL,listItemHasSubList:()=>mL,nextListIsDeeper:()=>gL,nextListIsHigher:()=>_L});var uL=(e,t)=>{let{$from:n}=t.selection,r=pN(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},dL=(e,t)=>{let n=uL(e,t);if(!n)return!1;let[,r]=sre(t,e,n.$pos.pos+4);return r},fL=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},pL=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},mL=(e,t,n)=>{if(!n)return!1;let r=pN(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},hL=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!JN(e.state,t)&&fL(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!JN(e.state,t)||!dre(e.state))return!1;let r=uL(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=mL(t,e.state,i);return pL(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},gL=(e,t)=>{let n=dL(e,t),r=uL(e,t);return!r||!n?!1:n>r.depth},_L=(e,t)=>{let n=dL(e,t),r=uL(e,t);return!r||!n?!1:n<r.depth},vL=(e,t)=>{if(!JN(e.state,t)||!ure(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:gL(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():_L(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},yL=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},bL=NP.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&vL(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&vL(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&hL(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&hL(e,n,r)&&(t=!0)}),t}}}}),xL=/^(\s*)(\d+)\.\s+(.*)$/,SL=/^\s/;function CL(e){let t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function wL(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&CL(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function TL(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(xL);if(!a)break;let[,o,s,c]=a,l=o.length,u=[c],d=n+1,f=[i],p=!1;for(;d<e.length;){let t=e[d];if(t.match(xL))break;if(t.trim()===``)f.push(t),u.push(``),p=!0,d+=1;else if(t.match(SL))f.push(t),u.push(t.slice(l+2)),d+=1;else{if(p)break;f.push(t),u.push(t),d+=1}}t.push({indent:l,number:parseInt(s,10),content:u.join(`
283
- `).trim(),contentLines:u,raw:f.join(`
284
- `)}),r=d,n=d}return[t,r]}function EL(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=wL(a.contentLines),c=o.join(`
285
- `).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
286
- `).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=EL(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,items:e,raw:f.map(e=>e.raw).join(`
287
- `)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function DL(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var OL=`listItem`,kL=`textStyle`,AL=/^(\d+)\.\s$/,jL=HP.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,sP(this.options.HTMLAttributes,n),0]:[`ol`,sP(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?DL(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
288
- `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
289
- `),[i,a]=TL(r);if(i.length===0)return;let o=EL(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
290
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(OL,this.editor.getAttributes(kL)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=LP({find:AL,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=LP({find:AL,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(kL)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),ML=/^\s*(\[([( |x])?\])\s$/,NL=HP.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,sP(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>VP(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=cP(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[LP({find:ML,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),PL=HP.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,sP(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
291
- `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=BP(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=BP(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});NP.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(oL.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(lL.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(bL.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(jL.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(NL.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(PL.configure(this.options.taskList)),e}});var FL=`&nbsp;`,IL=`\xA0`,LL=HP.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,sP(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===FL||n[0].text===FL||n[0].raw===IL||n[0].text===IL)&&r.length===1&&r[0].type===`text`&&(r[0].text===FL||r[0].text===IL)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?FL:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),RL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,zL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,BL=AP.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,sP(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[FP({find:RL,type:this.type})]},addPasteRules(){return[UP({find:zL,type:this.type})]}}),VL=HP.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),HL=AP.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,sP(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function UL(e={}){return new aw({view(t){return new WL(t,e)}})}var WL=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=gC(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},GL=class e extends LC{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):LC.near(r)}content(){return Q.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new KL(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!JL(e)||!YL(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!UC.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};GL.prototype.visible=!1,GL.findFrom=GL.findGapCursorFrom,LC.jsonID(`gapcursor`,GL);var KL=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return GL.valid(t)?new GL(t):LC.near(t)}};function qL(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function JL(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||qL(e.type))return!0;if(e.inlineContent)return!1}}return!0}function YL(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||qL(e.type))return!0;if(e.inlineContent)return!1}}return!0}function XL(){return new aw({props:{decorations:tR,createSelectionBetween(e,t,n){return t.pos==n.pos&&GL.valid(n)?new GL(n):null},handleClick:$L,handleKeyDown:ZL,handleDOMEvents:{beforeinput:eR}}})}var ZL=EO({ArrowLeft:QL(`horiz`,-1),ArrowRight:QL(`horiz`,1),ArrowUp:QL(`vert`,-1),ArrowDown:QL(`vert`,1)});function QL(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof VC){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=GL.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new GL(c))),!0):!1}}function $L(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!GL.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&UC.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new GL(r))),!0)}function eR(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof GL))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Z.empty;for(let e=r.length-1;e>=0;e--)i=Z.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new Q(i,0,0));return a.setSelection(VC.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function tR(e){if(!(e.selection instanceof GL))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,TD.create(e.doc,[SD.widget(e.selection.head,t,{key:`gapcursor`})])}var nR=200,rR=function(){};rR.prototype.append=function(e){return e.length?(e=rR.from(e),!this.length&&e||e.length<nR&&this.leafAppend(e)||this.length<nR&&e.leafPrepend(this)||this.appendInner(e)):this},rR.prototype.prepend=function(e){return e.length?rR.from(e).append(this):this},rR.prototype.appendInner=function(e){return new aR(this,e)},rR.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?rR.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},rR.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},rR.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},rR.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},rR.from=function(e){return e instanceof rR?e:e&&e.length?new iR(e):rR.empty};var iR=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=nR)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=nR)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(rR);rR.empty=new iR([]);var aR=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(rR),oR=500,sR=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new lR(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new lR(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new lR(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>dR&&(s=cR(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new PS;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new lR(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new lR(i,o,l))}else r.push(new lR(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new lR(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>oR&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new lR(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(rR.from(i.reverse()),a)}};sR.empty=new sR(rR.empty,0);function cR(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var lR=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},uR=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},dR=20;function fR(e,t,n,r){let i=n.getMeta(bR),a;if(i)return i.historyState;n.getMeta(xR)&&(e=new uR(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(bR))return o.getMeta(bR).redo?new uR(e.done.addTransform(n,void 0,r,yR(t)),e.undone,mR(n.mapping.maps),e.prevTime,e.prevComposition):new uR(e.done,e.undone.addTransform(n,void 0,r,yR(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!pR(n,e.prevRanges)),s=o?hR(e.prevRanges,n.mapping):mR(n.mapping.maps);return new uR(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,yR(t)),sR.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new uR(e.done.rebased(n,a),e.undone.rebased(n,a),hR(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new uR(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),hR(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function pR(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function mR(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function hR(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function gR(e,t,n){let r=yR(t),i=bR.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new uR(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(bR,{redo:n,historyState:c})}var _R=!1,vR=null;function yR(e){let t=e.plugins;if(vR!=t){_R=!1,vR=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){_R=!0;break}}return _R}var bR=new cw(`history`),xR=new cw(`closeHistory`);function SR(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new aw({key:bR,state:{init(){return new uR(sR.empty,sR.empty,null,0,-1)},apply(t,n,r){return fR(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?wR:n==`historyRedo`?TR:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function CR(e,t){return(n,r)=>{let i=bR.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=gR(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var wR=CR(!1,!0),TR=CR(!0,!0);NP.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new aw({key:new cw(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var ER=NP.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[UL(this.options)]}});NP.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new aw({key:new cw(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return TD.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(SD.node(t,t+e.nodeSize,{class:this.options.className}))}),TD.create(e,a)}}})]}});var DR=NP.create({name:`gapCursor`,addProseMirrorPlugins(){return[XL()]},extendNodeSchema(e){return{allowGapCursor:rP(eP(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),OR=`placeholder`;function kR(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}NP.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:OR,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${kR(this.options.dataAttribute)}`:`data-${OR}`;return[new aw({key:new cw(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&bP(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=SD.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),TD.create(t,a)}}})]}}),NP.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new aw({key:new cw(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||xP(n.selection)||e.view.dragging?null:TD.create(n.doc,[SD.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function AR({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var jR=NP.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new cw(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new aw({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!AR({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!AR({node:r,types:n})}}})]}}),MR=NP.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>wR(e,t),redo:()=>({state:e,dispatch:t})=>TR(e,t)}},addProseMirrorPlugins(){return[SR(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),NR=NP.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(pie.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(cie.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(oL.configure(this.options.bulletList)),this.options.code!==!1&&e.push(gie.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(yie.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(bie.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(ER.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(DR.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(xie.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Sie.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(MR.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Cie.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Oie.configure(this.options.italic)),this.options.listItem!==!1&&e.push(lL.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(bL.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(eL.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(jL.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(LL.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(BL.configure(this.options.strike)),this.options.text!==!1&&e.push(VL.configure(this.options.text)),this.options.underline!==!1&&e.push(HL.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(jR.configure(this.options?.trailingNode)),e}}),PR=e=>{if(!e.children.length)return;let t=e.querySelectorAll(`span`);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},FR=FA.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&PR(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,Rk(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),IR=UA.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>e.style.backgroundColor?.replace(/['"]+/g,``),renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark(`textStyle`,{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark(`textStyle`,{backgroundColor:null}).removeEmptyTextStyle().run()}}}),LR=UA.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>e.style.color?.replace(/['"]+/g,``),renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark(`textStyle`,{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark(`textStyle`,{color:null}).removeEmptyTextStyle().run()}}}),RR=UA.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark(`textStyle`,{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark(`textStyle`,{fontFamily:null}).removeEmptyTextStyle().run()}}}),zR=UA.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}}),BR=UA.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark(`textStyle`,{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark(`textStyle`,{lineHeight:null}).removeEmptyTextStyle().run()}}}),VR=UA.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(IR.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(LR.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(RR.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(zR.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(BR.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(FR.configure(this.options.textStyle)),e}}),HR=UA.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new aw({key:new cw(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});UA.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[UL(this.options)]}}),UA.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new aw({key:new cw(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return TD.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(SD.node(t,t+e.nodeSize,{class:this.options.className}))}),TD.create(e,a)}}})]}}),UA.create({name:`gapCursor`,addProseMirrorPlugins(){return[XL()]},extendNodeSchema(e){return{allowGapCursor:Pk(Ak(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}});var UR=`placeholder`;function WR(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var GR=UA.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:UR,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${WR(this.options.dataAttribute)}`:`data-${UR}`;return[new aw({key:new cw(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&xA(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=SD.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),TD.create(t,a)}}})]}});UA.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new aw({key:new cw(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||SA(n.selection)||e.view.dragging?null:TD.create(n.doc,[SD.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function KR({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}UA.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new cw(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new aw({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!KR({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!KR({node:r,types:n})}}})]}}),UA.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>wR(e,t),redo:()=>({state:e,dispatch:t})=>TR(e,t)}},addProseMirrorPlugins(){return[SR(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var qR=FA.create({name:`superscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sup`},{style:`vertical-align`,getAttrs(e){return e===`super`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sup`,Rk(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),JR=FA.create({name:`subscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sub`},{style:`vertical-align`,getAttrs(e){return e===`sub`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sub`,Rk(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),YR=UA.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).every(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),XR=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ZR=SM.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,Rk(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[yM({find:XR,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),QR=GR,$R=e=>String(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),ez=e=>{let t=document.createElement(`div`);t.innerHTML=e;let n=Array.from(t.children);return n.length<2||!n.every(e=>e.tagName===`DIV`)||!n.every(e=>e.attributes.length===0)||!n.every(e=>Array.from(e.children).every(e=>{let t=e.tagName;return[`SPAN`,`B`,`I`,`EM`,`STRONG`,`U`,`SUB`,`SUP`,`A`,`CODE`,`BR`].includes(t)}))?e:`<p>${n.map(e=>e.innerHTML).join(`<br>`)}</p>`},tz=e=>{let t=String(e??``).trim();return t?/<[^>]+>/.test(t)?ez(t):`<div>${$R(t)}</div>`:`<div></div>`},nz,rz;if(typeof WeakMap<`u`){let e=new WeakMap;nz=t=>e.get(t),rz=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;nz=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},rz=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var iz=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return nz(e)||rz(e,az(e))}};function az(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=oz(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new iz(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&sz(s,o,e),s}function oz(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function sz(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=cz(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function cz(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function lz(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var uz=new cw(`selectingCells`);function dz(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function fz(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function pz(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function mz(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=dz(t.$head)||hz(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function hz(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function gz(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function _z(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function vz(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function yz(e,t,n){let r=e.node(-1),i=iz.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function bz(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function xz(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Sz(e,t,n){let r=lz(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var Cz=class e extends LC{constructor(e,t=e){let n=e.node(-1),r=iz.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new RC(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(gz(r)&&gz(i)&&vz(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return VC.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=iz.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=bz(e,0,l)),u>0&&(e=bz(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(Z.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new Q(Z.from(o),1,1)}replace(e,t=Q.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?Q.empty:t)}let i=LC.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new Q(Z.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=iz.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=iz.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=iz.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=iz.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new wz(this.$anchorCell.pos,this.$headCell.pos)}};Cz.prototype.visible=!1,LC.jsonID(`cell`,Cz);var wz=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&vz(t,n)?new Cz(t,n):LC.near(n,1)}};function Tz(e){if(!(e.selection instanceof Cz))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(SD.node(n,n+e.nodeSize,{class:`selectedCell`}))}),TD.create(e.doc,t)}function Ez({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Dz({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Oz(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof UC&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=Cz.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=Cz.rowSelection(e,e)}else if(!n){let e=iz.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=Cz.create(i,t+1,n)}}else r instanceof VC&&Ez(r)?a=VC.create(i,r.from):r instanceof VC&&Dz(r)&&(a=VC.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var kz=new cw(`fix-tables`);function Az(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?Az(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function jz(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=Mz(e,t,r,n))};return t?t.doc!=e.doc&&Az(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Mz(e,t,n,r){let i=iz.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,bz(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=lz(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(kz,{fixTables:!0})}function Nz(e){let t=e.selection,n=mz(e),r=n.node(-1),i=n.start(-1),a=iz.get(r);return{...t instanceof Cz?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function Pz(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Sz(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xz(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?lz(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Fz(e,t){if(!pz(e))return!1;if(t){let n=Nz(e);t(Pz(e.tr,n,n.left))}return!0}function Iz(e,t){if(!pz(e))return!1;if(t){let n=Nz(e);t(Pz(e.tr,n,n.right))}return!0}function Lz(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,bz(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Rz(e,t){if(!pz(e))return!1;if(t){let n=Nz(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Lz(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=iz.get(e)}t(r)}return!0}function zz(e,t,n){let r=lz(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function Bz(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;zz(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?lz(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,lz(r.type.schema).row.create(null,o)),e}function Vz(e,t){if(!pz(e))return!1;if(t){let n=Nz(e);t(Bz(e.tr,n,n.top))}return!0}function Hz(e,t){if(!pz(e))return!1;if(t){let n=Nz(e);t(Bz(e.tr,n,n.bottom))}return!0}function Uz(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Wz(e,t){if(!pz(e))return!1;if(t){let n=Nz(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Uz(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=iz.get(n.table)}t(r)}return!0}function Gz(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Kz({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function qz(e,t){let n=e.selection;if(!(n instanceof Cz)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Nz(e),{map:i}=r;if(Kz(i,r))return!1;if(t){let n=e.tr,a={},o=Z.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{Gz(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...xz(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=Gz(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new Cz(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function Jz(e,t){let n=lz(e.schema);return Yz(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Yz(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof Cz){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=fz(r.$from),!i)return!1;a=dz(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=Nz(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof Cz&&u.setSelection(new Cz(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Xz(e,t){return function(n,r){if(!pz(n))return!1;let i=mz(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof Cz?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Zz(e){return function(t,n){if(!pz(t))return!1;if(n){let r=lz(t.schema),i=Nz(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Qz(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function $z(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Zz(e):function(t,n){if(!pz(t))return!1;if(n){let r=lz(t.schema),i=Nz(t),a=t.tr,o=Qz(`row`,i,r),s=Qz(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}$z(`row`,{useDeprecatedLogic:!0}),$z(`column`,{useDeprecatedLogic:!0});var eB=$z(`cell`,{useDeprecatedLogic:!0});function tB(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function nB(e){return function(t,n){if(!pz(t))return!1;let r=tB(mz(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(VC.between(e,_z(e))).scrollIntoView())}return!0}}function rB(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function iB(e,t){let n=e.selection;if(!(n instanceof Cz))return!1;if(t){let r=e.tr,i=lz(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new Q(i,0,0))}),r.docChanged&&t(r)}return!0}function aB(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=sB(lz(o).row,new Q(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?sB(lz(o).row,new Q(t,n,r)).content:t);else return null;return oB(o,s)}function oB(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(Z.empty),n[i]<r){let a=lz(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(Z.from(o))}return{height:t.length,width:r,rows:t}}function sB(e,t){let n=e.createAndFill();return new FC(n).replace(0,n.content.size,t).doc}function cB({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(bz(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(Z.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(Z.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function lB(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=lz(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,Z.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function uB(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function dB(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,bz(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(bz(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function fB(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=iz.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=iz.get(a),f=d.mapping.maps.length}lB(d,o,a,n,l,u,f)&&p(),uB(d,o,a,n,c,l,s,f)&&p(),uB(d,o,a,n,c,l,u,f)&&p(),dB(d,o,a,n,s,u,c,f)&&p(),dB(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new Q(i.rows[e-s],0,0))}p(),d.setSelection(new Cz(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var pB=EO({ArrowLeft:hB(`horiz`,-1),ArrowRight:hB(`horiz`,1),ArrowUp:hB(`vert`,-1),ArrowDown:hB(`vert`,1),"Shift-ArrowLeft":gB(`horiz`,-1),"Shift-ArrowRight":gB(`horiz`,1),"Shift-ArrowUp":gB(`vert`,-1),"Shift-ArrowDown":gB(`vert`,1),Backspace:iB,"Mod-Backspace":iB,Delete:iB,"Mod-Delete":iB});function mB(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function hB(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof Cz)return mB(n,r,LC.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=bB(i,e,t);if(o==null)return!1;if(e==`horiz`)return mB(n,r,LC.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=yz(i,e,t),s;return s=a?LC.near(a,1):t<0?LC.near(n.doc.resolve(i.before(-1)),-1):LC.near(n.doc.resolve(i.after(-1)),1),mB(n,r,s)}}}function gB(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof Cz)o=a;else{let r=bB(i,e,t);if(r==null)return!1;o=new Cz(n.doc.resolve(r))}let s=yz(o.$headCell,e,t);return s?mB(n,r,new Cz(o.$anchorCell,s)):!1}}function _B(e,t){let n=e.state.doc,r=dz(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Cz(r))),!0):!1}function vB(e,t,n){if(!pz(e.state))return!1;let r=aB(n),i=e.state.selection;if(i instanceof Cz){r||={width:1,height:1,rows:[Z.from(sB(lz(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=iz.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=cB(r,o.right-o.left,o.bottom-o.top),fB(e.state,e.dispatch,a,o,r),!0}else if(r){let t=mz(e.state),n=t.start(-1);return fB(e.state,e.dispatch,n,iz.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function yB(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=xB(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof Cz)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=dz(e.state.selection.$anchor))!=null&&SB(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=SB(e,n),i=uz.getState(e.state)==null;if(!r||!vz(t,r))if(i)r=t;else return;let a=new Cz(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(uz,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),uz.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(uz,-1))}function o(r){let o=r,s=uz.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(xB(e,o.target)!=n&&(c=SB(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function bB(e,t,n){if(!(e.state.selection instanceof VC))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function xB(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function SB(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&dz(e.state.doc.resolve(r))||dz(e.state.doc.resolve(i))}var CB=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),wB(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,wB(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function wB(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var TB=new cw(`tableColumnResizing`);function EB({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=CB,lastColumnResizable:i=!0}={}){let a=new aw({key:TB,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=lz(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new DB(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=TB.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{OB(t,n,e,i)},mouseleave:e=>{kB(e)},mousedown:(e,r)=>{AB(e,r,t,n)}},decorations:e=>{let t=TB.getState(e);if(t&&t.activeHandle>-1)return zB(e,t.activeHandle)},nodeViews:{}}});return a}var DB=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(TB);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return gz(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function OB(e,t,n,r){if(!e.editable)return;let i=TB.getState(e.state);if(i&&!i.dragging){let a=MB(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=NB(e,t,`left`,n):i-t.clientX<=n&&(o=NB(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=iz.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}FB(e,o)}}}function kB(e){if(!e.editable)return;let t=TB.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&FB(e,-1)}function AB(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=TB.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=jB(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(TB,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=TB.getState(e.state);r?.dragging&&(IB(e,r.activeHandle,PB(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(TB,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=TB.getState(e.state);if(i&&i.dragging){let a=PB(i.dragging,t,n);LB(e,i.activeHandle,a,r)}}return LB(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function jB(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function MB(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function NB(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=dz(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=iz.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function PB(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function FB(e,t){e.dispatch(e.state.tr.setMeta(TB,{setHandle:t}))}function IB(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=iz.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():RB(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function LB(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=iz.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&wB(a,c.firstChild,c,r,s,n)}function RB(e){return Array(e).fill(0)}function zB(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return TD.empty;let a=iz.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,TB.getState(e)?.dragging&&n.push(SD.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(SD.widget(s,c))}}return TD.create(e.doc,n)}function BB({allowTableNodeSelection:e=!1}={}){return new aw({key:uz,state:{init(){return null},apply(e,t){let n=e.getMeta(uz);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Tz,handleDOMEvents:{mousedown:yB},createSelectionBetween(e){return uz.getState(e.state)==null?null:e.state.selection},handleTripleClick:_B,handleKeyDown:pB,handlePaste:vB},appendTransaction(t,n,r){return Oz(r,jz(r,n),e)}})}var VB=SM.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,Rk(this.options.HTMLAttributes,e),0]}}),HB=SM.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,Rk(this.options.HTMLAttributes,e),0]}}),UB=SM.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,Rk(this.options.HTMLAttributes,e),0]}});function WB(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function GB(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=WB(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=WB(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}c?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var KB=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),GB(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,GB(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){return e.type===`attributes`&&(e.target===this.table||this.colgroup.contains(e.target))}};function qB(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=WB(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function JB(e,t){return t?e.createChecked(null,t):e.createAndFill()}function YB(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function XB(e,t,n,r,i){let a=YB(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=JB(a.cell,i);if(e&&s.push(e),r){let e=JB(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function ZB(e){return e instanceof Cz}var QB=({editor:e})=>{let{selection:t}=e.state;if(!ZB(t))return!1;let n=0;return Ok(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},$B=SM.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:KB,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=qB(e,this.options.cellMinWidth);return[`table`,Rk(this.options.HTMLAttributes,t,{style:r?`width: ${r}`:`min-width: ${i}`}),n,[`tbody`,0]]},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=XB(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(VC.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Fz(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Iz(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Rz(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Vz(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Hz(e,t),deleteRow:()=>({state:e,dispatch:t})=>Wz(e,t),deleteTable:()=>({state:e,dispatch:t})=>rB(e,t),mergeCells:()=>({state:e,dispatch:t})=>qz(e,t),splitCell:()=>({state:e,dispatch:t})=>Jz(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>$z(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>$z(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>eB(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>qz(e,t)?!0:Jz(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>Xz(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>nB(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>nB(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&jz(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=Cz.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:QB,"Mod-Backspace":QB,Delete:QB,"Mod-Delete":QB}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[EB({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],BB({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:Pk(Ak(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});UA.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push($B.configure(this.options.table)),this.options.tableCell!==!1&&e.push(VB.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(HB.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(UB.configure(this.options.tableRow)),e}});var eV=(e,t)=>{let n=t?.border!=null&&t.border!==``?t.border:`1`;e.setAttribute(`border`,n),e.style.setProperty(`color`,`var(--pie-text, black)`),e.style.setProperty(`background-color`,`var(--pie-background, rgba(255, 255, 255))`)},tV=class extends KB{constructor(e,t,n){super(e,t,n),eV(this.table,e.attrs)}update(e){let t=super.update(e);return t&&eV(this.table,e.attrs),t}},nV=$B.extend({addOptions(){return{...this.parent?.(),resizable:!0,handleWidth:0,View:tV}},addAttributes(){return{border:{default:`1`}}},renderHTML(e){let t=this.parent(e),{border:n}=e.HTMLAttributes,r=`${t[1].style}${t[1].style.match(/.*; */)?``:`;`}`;return t[1].style=`${r}
292
- color: var(--pie-text, black);
293
- background-color: var(--pie-background, rgba(255, 255, 255))`,t[1].border=n||`1`,t}}),rV=`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`,iV=VB.extend({content:rV}),aV=HB.extend({content:rV}),oV=SM.create({name:`div`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`div`}]},renderHTML({HTMLAttributes:e}){return[`div`,e,0]},addKeyboardShortcuts(){let e=e=>{for(let t=e.depth;t>=0;--t)if(e.node(t).type.name===`listItem`)return!0;return!1};return{Enter:()=>{let{state:t}=this.editor,{$from:n}=t.selection;return n.parent.type.name!==`div`||e(n)?!1:this.editor.chain().focus().setNode(`paragraph`).splitBlock().run()},Backspace:()=>{let{state:e}=this.editor,{$from:t,empty:n}=e.selection;if(t.parent.type.name!==`div`||!n)return!1;let r=t.parent.textContent;if(r.length===0)return e.doc.childCount===1;if(r.length===1&&t.parentOffset===1){let{tr:n}=e;return n.delete(t.pos-1,t.pos),this.editor.view.dispatch(n),!0}return!1}}}}),sV=UA.create({name:`ensureEmptyRootIsDiv`,addProseMirrorPlugins(){return[new aw({key:new cw(this.name),appendTransaction(e,t,n){if(!e.some(e=>e.docChanged))return null;let{doc:r}=n;if(r.childCount!==1)return null;let i=r.firstChild;if(i.type.name!==`paragraph`||i.content.size>0)return null;let a=n.schema.nodes.div;if(!a)return null;let o=i.nodeSize;return n.tr.replaceWith(0,o,a.create())}})]}}),cV=UA.create({name:`ensureListItemContentIsDiv`,addProseMirrorPlugins(){return[new aw({key:new cw(this.name),appendTransaction(e,t,n){if(!e.some(e=>e.docChanged))return null;let{doc:r,schema:i}=n,a=i.nodes.div;if(!a)return null;let o=[];if(r.descendants((e,t)=>{if(e.type.name!==`listItem`)return;let n=1;e.forEach(e=>{e.type.name===`paragraph`&&o.push({pos:t+n,attrs:e.attrs}),n+=e.nodeSize})}),o.length===0)return null;let s=n.tr;return o.sort((e,t)=>t.pos-e.pos).forEach(({pos:e,attrs:t})=>s.setNodeMarkup(e,a,t)),s}})]}});function lV(e){return Qr(`MuiIconButton`,e)}var uV=$r(`MuiIconButton`,[`root`,`disabled`,`colorInherit`,`colorPrimary`,`colorSecondary`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`,`edgeStart`,`edgeEnd`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`loading`,`loadingIndicator`,`loadingWrapper`]);M();var dV=e=>{let{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e;return ba({root:[`root`,o&&`loading`,n&&`disabled`,r!==`default`&&`color${P_(r)}`,i&&`edge${P_(i)}`,`size${P_(a)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},lV,t)},fV=J(gy,{name:`MuiIconButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!==`default`&&t[`color${P_(n.color)}`],n.edge&&t[`edge${P_(n.edge)}`],t[`size${P_(n.size)}`]]}})(y_(({theme:e})=>({textAlign:`center`,flex:`0 0 auto`,fontSize:e.typography.pxToRem(24),padding:8,borderRadius:`50%`,color:(e.vars||e).palette.action.active,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:`var(--IconButton-hoverBg)`,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:{edge:`start`},style:{marginLeft:-12}},{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:{edge:`end`},style:{marginRight:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}}]})),y_(({theme:e})=>({variants:[{props:{color:`inherit`},style:{color:`inherit`}},...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:`small`},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:`large`},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${uV.disabled}`]:{backgroundColor:`transparent`,color:(e.vars||e).palette.action.disabled},[`&.${uV.loading}`]:{color:`transparent`}}))),pV=J(`span`,{name:`MuiIconButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:`flex`}}]})),mV=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiIconButton`}),{edge:r=!1,children:i,className:a,color:o=`default`,disabled:s=!1,disableFocusRipple:c=!1,size:l=`medium`,id:u,loading:d=null,loadingIndicator:f,...p}=n,m=B_(u),h=f??(0,G.jsx)(My,{"aria-labelledby":m,color:`inherit`,size:16}),g={...n,edge:r,color:o,disabled:s,disableFocusRipple:c,loading:d,loadingIndicator:h,size:l},_=dV(g);return(0,G.jsxs)(fV,{id:d?m:u,className:K(_.root,a),centerRipple:!0,focusRipple:!c,disabled:s||d,ref:t,...p,ownerState:g,children:[typeof d==`boolean`&&(0,G.jsx)(`span`,{className:_.loadingWrapper,style:{display:`contents`},children:(0,G.jsx)(pV,{className:_.loadingIndicator,ownerState:g,children:d&&h})}),i]})}),hV=L_((0,G.jsx)(`path`,{d:`M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z`}),`Delete`),gV=`pie-toolbar`,_V=L_((0,G.jsx)(`path`,{d:`M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z`}),`Check`);M();var vV=J(mV)({verticalAlign:`top`,width:`28px`,height:`28px`,color:`var(--editable-html-toolbar-check, #00bb00)`,padding:`4px`}),yV=({onClick:e,doneButtonRef:t})=>(0,G.jsx)(vV,{"aria-label":`Done`,buttonRef:t,onClick:e,children:(0,G.jsx)(_V,{})});yV.propTypes={onClick:j.func,doneButtonRef:j.func};var bV=yV,xV=J(`div`,{shouldForwardProp:e=>![`showDone`,`toolbarAlignment`,`isFocused`,`autoWidth`,`isHidden`].includes(e)})(({showDone:e,toolbarAlignment:t,isFocused:n,autoWidth:r,isHidden:i})=>({position:`absolute`,zIndex:10,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:e?`280px`:`265px`,margin:`5px 0 0 0`,padding:`2px`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,boxSizing:`border-box`,display:`flex`,opacity:1,...t===`right`&&{right:0},...r?{width:`auto`}:{width:`100%`},...i&&{visibility:`hidden`}})),SV=J(mV)({width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`}),CV=J(`div`)({display:`flex`});function wV(e){let{children:t,deletable:n,toolbarOpts:r,autoWidth:i,isFocused:a,doneButtonRef:o,onDelete:s,showDone:c,onDone:l,style:u}=e,d=r.minWidth===void 0?{}:{minWidth:r.minWidth};return(0,G.jsxs)(xV,{className:gV,showDone:c,toolbarAlignment:r.alignment,isFocused:r.alwaysVisible||a,autoWidth:i,isHidden:r.isHidden===!0,style:{...d,...u},children:[t,(0,G.jsxs)(CV,{children:[n&&(0,G.jsx)(SV,{"aria-label":`Delete`,onMouseDown:e=>s?.(e),children:(0,G.jsx)(hV,{})}),c&&(0,G.jsx)(bV,{doneButtonRef:o,onClick:l})]})]})}M();var TV=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{value:s}=o,{respAreaToolbar:c,error:l}=i,u=r(),[d,f]=(0,W.useState)(!1),p=c([n,u],t,()=>{}),m=(0,W.useRef)(null),h;if(l){let e=l(),t=parseInt(o.index,10);h=!!e?.[t]?.[0]}return(0,W.useEffect)(()=>{let{selection:e}=t.state,r=e.from+n.nodeSize===e.to;a?r&&f(a):f(a)},[t,n,a]),(0,W.useEffect)(()=>{let e=e=>{!(e.target.closest(`.insert-character-dialog`)||e.target.closest(`[data-toolbar-for]`))&&m.current&&!m.current.contains(e.target)&&!e.target.closest(`[data-inline-node]`)&&f(!1)};return d?document.addEventListener(`mousedown`,e):document.removeEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[d]),(0,G.jsxs)(KM,{className:`drag-in-the-blank`,"data-selected":a,style:{display:`inline-flex`,minHeight:`55px`,position:`relative`,cursor:`pointer`},children:[(0,G.jsx)(`div`,{...o,style:{display:`inline-flex`,width:`100%`,minHeight:`46px`,height:`46px`,backgroundColor:`#FFF`,border:`1px solid ${h?`red`:`#C0C3CF`}`,boxSizing:`border-box`,borderRadius:`4px`,overflow:`hidden`,padding:`12px 21px`,margin:`0 4px`,minWidth:`178px`,visibility:d?`hidden`:`visible`},onClick:()=>f(!0),dangerouslySetInnerHTML:{__html:s||`<div>&nbsp;</div>`}}),d&&(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(`div`,{ref:m,className:`absolute z-50 bg-white shadow-lg rounded p-2`,style:{zIndex:1},children:(0,G.jsx)(p,{})}),t._tiptapContainerEl&&Vg.createPortal((0,G.jsx)(wV,{deletable:!0,toolbarOpts:{minWidth:`auto`},autoWidth:!0,style:{top:-40,left:0,right:0},onDelete:()=>{let{tr:e}=t.state;e.delete(u,u+n.nodeSize),t._toolbarOpened=!1,t.view.dispatch(e),f(!1),t.commands.focus()},showDone:!1}),t._tiptapContainerEl)]})]})};TV.propTypes={attributes:j.object,error:j.any,value:j.string,isFocused:j.bool};var EV=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function DV(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function OV(e){return`nodeType`in e}function kV(e){return e?DV(e)?e:OV(e)?e.ownerDocument?.defaultView??window:window:window}function AV(e){let{Document:t}=kV(e);return e instanceof t}function jV(e){return DV(e)?!1:e instanceof kV(e).HTMLElement}function MV(e){return e instanceof kV(e).SVGElement}function NV(e){return e?DV(e)?e.document:OV(e)?AV(e)?e:jV(e)||MV(e)?e.ownerDocument:document:document:document}var PV=EV?W.useLayoutEffect:W.useEffect;function FV(e){let t=(0,W.useRef)(e);return PV(()=>{t.current=e}),(0,W.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current==null?void 0:t.current(...n)},[])}function IV(){let e=(0,W.useRef)(null);return[(0,W.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,W.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function LV(e,t){t===void 0&&(t=[e]);let n=(0,W.useRef)(e);return PV(()=>{n.current!==e&&(n.current=e)},t),n}function RV(e,t){let n=(0,W.useRef)();return(0,W.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function zV(e){let t=FV(e),n=(0,W.useRef)(null);return[n,(0,W.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function BV(e){let t=(0,W.useRef)();return(0,W.useEffect)(()=>{t.current=e},[e]),t.current}var VV={};function HV(e,t){return(0,W.useMemo)(()=>{if(t)return t;let n=VV[e]==null?0:VV[e]+1;return VV[e]=n,e+`-`+n},[e,t])}function UV(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var WV=UV(1),GV=UV(-1);function KV(e){return`clientX`in e&&`clientY`in e}function qV(e){if(!e)return!1;let{KeyboardEvent:t}=kV(e.target);return t&&e instanceof t}function JV(e){if(!e)return!1;let{TouchEvent:t}=kV(e.target);return t&&e instanceof t}function YV(e){if(JV(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return KV(e)?{x:e.clientX,y:e.clientY}:null}var XV=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[XV.Translate.toString(e),XV.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ZV=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function QV(e){return e.matches(ZV)?e:e.querySelector(ZV)}var $V={display:`none`};function eH(e){let{id:t,value:n}=e;return W.createElement(`div`,{id:t,style:$V},n)}function tH(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return W.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function nH(){let[e,t]=(0,W.useState)(``);return{announce:(0,W.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var rH=(0,W.createContext)(null);function iH(e){let t=(0,W.useContext)(rH);(0,W.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function aH(){let[e]=(0,W.useState)(()=>new Set),t=(0,W.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,W.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var oH={draggable:`
294
- To pick up a draggable item, press the space bar.
295
- While dragging, use the arrow keys to move the item.
296
- Press space again to drop the item in its new position, or press escape to cancel.
297
- `},sH={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function cH(e){let{announcements:t=sH,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=oH}=e,{announce:a,announcement:o}=nH(),s=HV(`DndLiveRegion`),[c,l]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{l(!0)},[]),iH((0,W.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=W.createElement(W.Fragment,null,W.createElement(eH,{id:r,value:i.draggable}),W.createElement(tH,{id:s,announcement:o}));return n?(0,Vg.createPortal)(u,n):u}var lH;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(lH||={});function uH(){}function dH(e,t){return(0,W.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function fH(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,W.useMemo)(()=>[...t].filter(e=>e!=null),[...t])}var pH=Object.freeze({x:0,y:0});function mH(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function hH(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function gH(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var _H=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=gH(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(mH)};function vH(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function yH(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pH}function bH(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var xH=bH(1);function SH(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function CH(e,t,n){let r=SH(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var wH={ignoreTransform:!1};function TH(e,t){t===void 0&&(t=wH);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=kV(e).getComputedStyle(e);t&&(n=CH(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function EH(e){return TH(e,{ignoreTransform:!0})}function DH(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function OH(e,t){return t===void 0&&(t=kV(e).getComputedStyle(e)),t.position===`fixed`}function kH(e,t){t===void 0&&(t=kV(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function AH(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(AV(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!jV(i)||MV(i)||n.includes(i))return n;let a=kV(e).getComputedStyle(i);return i!==e&&kH(i,a)&&n.push(i),OH(i,a)?n:r(i.parentNode)}return e?r(e):n}function jH(e){let[t]=AH(e,1);return t??null}function MH(e){return!EV||!e?null:DV(e)?e:OV(e)?AV(e)||e===NV(e).scrollingElement?window:jV(e)?e:null:null}function NH(e){return DV(e)?e.scrollX:e.scrollLeft}function PH(e){return DV(e)?e.scrollY:e.scrollTop}function FH(e){return{x:NH(e),y:PH(e)}}var IH;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(IH||={});function LH(e){return!EV||!e?!1:e===document.scrollingElement}function RH(e){let t={x:0,y:0},n=LH(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var zH={x:.2,y:.2};function BH(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=zH);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=RH(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=IH.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=IH.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=IH.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=IH.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function VH(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function HH(e){return e.reduce((e,t)=>WV(e,FH(t)),pH)}function UH(e){return e.reduce((e,t)=>e+NH(t),0)}function WH(e){return e.reduce((e,t)=>e+PH(t),0)}function GH(e,t){if(t===void 0&&(t=TH),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);jH(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var KH=[[`x`,[`left`,`right`],UH],[`y`,[`top`,`bottom`],WH]],qH=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=AH(t),r=HH(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of KH)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},JH=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function YH(e){let{EventTarget:t}=kV(e);return e instanceof t?e:NV(e)}function XH(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var ZH;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(ZH||={});function QH(e){e.preventDefault()}function $H(e){e.stopPropagation()}var eU;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(eU||={});var tU={start:[eU.Space,eU.Enter],cancel:[eU.Esc],end:[eU.Space,eU.Enter,eU.Tab]},nU=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case eU.Right:return{...n,x:n.x+25};case eU.Left:return{...n,x:n.x-25};case eU.Down:return{...n,y:n.y+25};case eU.Up:return{...n,y:n.y-25}}},rU=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new JH(NV(t)),this.windowListeners=new JH(kV(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ZH.Resize,this.handleCancel),this.windowListeners.add(ZH.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ZH.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&GH(n),t(pH)}handleKeyDown(e){if(qV(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=tU,coordinateGetter:a=nU,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:pH;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=GV(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=RH(n),p=VH(n),m={x:Math.min(i===eU.Right?p.right-p.width/2:p.right,Math.max(i===eU.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===eU.Down?p.bottom-p.height/2:p.bottom,Math.max(i===eU.Down?p.top:p.top+p.height/2,u.y))},h=i===eU.Right&&!s||i===eU.Left&&!c,g=i===eU.Down&&!l||i===eU.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===eU.Right&&e<=d.x||i===eU.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===eU.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===eU.Down&&e<=d.y||i===eU.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===eU.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,WV(GV(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};rU.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=tU,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function iU(e){return!!(e&&`distance`in e)}function aU(e){return!!(e&&`delay`in e)}var oU=class{constructor(e,t,n){n===void 0&&(n=YH(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=NV(i),this.documentListeners=new JH(this.document),this.listeners=new JH(n),this.windowListeners=new JH(kV(i)),this.initialCoordinates=YV(r)??pH,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(ZH.Resize,this.handleCancel),this.windowListeners.add(ZH.DragStart,QH),this.windowListeners.add(ZH.VisibilityChange,this.handleCancel),this.windowListeners.add(ZH.ContextMenu,QH),this.documentListeners.add(ZH.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(aU(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(iU(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ZH.Click,$H,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ZH.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=YV(e)??pH,s=GV(n,o);if(!t&&a){if(iU(a)){if(a.tolerance!=null&&XH(s,a.tolerance))return this.handleCancel();if(XH(s,a.distance))return this.handleStart()}if(aU(a)&&XH(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===eU.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},sU={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},cU=class extends oU{constructor(e){let{event:t}=e,n=NV(t.target);super(e,sU,n)}};cU.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var lU={move:{name:`mousemove`},end:{name:`mouseup`}},uU;(function(e){e[e.RightClick=2]=`RightClick`})(uU||={});var dU=class extends oU{constructor(e){super(e,lU,NV(e.event.target))}};dU.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===uU.RightClick?!1:(r?.({event:n}),!0)}}];var fU={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},pU=class extends oU{constructor(e){super(e,fU)}static setup(){return window.addEventListener(fU.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(fU.move.name,e)};function e(){}}};pU.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var mU;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(mU||={});var hU;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(hU||={});function gU(e){let{acceleration:t,activator:n=mU.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=hU.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=vU({delta:d,disabled:!a}),[m,h]=IV(),g=(0,W.useRef)({x:0,y:0}),_=(0,W.useRef)({x:0,y:0}),v=(0,W.useMemo)(()=>{switch(n){case mU.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case mU.DraggableRect:return i}},[n,i,c]),y=(0,W.useRef)(null),b=(0,W.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,W.useMemo)(()=>s===hU.TreeOrder?[...l].reverse():l,[s,l]);(0,W.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=BH(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var _U={x:{[IH.Backward]:!1,[IH.Forward]:!1},y:{[IH.Backward]:!1,[IH.Forward]:!1}};function vU(e){let{delta:t,disabled:n}=e,r=BV(t);return RV(e=>{if(n||!r||!e)return _U;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[IH.Backward]:e.x[IH.Backward]||i.x===-1,[IH.Forward]:e.x[IH.Forward]||i.x===1},y:{[IH.Backward]:e.y[IH.Backward]||i.y===-1,[IH.Forward]:e.y[IH.Forward]||i.y===1}}},[n,t,r])}function yU(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return RV(e=>t==null?null:r??e??null,[r,t])}function bU(e,t){return(0,W.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var xU;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(xU||={});var SU;(function(e){e.Optimized=`optimized`})(SU||={});var CU=new Map;function wU(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,W.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,W.useRef)(e),d=g(),f=LV(d),p=(0,W.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,W.useRef)(null),h=RV(t=>{if(d&&!n)return CU;if(!t||t===CU||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new qH(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,W.useEffect)(()=>{u.current=e},[e]),(0,W.useEffect)(()=>{d||p()},[n,d]),(0,W.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,W.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case xU.Always:return!1;case xU.BeforeDragging:return n;default:return!n}}}function TU(e,t){return RV(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function EU(e,t){return TU(e,t)}function DU(e){let{callback:t,disabled:n}=e,r=FV(t),i=(0,W.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,W.useEffect)(()=>()=>i?.disconnect(),[i]),i}function OU(e){let{callback:t,disabled:n}=e,r=FV(t),i=(0,W.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,W.useEffect)(()=>()=>i?.disconnect(),[i]),i}function kU(e){return new qH(TH(e),e)}function AU(e,t,n){t===void 0&&(t=kU);let[r,i]=(0,W.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=DU({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=OU({callback:a});return PV(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function jU(e){return yH(e,TU(e))}var MU=[];function NU(e){let t=(0,W.useRef)(e),n=RV(n=>e?n&&n!==MU&&e&&t.current&&e.parentNode===t.current.parentNode?n:AH(e):MU,[e]);return(0,W.useEffect)(()=>{t.current=e},[e]),n}function PU(e){let[t,n]=(0,W.useState)(null),r=(0,W.useRef)(e),i=(0,W.useCallback)(e=>{let t=MH(e.target);t&&n(e=>e?(e.set(t,FH(t)),new Map(e)):null)},[]);return(0,W.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=MH(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,FH(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{MH(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,W.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>WV(e,t),pH):HH(e):pH,[e,t])}function FU(e,t){t===void 0&&(t=[]);let n=(0,W.useRef)(null);return(0,W.useEffect)(()=>{n.current=null},t),(0,W.useEffect)(()=>{let t=e!==pH;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?GV(e,n.current):pH}function IU(e){(0,W.useEffect)(()=>{if(!EV)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function LU(e,t){return(0,W.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function RU(e){return(0,W.useMemo)(()=>e?DH(e):null,[e])}var zU=[];function BU(e,t){t===void 0&&(t=TH);let[n]=e,r=RU(n?kV(n):null),[i,a]=(0,W.useState)(zU);function o(){a(()=>e.length?e.map(e=>LH(e)?r:new qH(t(e),e)):zU)}let s=OU({callback:o});return PV(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function VU(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return jV(t)?t:e}function HU(e){let{measure:t}=e,[n,r]=(0,W.useState)(null),i=OU({callback:(0,W.useCallback)(e=>{for(let{target:n}of e)if(jV(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=zV((0,W.useCallback)(e=>{let n=VU(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,W.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var UU=[{sensor:cU,options:{}},{sensor:rU,options:{}}],WU={current:{}},GU={draggable:{measure:EH},droppable:{measure:EH,strategy:xU.WhileDragging,frequency:SU.Optimized},dragOverlay:{measure:TH}},KU=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},qU={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new KU,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:uH},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:GU,measureDroppableContainers:uH,windowRect:null,measuringScheduled:!1},JU={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:uH,draggableNodes:new Map,over:null,measureDroppableContainers:uH},YU=(0,W.createContext)(JU),XU=(0,W.createContext)(qU);function ZU(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new KU}}}function QU(e,t){switch(t.type){case lH.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case lH.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case lH.DragEnd:case lH.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case lH.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new KU(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case lH.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new KU(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case lH.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new KU(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function $U(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,W.useContext)(YU),a=BV(r),o=BV(n?.id);return(0,W.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!qV(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=QV(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function eW(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function tW(e){return(0,W.useMemo)(()=>({draggable:{...GU.draggable,...e?.draggable},droppable:{...GU.droppable,...e?.droppable},dragOverlay:{...GU.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function nW(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,W.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;PV(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=yH(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=jH(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var rW=(0,W.createContext)({...pH,scaleX:1,scaleY:1}),iW;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(iW||={});var aW=(0,W.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=UU,collisionDetection:o=_H,measuring:s,modifiers:c,...l}=e,[u,d]=(0,W.useReducer)(QU,void 0,ZU),[f,p]=aH(),[m,h]=(0,W.useState)(iW.Uninitialized),g=m===iW.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,W.useRef)({initial:null,translated:null}),C=(0,W.useMemo)(()=>_==null?null:{id:_,data:x?.data??WU,rect:S},[_,x]),w=(0,W.useRef)(null),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(null),k=LV(l,Object.values(l)),A=HV(`DndDescribedBy`,t),j=(0,W.useMemo)(()=>b.getEnabled(),[b]),M=tW(s),{droppableRects:N,measureDroppableContainers:P,measuringScheduled:F}=wU(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),ee=yU(v,_),te=(0,W.useMemo)(()=>D?YV(D):null,[D]),I=Te(),ne=EU(ee,M.draggable.measure);nW({activeNode:_==null?null:v.get(_),config:I.layoutShiftCompensation,initialRect:ne,measure:M.draggable.measure});let re=AU(ee,M.draggable.measure,ne),ie=AU(ee?ee.parentElement:null),L=(0,W.useRef)({activatorEvent:null,active:null,activeNode:ee,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),R=b.getNodeFor(L.current.over?.id),ae=HU({measure:M.dragOverlay.measure}),z=ae.nodeRef.current??ee,B=g?ae.rect??re:null,oe=!!(ae.nodeRef.current&&ae.rect),se=jU(oe?null:re),ce=RU(z?kV(z):null),V=NU(g?R??ee:null),le=BU(V),ue=eW(c,{transform:{x:y.x-se.x,y:y.y-se.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:re,containerNodeRect:ie,draggingNodeRect:B,over:L.current.over,overlayNodeRect:ae.rect,scrollableAncestors:V,scrollableAncestorRects:le,windowRect:ce}),de=te?WV(te,y):null,H=PU(V),fe=FU(H),pe=FU(H,[re]),me=WV(ue,fe),he=B?xH(B,ue):null,ge=C&&he?o({active:C,collisionRect:he,droppableRects:N,droppableContainers:j,pointerCoordinates:de}):null,U=hH(ge,`id`),[_e,ve]=(0,W.useState)(null),ye=vH(oe?ue:WV(ue,pe),_e?.rect??null,re),be=(0,W.useRef)(null),xe=(0,W.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;be.current=new n({active:w.current,activeNode:i,event:a,options:r,context:L,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,Vg.unstable_batchedUpdates)(()=>{r?.(i),h(iW.Initializing),d({type:lH.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(be.current),O(a)})},onMove(e){d({type:lH.DragMove,coordinates:e})},onEnd:o(lH.DragEnd),onCancel:o(lH.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=L.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===lH.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=lH.DragCancel)}w.current=null,(0,Vg.unstable_batchedUpdates)(()=>{d({type:e}),h(iW.Uninitialized),ve(null),E(null),O(null),be.current=null;let t=e===lH.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Se=bU(a,(0,W.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,xe(n,t))},[v,xe]));IU(a),PV(()=>{re&&m===iW.Initializing&&h(iW.Initialized)},[re,m]),(0,W.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=L.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:me.x,y:me.y},over:i};(0,Vg.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[me.x,me.y]),(0,W.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=L.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(U),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Vg.unstable_batchedUpdates)(()=>{ve(s),a?.(c),f({type:`onDragOver`,event:c})})},[U]),PV(()=>{L.current={activatorEvent:D,active:C,activeNode:ee,collisionRect:he,collisions:ge,droppableRects:N,draggableNodes:v,draggingNode:z,draggingNodeRect:B,droppableContainers:b,over:_e,scrollableAncestors:V,scrollAdjustedTranslate:me},S.current={initial:B,translated:he}},[C,ee,ge,he,v,z,B,N,b,_e,V,me]),gU({...I,delta:y,draggingRect:he,pointerCoordinates:de,scrollableAncestors:V,scrollableAncestorRects:le});let Ce=(0,W.useMemo)(()=>({active:C,activeNode:ee,activeNodeRect:re,activatorEvent:D,collisions:ge,containerNodeRect:ie,dragOverlay:ae,draggableNodes:v,droppableContainers:b,droppableRects:N,over:_e,measureDroppableContainers:P,scrollableAncestors:V,scrollableAncestorRects:le,measuringConfiguration:M,measuringScheduled:F,windowRect:ce}),[C,ee,re,D,ge,ie,ae,v,b,N,_e,P,V,le,M,F,ce]),we=(0,W.useMemo)(()=>({activatorEvent:D,activators:Se,active:C,activeNodeRect:re,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:_e,measureDroppableContainers:P}),[D,Se,C,re,d,A,v,_e,P]);return W.createElement(rH.Provider,{value:p},W.createElement(YU.Provider,{value:we},W.createElement(XU.Provider,{value:Ce},W.createElement(rW.Provider,{value:ye},i)),W.createElement($U,{disabled:n?.restoreFocus===!1})),W.createElement(cH,{...n,hiddenTextDescribedById:A}));function Te(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),oW=(0,W.createContext)(null),sW=`button`,cW=`Draggable`;function lW(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=HV(cW),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,W.useContext)(YU),{role:p=sW,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,W.useContext)(g?rW:oW),[v,y]=zV(),[b,x]=zV(),S=LU(o,t),C=LV(n);return PV(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,W.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===sW?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}var uW=`Droppable`,dW={timeout:25};function fW(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=HV(uW),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,W.useContext)(YU),u=(0,W.useRef)({disabled:n}),d=(0,W.useRef)(!1),f=(0,W.useRef)(null),p=(0,W.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...dW,...i},_=LV(h??r),v=OU({callback:(0,W.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=zV((0,W.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=LV(t);return(0,W.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,W.useEffect)(()=>(s({type:lH.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:lH.UnregisterDroppable,key:a,id:r})),[r]),(0,W.useEffect)(()=>{n!==u.current.disabled&&(s({type:lH.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}var pW=s(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),mW=L_((0,G.jsx)(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`),hW=L_((0,G.jsx)(`path`,{d:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2`}),`MoreVert`);M();var gW=e=>{switch(e){case`down`:return 90;case`up`:return-90;case`left`:return 180;default:return 0}},_W=e=>{let{direction:t,style:n}=e;return(0,G.jsx)(mW,{style:{transform:`rotate(${gW(t)}deg)`,...n}})};_W.propTypes={direction:j.string,style:j.object};var vW=({style:e})=>(0,G.jsxs)(`span`,{style:e,children:[(0,G.jsx)(hW,{style:{margin:`0 -16px`}}),(0,G.jsx)(hW,{})]});vW.propTypes={style:j.object},J(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans !important`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,top:`7px`,width:`110px`,height:`28px`,whiteSpace:`nowrap`})),M();var yW=u(pW(),1),bW=J(`span`)(({theme:e})=>({border:`solid 0px ${e.palette.primary.main}`,"& mjx-frac":{fontSize:`120% !important`}}));function xW({n:e,children:t,isDragging:n,isOver:r,dragItem:i,value:a,selected:o}){let[s,c]=(0,W.useState)(null),l=(0,W.useRef)(null),u=e=>{l.current&&(l.current.contains(e.target)?l.current.classList.add(`selected`):l.current.classList.remove(`selected`))};(0,W.useEffect)(()=>(document.addEventListener(`click`,u),()=>{document.removeEventListener(`click`,u)}),[]),(0,W.useEffect)(()=>{l.current&&typeof D==`function`&&D(l.current)},[a?.value,r,i?.value?.value]),(0,W.useEffect)(()=>{if(r&&l.current&&!s){let e=l.current;c({width:e.offsetWidth,height:e.offsetHeight})}else !r&&s&&c(null)},[r,s]);let d=i&&r?i.value.value:a.value||`\xA0`,f=n?`\xA0`:d,p=f!==`\xA0`,m=i&&r,h=o?`2px solid ${vv()}`:m?`1px solid ${X.BORDER_DARK}`:`1px solid ${X.BORDER_LIGHT}`;return(0,G.jsxs)(`div`,{ref:l,className:o?`selected`:void 0,style:{display:`inline-flex`,minWidth:`178px`,minHeight:`36px`,background:m?`${X.BORDER_LIGHT}`:`${X.WHITE}`,border:h,boxSizing:`border-box`,borderRadius:`3px`,overflow:`hidden`,position:`relative`,padding:`8px 8px 8px 35px`,width:s?s.width:void 0,height:s?s.height:void 0,touchAction:`none`},"data-key":e.index,contentEditable:!1,children:[p&&(0,G.jsx)(vW,{style:{position:`absolute`,top:`6px`,left:`15px`,color:`#9B9B9B`},contentEditable:!1}),(0,G.jsx)(`span`,{dangerouslySetInnerHTML:{__html:f}}),t]})}xW.propTypes={n:j.object,children:j.node,isDragging:j.bool,isOver:j.bool,dragItem:j.object,value:j.object,selected:j.bool};function SW({value:e,disabled:t,instanceId:n,children:r,n:i,onChange:a,removeResponse:o,duplicates:s,pos:c,selected:l}){let{attributes:u,listeners:d,setNodeRef:f,isDragging:p}=lW({id:`drag-${i.index}`,disabled:t||!e?.value,data:{id:`drag-${i.index}`,value:e,instanceId:n,n:i,pos:c,opts:{duplicates:s},type:`drag-in-the-blank-placed-choice`,fromChoice:!e,onRemove:e=>o(e),onDrop:(e,t)=>{t?.type===`drag-in-the-blank-drop-choice`&&(a(e),!s&&e.fromChoice&&o(e))}}}),{setNodeRef:m,isOver:h,active:g}=fW({id:`drop-${i.index}`,data:{type:`drag-in-the-blank-drop-choice`,accepts:[`drag-in-the-blank-choice`,`drag-in-the-blank-placed-choice`],instanceId:n,value:e,id:`drop-${i.index}`,pos:c,n:i,opts:{duplicates:s},onDrop:(e,t)=>{if(t?.type===`drag-in-the-blank-drop-choice`&&e.value.id!==t.value.id){if(e.type===`drag-in-the-blank-choice`){a(e),!s&&e.fromChoice&&o(e);return}e.type===`drag-in-the-blank-placed-choice`&&(o(t),a(e),setTimeout(()=>o(e),10))}}}}),_=e=>{f(e),m(e)},v=(0,G.jsx)(xW,{n:i,isDragging:p,isOver:h,dragItem:g?.data?.current,value:e,selected:l,children:r}),y=e?(0,G.jsx)(`span`,{ref:_,...u,...d,children:v}):(0,G.jsx)(`span`,{ref:m,children:v});return(0,G.jsx)(bW,{className:(0,yW.default)(h&&`over`),children:y})}SW.propTypes={value:j.object,disabled:j.bool,instanceId:j.string,children:j.node,n:j.object.isRequired,onChange:j.func.isRequired,removeResponse:j.func.isRequired,duplicates:j.bool,selected:j.bool},M();var CW=(e,t,n,r)=>{let{tr:i}=e.state;i.setNodeMarkup(n,void 0,{...t.attrs,...r.value}),i.isDone=!0,e.view.dispatch(i)},wW=(e,t,n)=>{let{tr:r}=e.state;r.setNodeMarkup(n.pos,void 0,xp(t.attrs,[`value`,`id`])),r.isDone=!0,e.view.dispatch(r)},TW=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{inTable:s}=o,c=r();return(0,G.jsx)(KM,{className:`drag-in-the-blank`,"data-selected":a,style:{display:`inline`,whiteSpace:`normal`},children:(0,G.jsx)(`span`,{...o,style:{display:`inline-flex`,minHeight:`50px`,minWidth:`178px`,position:`relative`,margin:s?`10px`:`0 10px`,cursor:`pointer`},children:(0,G.jsx)(SW,{n:o,dragKey:o.id,targetId:`0`,pos:c,value:o,duplicates:i.duplicates,selected:a,onChange:e=>CW(t,n,c,e),removeResponse:e=>wW(t,n,e)})})})};TW.propTypes={attributes:j.object,data:j.object,n:j.object,nodeProps:j.object,opts:j.object},M();var EW=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{value:s,error:c}=o,l=s||`<div>&nbsp</div>`,u=r(),d=(0,W.useRef)(null),f=(0,W.useRef)(null),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)({top:0,left:0}),_=i.respAreaToolbar([n,u],t,()=>{});return(0,W.useEffect)(()=>{let{selection:e}=t.state,r=e.from+n.nodeSize===e.to;a?r&&m(a):m(a)},[t,n,a]),(0,W.useEffect)(()=>{let e=document.body.getBoundingClientRect(),{from:n}=t.state.selection,r=t.view.coordsAtPos(n);g({top:r.top+Math.abs(e.top)+40,left:r.left});let i=e=>{let n=e.target.closest(`[data-toolbar-for]`);(!n||n.dataset.toolbarFor!==f.current.instanceId)&&!t._toolbarOpened&&d.current&&!d.current.contains(e.target)&&!e.target.closest(`[data-inline-node]`)&&m(!1)};return p?document.addEventListener(`mousedown`,i):document.removeEventListener(`mousedown`,i),()=>document.removeEventListener(`mousedown`,i)},[p]),(0,G.jsxs)(KM,{className:`inline-dropdown`,"data-selected":a,style:{display:`inline-flex`,height:`50px`,cursor:`pointer`},children:[(0,G.jsxs)(`div`,{style:{display:`inline-flex`,minWidth:`178px`,height:`36px`,background:`#FFF`,border:`1px solid #C0C3CF`,boxSizing:`border-box`,borderRadius:`3px`,margin:`0 2px`,position:`relative`,alignItems:`center`},onClick:()=>m(!0),children:[(0,G.jsx)(`div`,{style:{flex:1,overflow:`hidden`,padding:`0 25px 0 8px`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},children:(0,G.jsx)(`span`,{style:{display:`inline-block`,verticalAlign:`middle`},dangerouslySetInnerHTML:{__html:l}})}),(0,G.jsx)(_W,{direction:`down`,style:{position:`absolute`,top:`5px`,right:`5px`}})]}),p&&(0,G.jsxs)(W.Fragment,{children:[Vg.createPortal((0,G.jsx)(`div`,{ref:d,style:{zIndex:1},children:(0,G.jsx)(_,{editorCallback:e=>{f.current=e}})}),document.body),t._tiptapContainerEl&&Vg.createPortal((0,G.jsx)(wV,{deletable:!0,toolbarOpts:{minWidth:`auto`},autoWidth:!0,style:{top:-40,left:0,right:0},onDelete:()=>{let{tr:e}=t.state;e.delete(u,u+n.nodeSize),t._toolbarOpened=!1,t.view.dispatch(e),m(!1),t.commands.focus()},showDone:!1}),t._tiptapContainerEl)]})]})};EW.propTypes={attributes:j.object,selectedItem:j.oneOfType([j.string,j.object])};var DW=c({greaterThan:()=>AW,greaterThanEqual:()=>MW,lessThan:()=>kW,lessThanEqual:()=>jW}),OW=e=>({...e,category:`comparison`}),kW=OW({name:`Less than`,latex:`<`,command:`\\lt`}),AW=OW({name:`Greater than`,latex:`>`,command:`\\gt`}),jW=OW({name:`Less than or equal`,latex:`\\le`,symbol:`<=`,command:`\\le`,ariaLabel:`less than or equal to`}),MW=OW({name:`Greater than or equal`,symbol:`>=`,command:`\\ge`,latex:`\\ge`}),NW=e=>t=>({...t,category:e}),PW=(e=[])=>{let t=[];Mp(5,()=>t.push([]));let n=e.length,r=0,i=0;for(;i<n;)t[r++].push(e[i++]),r===5&&(r=0);return t},FW=e=>t=>{let n=Du(e),r=n.some(e=>e.latex===t.latex),i=n.some(e=>e.name===t.name);return!r&&!i},IW=(e=[],t=[])=>{t=t.filter(FW(e));let n=[];Mp(5-e.length,()=>e.push([])),Mp(5,()=>n.push([]));let r=PW(t);for(let t=0;t<5;t++)n[t]=[...e[t],...r[t]];return n},LW=c({theta:()=>VW,x:()=>zW,y:()=>BW}),RW=NW(`vars`),zW=RW({name:`X`,latex:`x`,write:`x`}),BW=RW({name:`Y`,latex:`y`,write:`y`}),VW=RW({name:`Theta`,latex:`\\theta`,write:`\\theta`}),HW=c({blankOverBlank:()=>WW,xBlankBlank:()=>KW,xOverBlank:()=>GW}),UW=NW(`fractions`),WW=UW({name:`blank/blank`,latex:`\\frac{}{}`,command:`\\frac`,ariaLabel:`fraction`}),GW=UW({latex:`\\frac{x}{ }`,name:`X/blank`,label:`x/[]`,command:`/`,ariaLabel:`x over blank fraction`}),KW=UW({name:`X (blank/blank)`,latex:`x\\frac{}{}`,label:`x([]/[])`,command:`\\frac`,ariaLabel:`mixed number`}),qW=c({nthRoot:()=>QW,squareRoot:()=>ZW,squared:()=>YW,xToPowerOfN:()=>XW}),JW=NW(`exponent`),YW=JW({name:`Squared`,latex:`x^2`,write:`^2`}),XW=JW({name:`X to the power of n`,latex:`x^{}`,command:`^`,ariaLabel:`exponent`}),ZW=JW({name:`Square root`,latex:`\\sqrt{}`,command:`\\sqrt`}),QW=JW({name:`Nth root`,latex:`\\sqrt[{}]{}`,command:`\\nthroot`}),$W=c({absValue:()=>nG,approx:()=>oG,brackets:()=>iG,nApprox:()=>sG,notEqual:()=>cG,notSimilar:()=>uG,parenthesis:()=>rG,percentage:()=>aG,plusMinus:()=>tG,similar:()=>lG}),eG=NW(`misc`),tG=eG({name:`Plus or Minus`,latex:`\\pm`,write:`\\pm`}),nG=eG({name:`Absolute Value`,latex:`\\abs{}`,symbol:`| |`,command:`|`}),rG=eG({name:`Parenthesis`,latex:`\\left(\\right)`,symbol:`( )`,command:`(`}),iG=eG({name:`Brackets`,latex:`\\left[\\right]`,symbol:`[ ]`,command:`[`}),aG=eG({name:`Percent`,latex:`%`,command:`%`}),oG=eG({latex:`\\approx`,command:`\\approx`,ariaLabel:`Approximately equal to`}),sG=eG({latex:`\\napprox`,command:`\\napprox`,ariaLabel:`Not pproximately equal to`}),cG=eG({latex:`\\neq`,command:`\\neq`,ariaLabel:`Not equals`}),lG=eG({latex:`\\sim`,command:`\\sim`,ariaLabel:`Similar`}),uG=eG({latex:`\\nsim`,command:`\\nsim`,ariaLabel:`Not similar`}),dG=c({eulers:()=>mG,halfInfinity:()=>gG,infinity:()=>hG,pi:()=>pG}),fG=NW(`constants`),pG=fG({name:`Pi`,label:`π`,latex:`\\pi`,command:`\\pi`,category:`constants`}),mG=fG({name:`Eulers`,label:`e`,latex:`e`,command:`e`,category:`constants`}),hG=fG({name:`Infinity`,label:`\\infty`,latex:`\\infty`,command:`\\infty`,category:`constants`}),gG=fG({name:`Half Infinity`,label:`\\propto`,latex:`\\propto`,command:`\\propto`,category:`constants`}),_G=c({cos:()=>bG,cot:()=>wG,csc:()=>CG,sec:()=>SG,sin:()=>yG,tan:()=>xG}),vG=NW(`trigonometry`),yG=vG({name:`sine`,label:`sin`,command:`\\sin`,latex:`\\sin`}),bG=vG({name:`cosine`,label:`cos`,command:`\\cos`,latex:`\\cos`}),xG=vG({name:`tanget`,label:`tan`,command:`\\tan`,latex:`\\tan`}),SG=vG({name:`secant`,label:`sec`,command:`\\sec`,latex:`\\sec`}),CG=vG({name:`cosecant`,label:`csc`,command:`\\csc`,latex:`\\csc`}),wG=vG({name:`cotangent`,label:`cot`,command:`\\cot`,latex:`\\cot`}),TG=c({angle:()=>PG,circledDot:()=>BG,congruentTo:()=>UG,degree:()=>VG,doublePrimeArcSecond:()=>KG,leftArrow:()=>qG,leftrightArrow:()=>YG,measureOfAngle:()=>IG,notCongruentTo:()=>WG,notParallel:()=>MG,overArc:()=>FG,overLeftRightArrow:()=>kG,overRightArrow:()=>OG,overline:()=>DG,parallel:()=>jG,parallelogram:()=>zG,perpindicular:()=>NG,primeArcminute:()=>GG,rightArrow:()=>JG,segment:()=>AG,similarTo:()=>HG,square:()=>RG,triangle:()=>LG}),EG=e=>({...e,category:`geometry`}),DG=EG({name:`Line`,latex:`\\overline{}`,command:`\\overline`}),OG=EG({name:`Ray`,latex:`\\overrightarrow{}`,command:`\\overrightarrow`}),kG=EG({name:`Segment`,latex:`\\overleftrightarrow{\\overline{}}`,symbol:`AB`,command:`\\overleftrightarrow`}),AG=EG({name:`Segment`,latex:`\\overleftrightarrow{AB}`,write:`\\overleftrightarrow{AB}`,label:`AB`}),jG=EG({name:`Parallel`,latex:`\\parallel`,command:`\\parallel`}),MG=EG({name:`Not Parallel`,latex:`\\nparallel`,command:`\\nparallel`}),NG=EG({name:`Perpendicular`,latex:`\\perp`,command:`\\perpendicular`}),PG=EG({name:`Angle`,latex:`\\angle`,command:`\\angle`}),FG=EG({name:`Over arc`,latex:`\\overarc{\\overline{}}`,command:`\\overarc`}),IG=EG({name:`Measured Angle`,latex:`\\measuredangle`,command:[`m`,`\\angle`]}),LG=EG({name:`Triangle`,latex:`\\triangle`,command:`\\triangle`}),RG=EG({name:`Square`,latex:`\\square`,command:`\\square`}),zG=EG({name:`Parallelogram`,latex:`\\parallelogram`,command:`\\parallelogram`}),BG=EG({name:`Circled Dot`,latex:`\\odot`,command:`\\odot`}),VG=EG({name:`Degree`,latex:`\\degree`,command:`\\degree`}),HG=EG({name:`Similar`,command:`\\sim`,latex:`\\sim`}),UG=EG({name:`Congruent To`,command:`\\cong`,latex:`\\cong`}),WG=EG({name:`Not Congruent To`,command:`\\ncong`,latex:`\\ncong`}),GG=EG({name:`Prime`,label:`pam`,latex:`'`,write:`'`}),KG=EG({name:`Double Prime`,latex:`''`,write:`''`}),qG=EG({name:`Left Arrow`,latex:`\\leftarrow`,command:`\\leftarrow`}),JG=EG({name:`Right Arrow`,latex:`\\rightarrow`,command:`\\rightarrow`}),YG=EG({name:`Left and Right Arrow`,latex:`\\leftrightarrow`,command:`\\leftrightarrow`}),XG=c({circleDot:()=>ZG}),ZG=NW(`operators`)({name:`CircleDot`,label:`⋅`,write:`\\cdot`,ariaLabel:`Dot multiplier`}),QG=c({ln:()=>nK,log:()=>eK,logSubscript:()=>tK}),$G=NW(`log`),eK=$G({name:`Log`,label:`log`,command:`\\log`,latex:`\\log`}),tK=$G({name:`log base n`,label:`log s`,latex:`\\log_{}`,command:[`\\log`,`_`]}),nK=$G({name:`natural log`,label:`ln`,command:`\\ln`,latex:`\\ln`}),rK=c({subscript:()=>oK,superscript:()=>aK}),iK=NW(`sub-sup`),aK=iK({name:`Superscript`,latex:`x^{}`,command:`^`}),oK=iK({name:`Subscript`,latex:`x_{}`,command:`_`}),sK=c({mu:()=>dK,sigma:()=>fK,smallSigma:()=>pK,xBar:()=>lK,yBar:()=>uK}),cK=NW(`statistics`),lK=cK({name:`X Bar`,label:`x̄`,latex:`\\overline{x}`,write:`\\overline{x}`}),uK=cK({name:`Y Bar`,latex:`\\overline{y}`,write:`\\overline{y}`}),dK=cK({name:`mu`,label:`mu`,latex:`\\mu`,write:`\\mu`}),fK=cK({name:`Sigma`,ariaLabel:`Uppercase Sigma`,label:`\\Sigma`,latex:`\\Sigma`,write:`\\Sigma`}),pK=cK({name:`sigma`,ariaLabel:`Lowercase Sigma`,label:`\\sigma`,latex:`\\sigma`,write:`\\sigma`}),mK=c({divide:()=>yK,equals:()=>gK,minus:()=>vK,multiply:()=>bK,plus:()=>_K}),hK=NW(`operators`),gK=hK({write:`=`,label:`=`}),_K=hK({write:`+`,label:`+`}),vK=hK({write:`−`,label:`−`}),yK=hK({name:`divide`,label:`÷`,command:`\\divide`,otherNotation:`\\div`}),bK=hK({name:`multiply`,label:`×`,command:`\\times`}),xK=c({doubleCellMatrix:()=>wK,singleCellMatrix:()=>CK}),SK=NW(`matrices`),CK=SK({name:`Single Cell Matrix`,label:`[ ]`,write:`\\begin{pmatrix}\\end{pmatrix}`}),wK=SK({name:`Double Cell Matrix`,label:`[ ] [ ] \\\\newline [ ] [ ]`,write:`\\begin{bmatrix}&\\\\&\\end{bmatrix}`}),TK={0:`zero`,1:`one`,2:`two`,3:`three`,4:`four`,5:`five`,6:`six`,7:`seven`,8:`eight`,9:`nine`},EK=Mp(10,String).map(e=>({name:TK[e],write:e,label:e,category:`digit`})).reduce((e,t)=>(e[t.name]=t,e),{comma:{name:`comma`,label:`,`,write:`,`,category:`digit`},decimalPoint:{name:`decimal-point`,label:`.`,write:`.`,category:`digit`}}),DK=NW(`logic`),OK=DK({name:`Therefore`,label:`∴`,write:`∴`}),kK=DK({name:`Long division`,latex:`\\longdiv{}`,command:`\\longdiv`}),AK=NW(`navigation`),jK=AK({label:`◀`,keystroke:`Left`,ariaLabel:`Move cursor left`}),MK=AK({label:`▶`,keystroke:`Right`,ariaLabel:`Move cursor right`}),NK={label:`⌫`,category:`edit`,keystroke:`Backspace`,ariaLabel:`Delete`},PK=[[WW,aG,zW,YW,ZW],[ZG,BW,oK,XW,QW],[tG,kW,AW,jW,MW],[pG,VW,rG,iG,nG],[cG,yG,bG,xG,VG]],FK=(()=>{let e=[...PK.map(e=>[...e])];return e[0].push({name:`i`,latex:`i`,write:`i`}),e[1].push(eK),e[2].push(tK),e[3].push(nK),e[4].push(mG),e})(),IK=(()=>{let e=[...PK.map(e=>[...e])];return e[0].push(dK),e[1].push(lK),e[2].push(uK),e[3].push(fK),e[4].push(pK),e})(),LK=[{predicate:e=>e>=3&&e<=5,set:[[kW,AW],[GW,KW],[zW,kK],[YW,XW]]},{predicate:e=>e>=6&&e<=7,set:[[VG,kW,AW],[ZG,jW,MW],[zW,BW,YW,XW],[tG,GW,KW,ZW],[pG,rG,nG,QW]]},{predicate:e=>e>=8||e===`HS`,set:PK},{predicate:`non-negative-integers`,set:[[EK.seven,EK.eight,EK.nine],[EK.four,EK.five,EK.six],[EK.one,EK.two,EK.three],[EK.zero,{name:``,latex:``,write:``},{name:``,latex:``,write:``}],[jK,MK,NK]]},{predicate:`integers`,set:[[EK.seven,EK.eight,EK.nine],[EK.four,EK.five,EK.six],[EK.one,EK.two,EK.three],[EK.zero,{name:``,latex:``,write:``},vK],[jK,MK,NK]]},{predicate:`decimals`,set:[[EK.seven,EK.eight,EK.nine],[EK.four,EK.five,EK.six],[EK.one,EK.two,EK.three],[EK.zero,EK.decimalPoint,vK],[jK,MK,NK]]},{predicate:`fractions`,set:[[EK.seven,EK.eight,EK.nine],[EK.four,EK.five,EK.six],[EK.one,EK.two,EK.three],[EK.zero,WW,vK],[jK,MK,NK]]},{predicate:`geometry`,set:[[WW,VG,GG,KG,UG,HG],[ZG,PG,IG,LG,WG,uG],[yG,bG,xG,pG,ZW,QW],[CG,SG,wG,VW,oK,XW],[DG,OG,kG,FG,NG,jG]]},{predicate:`advanced-algebra`,set:FK},{predicate:`statistics`,set:IK},{predicate:`item-authoring`,set:[[yK,WW,kK,gG,YW,ZW,DG,OG,kG,eK],[bK,ZG,{name:``,latex:``,write:``},oK,XW,QW,NG,jG,FG,tK],[tG,pG,VW,VG,PG,qG,JG,LG,RG,nK],[cG,nG,pK,dK,OK,fK,YG,yG,bG,xG],[jW,MW,{name:``,latex:``,write:``},{name:``,latex:``,write:``},hG,{name:``,latex:``,write:``},{name:``,latex:``,write:``},CG,SG,wG]]},{predicate:e=>e>=1&&e<=2,set:[]}],RK=e=>{let t=parseInt(e,10);if(e=isNaN(t)?e:t,!e)return[];let n=LK.find(t=>typeof t.predicate==`string`?t.predicate===e:t.predicate(e));if(n)return n.set||[];if(e!==`language`)return LK[2].set},zK=[...Object.values(mK),...Object.values(DW),...Object.values(dG),...Object.values(EK),...Object.values(qW),...Object.values(HW),...Object.values(TG),...Object.values(QG),...Object.values(xK),...Object.values($W),...Object.values(XG),...Object.values(sK),...Object.values(rK),...Object.values(_G),...Object.values(LW)],BK=e=>(e||[]).map(e=>{let{latex:t}=e,n=(zK||[]).find(e=>t===e.latex||t===e.write||t===e.command||t===e.otherNotation);return t&&n||e}),VK=e=>{let t=e??document;(Array.from(t.querySelectorAll(`span[mathquill-command-id]`))||[]).forEach(e=>{e&&e.innerText===`∥`&&e.className!==`mq-editable-field`&&(e.style.fontSize=`32px`),(e.innerText===`′`||e.innerText===`′′`)&&!e.hasAttribute(`data-prime`)&&e.setAttribute(`data-prime`,`true`)})},{one:HK,two:UK,three:WK,four:GK,five:KK,six:qK,seven:JK,eight:YK,nine:XK,zero:ZK,comma:QK,decimalPoint:$K}=EK,eq=[[JK,YK,XK,yK],[GK,KK,qK,bK],[HK,UK,WK,vK],[ZK,$K,QK,_K],[jK,MK,NK,gK]],tq={fontFamily:`MJXZERO, MJXTEX !important`,"-webkit-font-smoothing":`antialiased !important`,"& .mq-math-mode > span > var":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode span var":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode .mq-nonSymbola":{fontFamily:`MJXZERO, MJXTEX-I !important`},"& .mq-math-mode > span > var.mq-operator-name":{fontFamily:`MJXZERO, MJXTEX !important`}},nq={"& .mq-longdiv-inner":{marginTop:`-1px`,marginLeft:`5px !important;`,"& > .mq-empty":{padding:`0 !important`,marginLeft:`0px !important`,marginTop:`2px`}},"& .mq-math-mode .mq-longdiv":{display:`inline-flex !important`}},rq={"& .mq-math-mode sup.mq-nthroot":{fontSize:`70% !important`,verticalAlign:`0.5em !important`,paddingRight:`0.15em`},"& .mq-math-mode .mq-supsub":{fontSize:`70.7% !important`},"& .mq-supsub ":{fontSize:`70.7%`},"& .mq-math-mode .mq-supsub.mq-sup-only":{verticalAlign:`-0.1em !important`,"& .mq-sup":{marginBottom:`0px !important`}},"& .mq-math-mode .mq-fraction + .mq-supsub.mq-sup-only":{verticalAlign:`0.4em !important`},"& .mq-math-mode .mq-supsub.mq-sup-only.mq-after-fraction-group":{verticalAlign:`0.4em !important`}},iq={"& *":{...tq,...nq,"& .mq-math-mode .mq-sqrt-prefix":{top:`0 !important`},"& .mq-math-mode .mq-empty":{padding:`9px 1px !important`},"& .mq-math-mode .mq-supsub":{fontSize:`70.7% !important`},"& .mq-math-mode .mq-sqrt-stem":{marginTop:`-5px`,paddingTop:`4px`},"& .mq-math-mode .mq-paren":{verticalAlign:`middle !important`},"& .mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty":{padding:`0 !important`},"& .mq-math-mode .mq-overline .mq-overline-inner .mq-empty ":{padding:`0 !important`}}},aq={commonMqFontStyles:tq,longdivStyles:nq,supsubStyles:rq,commonMqKeyboardStyles:iq},oq=e=>e.ariaLabel||e.name||e.label||e.latex||`keypad action`,sq=e=>(Mp(5-e.length,()=>e.push([])),zp.apply(null,e));M();var cq=ey(`pie-lib:math-inline:keypad:a11y`),lq=J(`div`)(()=>({...iq,width:`100%`,display:`grid`,gridTemplateRows:`repeat(5, minmax(40px, 60px))`,gridAutoFlow:`column`,border:`1px solid ${Ov()}`,"&.character":{textTransform:`initial !important`,gridTemplateRows:`repeat(5, minmax(40px, 50px)) !important`},"&.language":{gridTemplateRows:`repeat(4, minmax(40px, 50px)) !important`,"& *":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}}));J(`div`)(({operator:e})=>({flex:e?`0 0 auto`:`1 1 0`,display:`grid`,gridAutoFlow:`column`,gridTemplateRows:`repeat(5, minmax(44px, 56px))`,gridAutoColumns:`minmax(72px, 1fr)`,backgroundColor:e?zv():Rv()}));var uq=J(Wy,{shouldForwardProp:e=>e!==`operator`})(({operator:e})=>({minWidth:`auto`,borderRadius:0,color:iv(),backgroundColor:e?zv():Rv(),textTransform:`none`,fontSize:`1.6rem`,lineHeight:1,"&:hover":{backgroundColor:e?Bv():zv()},"&:focus-visible":{outline:`3px solid ${Fv()}`,outlineOffset:-3,zIndex:2}})),dq=J(mV,{shouldForwardProp:e=>e!==`operator`})(({operator:e})=>({minWidth:`auto`,borderRadius:0,color:iv(),backgroundColor:e?zv():Rv(),"&:hover":{backgroundColor:e?Bv():zv()},"&:focus-visible":{outline:`3px solid ${Fv()}`,outlineOffset:-3,zIndex:2},"& .icon":{height:`30px`}})),fq=J(`span`)(()=>({pointerEvents:`none`,color:iv(),display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minHeight:40,minWidth:34,"& .MathJax":{fontSize:`1.45rem`,lineHeight:1.1},"& mjx-container":{overflow:`visible !important`,lineHeight:1.1},"& .tpl-root":{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:4,fontSize:`1.5rem`,lineHeight:1,minHeight:34,fontFamily:`"Times New Roman", Times, serif`,textTransform:`none`},"& .mq-keycap":{fontFamily:`"STIX Two Text", MJXZERO, MJXTEX, "Times New Roman", Times, serif`,fontStyle:`normal`},"& .mq-keycap var":{fontFamily:`"STIX Two Text", MJXZERO, MJXTEX-I, "Times New Roman", Times, serif`,fontStyle:`italic`},"& .mq-keycap .mq-operator-name":{fontFamily:`"STIX Two Text", MJXZERO, MJXTEX, "Times New Roman", Times, serif`,fontStyle:`normal`},"& .tpl-fraction":{display:`inline-grid`,gridTemplateRows:`auto 1px auto`,justifyItems:`center`,alignItems:`center`,minWidth:22},"& .tpl-frac-line":{width:`1.05em`,borderTop:`2px solid ${iv()}`,margin:`2px 0`},"& .tpl-mixed-fraction":{display:`inline-flex`,alignItems:`center`,gap:3},"& .tpl-frac-cell":{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minHeight:`0.55em`},"& .tpl-placeholder":{display:`inline-block`,width:`0.42em`,height:`0.76em`,backgroundColor:Sv()},"& .tpl-longdiv":{display:`inline-flex`,alignItems:`center`,gap:3},"& .tpl-longdiv-radicand":{display:`inline-flex`,alignItems:`center`,borderTop:`2px solid ${iv()}`,paddingTop:`0.15em`,minWidth:`0.8em`,justifyContent:`center`},"& .tpl-sup":{display:`inline-flex`,alignItems:`flex-start`},"& .tpl-sup .tpl-placeholder":{width:`0.3em`,height:`0.5em`,marginLeft:`0.05em`,transform:`translateY(-0.35em)`},"& .tpl-sub":{display:`inline-flex`,alignItems:`flex-end`},"& .tpl-sub .tpl-placeholder":{width:`0.3em`,height:`0.5em`,marginLeft:`0.05em`,transform:`translateY(0.3em)`},"& .tpl-root-radical":{display:`inline-flex`,alignItems:`flex-start`},"& .tpl-root-sign":{fontSize:`1.15em`,lineHeight:1},"& .tpl-radicand":{borderTop:`2px solid ${iv()}`,padding:`0.05em 0 0 0.08em`,marginLeft:`0.03em`},"& .tpl-over":{display:`inline-grid`,justifyItems:`center`,gap:2},"& .tpl-over-line":{display:`block`,width:`1em`,borderTop:`2px solid ${iv()}`},"& .tpl-over-arrow":{display:`block`,fontSize:`0.65em`,lineHeight:1},"& .tpl-over-arc":{display:`block`,fontSize:`0.8em`,lineHeight:1,transform:`translateY(0.1em)`}})),pq=J(Wy,{shouldForwardProp:e=>e!==`operator`})(({operator:e})=>({minWidth:`auto`,borderRadius:0,padding:`6px`,overflow:`visible`,textTransform:`none`,color:iv(),backgroundColor:e?zv():Rv(),"&:hover":{backgroundColor:e?Bv():zv()},"&:focus-visible":{outline:`3px solid ${Fv()}`,outlineOffset:-3,zIndex:2}})),mq={"\\theta":`θ`,"\\pi":`π`,"\\infty":`∞`,"\\propto":`∝`,"\\sin":`sin`,"\\cos":`cos`,"\\tan":`tan`,"\\sec":`sec`,"\\csc":`csc`,"\\cot":`cot`,"\\log":`log`,"\\ln":`ln`,"\\pm":`±`,"\\approx":`≈`,"\\napprox":`≉`,"\\neq":`≠`,"\\sim":`∼`,"\\nsim":`≁`,"\\mu":`μ`,"\\Sigma":`Σ`,"\\sigma":`σ`,"\\parallel":`∥`,"\\nparallel":`∦`,"\\perp":`⟂`,"\\angle":`∠`,"\\measuredangle":`∡`,"\\triangle":`△`,"\\square":`□`,"\\parallelogram":`▱`,"\\odot":`⊙`,"\\degree":`°`,"\\cong":`≅`,"\\ncong":`≇`,"\\leftarrow":`←`,"\\rightarrow":`→`,"\\leftrightarrow":`↔`,"\\le":`≤`,"\\ge":`≥`},hq=new Set([`\\sin`,`\\cos`,`\\tan`,`\\sec`,`\\csc`,`\\cot`,`\\log`,`\\ln`]),gq=new Set([`x`,`y`,`i`,`e`,`AB`]),_q=(e=``)=>gq.has(e)?(0,G.jsx)(`var`,{children:e}):(0,G.jsx)(`span`,{children:e}),vq=(e=``)=>{if(hq.has(e))return(0,G.jsx)(`var`,{className:`mq-operator-name`,children:e.replace(/^\\/,``)});let t=mq[e];return t?gq.has(t)?(0,G.jsx)(`var`,{children:t}):(0,G.jsx)(`span`,{children:t}):_q(e.replace(/^\\/,``).replace(/\\(left|right)/g,``).replace(/[{}\\]/g,``).replace(/\s+/g,` `).trim())},yq=({short:e=!1})=>(0,G.jsx)(`span`,{className:`tpl-placeholder`,style:e?{width:`0.3em`,height:`0.55em`}:void 0}),bq=({body:e,marker:t})=>(0,G.jsxs)(`span`,{className:`tpl-root tpl-over mq-keycap`,"aria-hidden":!0,children:[(0,G.jsx)(`span`,{className:t,children:t===`tpl-over-line`?``:t===`tpl-over-arrow`?`↔`:`◠`}),(0,G.jsx)(`span`,{children:e})]}),xq=({definition:e})=>{let t=e.key?.latex||``;switch(e.visualType){case`fractionTemplate`:return t===`\\frac{x}{ }`?(0,G.jsx)(`span`,{className:`tpl-root mq-keycap`,"aria-hidden":!0,children:(0,G.jsxs)(`span`,{className:`tpl-fraction`,children:[(0,G.jsx)(`var`,{children:`x`}),(0,G.jsx)(`span`,{className:`tpl-frac-line`}),(0,G.jsx)(yq,{})]})}):(0,G.jsx)(`span`,{className:`tpl-root mq-keycap`,"aria-hidden":!0,children:(0,G.jsxs)(`span`,{className:`tpl-fraction`,children:[(0,G.jsx)(yq,{}),(0,G.jsx)(`span`,{className:`tpl-frac-line`}),(0,G.jsx)(yq,{})]})});case`mixedFractionTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root tpl-mixed-fraction mq-keycap`,"aria-hidden":!0,children:[(0,G.jsx)(`var`,{children:`x`}),(0,G.jsxs)(`span`,{className:`tpl-fraction`,style:{minWidth:`0.9em`},children:[(0,G.jsx)(`span`,{className:`tpl-frac-cell`,children:(0,G.jsx)(yq,{short:!0})}),(0,G.jsx)(`span`,{className:`tpl-frac-line`}),(0,G.jsx)(`span`,{className:`tpl-frac-cell`,children:(0,G.jsx)(yq,{short:!0})})]})]});case`squaredTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root tpl-sup mq-keycap`,"aria-hidden":!0,children:[(0,G.jsx)(`var`,{children:`x`}),(0,G.jsx)(`span`,{style:{fontSize:`0.7em`,transform:`translateY(-0.25em)`},children:`2`})]});case`longdivTemplate`:return(0,G.jsx)(`span`,{className:`tpl-root mq-keycap`,"aria-hidden":!0,children:(0,G.jsxs)(`span`,{className:`tpl-longdiv`,children:[(0,G.jsx)(`span`,{children:`)`}),(0,G.jsx)(`span`,{className:`tpl-longdiv-radicand`,children:(0,G.jsx)(yq,{})})]})});case`supTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root tpl-sup mq-keycap`,"aria-hidden":!0,children:[(0,G.jsx)(`var`,{children:`x`}),(0,G.jsx)(yq,{short:!0})]});case`subTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root tpl-sub mq-keycap`,"aria-hidden":!0,children:[(0,G.jsx)(`var`,{children:`x`}),(0,G.jsx)(yq,{short:!0})]});case`sqrtTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root tpl-root-radical mq-keycap`,"aria-hidden":!0,children:[(0,G.jsx)(`span`,{className:`tpl-root-sign`,children:`√`}),(0,G.jsx)(`span`,{className:`tpl-radicand`,children:(0,G.jsx)(yq,{})})]});case`nthRootTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root tpl-root-radical mq-keycap`,"aria-hidden":!0,children:[(0,G.jsx)(`span`,{style:{fontSize:`0.55em`,transform:`translate(0.15em,-0.2em)`},children:(0,G.jsx)(yq,{short:!0})}),(0,G.jsx)(`span`,{className:`tpl-root-sign`,children:`√`}),(0,G.jsx)(`span`,{className:`tpl-radicand`,children:(0,G.jsx)(yq,{})})]});case`parenTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root mq-keycap`,"aria-hidden":!0,children:[`(`,(0,G.jsx)(yq,{}),`)`]});case`bracketTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root mq-keycap`,"aria-hidden":!0,children:[`[`,(0,G.jsx)(yq,{}),`]`]});case`absTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root mq-keycap`,"aria-hidden":!0,children:[`|`,(0,G.jsx)(yq,{}),`|`]});case`logSubTemplate`:return(0,G.jsxs)(`span`,{className:`tpl-root tpl-sub mq-keycap`,"aria-hidden":!0,children:[(0,G.jsx)(`var`,{className:`mq-operator-name`,children:`log`}),(0,G.jsx)(yq,{short:!0})]});case`overlineTemplate`:return(0,G.jsx)(bq,{body:t.includes(`y`)?(0,G.jsx)(`var`,{children:`y`}):t.includes(`x`)?(0,G.jsx)(`var`,{children:`x`}):(0,G.jsx)(yq,{}),marker:`tpl-over-line`});case`overArrowTemplate`:return(0,G.jsx)(bq,{body:(0,G.jsx)(yq,{}),marker:`tpl-over-arrow`});case`overBiArrowTemplate`:return(0,G.jsx)(bq,{body:t.includes(`AB`)?(0,G.jsx)(`var`,{children:`AB`}):(0,G.jsx)(yq,{}),marker:`tpl-over-arrow`});case`overArcTemplate`:return(0,G.jsx)(bq,{body:(0,G.jsx)(yq,{}),marker:`tpl-over-arc`});case`symbolText`:return(0,G.jsx)(`span`,{className:`tpl-root mq-keycap`,"aria-hidden":!0,children:vq(t)});default:return(0,G.jsx)(`span`,{className:`tpl-root`,"aria-hidden":!0,children:e.key?.label||e.key?.write||e.key?.name})}},Sq=e=>e&&e.name===``&&e.latex===``&&e.write===``,Cq=(e=``)=>e.replace(/\$\$/g,``).replace(/^\$|\$$/g,``).trim(),wq=e=>e?{gridTemplateColumns:`repeat(${e.columns}, minmax(min-content, 150px))`,gridTemplateRows:`repeat(${e.rows}, minmax(40px, 60px))`,gridAutoFlow:`initial`}:{},Tq=class extends W.Component{static propTypes={className:j.string,controlledKeypadMode:j.bool,baseSet:j.array,additionalKeys:j.array,layoutForKeyPad:j.object,onPress:j.func.isRequired,onFocus:j.func,noDecimal:j.bool,setKeypadInteraction:j.func,mode:j.oneOfType([j.string,j.number]),onRequestClose:j.func};static defaultProps={baseSet:eq,noDecimal:!1};constructor(e){super(e),this.keypadRef=W.createRef(),this.buttonRefs=[],this.state={activeIndex:0}}componentDidMount(){let e=this.keypadRef?.current,t=e?.closest(`.main-container`),n=e?.closest(`.pie-toolbar`);if(this.props.controlledKeypadMode&&t&&n){let e=t.getBoundingClientRect(),r=n.getBoundingClientRect(),i=e.top+e.height-(r.top+r.height);i<0&&t&&(t.style.height=`${e.height+e.top-i}px`)}e&&(e.addEventListener(`touchstart`,this.handleKeypadInteraction,!0),e.addEventListener(`mousedown`,this.handleKeypadInteraction,!0))}componentWillUnmount(){let e=this.keypadRef?.current;if(this.props.controlledKeypadMode&&e){let t=e.closest(`.main-container`);t&&(t.style.height=`unset`)}e&&(e.removeEventListener(`touchstart`,this.handleKeypadInteraction,!0),e.removeEventListener(`mousedown`,this.handleKeypadInteraction,!0))}handleKeypadInteraction=()=>{this.props.setKeypadInteraction&&this.props.setKeypadInteraction(!0)};keyIsNotAllowed=e=>{let{noDecimal:t}=this.props;return(e.write===`.`&&e.label===`.`||e.write===`,`&&e.label===`,`)&&t};flowKeys=(e,t)=>Du([...sq([...(e||[]).map(e=>[...e])]),...sq([...(t||[]).map(e=>[...e])])]);toRenderModel=()=>{let{baseSet:e,additionalKeys:t,mode:n}=this.props;return([`non-negative-integers`,`integers`,`decimals`,`fractions`,`item-authoring`,`language`].includes(n)?this.flowKeys([],t||[]):this.flowKeys(e,t||[])).filter(e=>e&&!Sq(e)).map(e=>e.latex?{...e,latex:Cq(e.latex),write:typeof e.write==`string`?Cq(e.write):e.write,label:typeof e.label==`string`?Cq(e.label):e.label}:e).map((e,t)=>({id:`${e.label||e.latex||e.name||e.command||`key`}-${t}`,ariaLabel:oq(e),key:e}))};pressKey=e=>{!e||this.keyIsNotAllowed(e.key)||(cq(`[pressKey]`,e.id),this.props.onPress(e.key))};moveFocus=e=>{let t=Math.max(0,Math.min(e,this.buttonRefs.length-1));this.setState({activeIndex:t},()=>{let e=this.buttonRefs[t];e&&!e.disabled&&e.focus()})};onButtonKeyDown=(e,t)=>{if(e.key===`ArrowRight`||e.key===`ArrowDown`){e.preventDefault(),this.moveFocus(t+1);return}if(e.key===`ArrowLeft`||e.key===`ArrowUp`){e.preventDefault(),this.moveFocus(t-1);return}if(e.key===`Home`){e.preventDefault(),this.moveFocus(0);return}if(e.key===`End`){e.preventDefault(),this.moveFocus(this.buttonRefs.length-1);return}e.key===`Escape`&&this.props.onRequestClose&&(e.preventDefault(),this.props.onRequestClose())};renderKey=(e,t)=>{let n=e.key,r=n.category===`operators`,i=this.keyIsNotAllowed(n),a={key:`${e.id}-${t}`,onClick:()=>this.pressKey(e),onKeyDown:e=>this.onButtonKeyDown(e,t),onFocus:()=>this.setState({activeIndex:t}),tabIndex:this.state.activeIndex===t?0:-1,disabled:i,"aria-label":e.ariaLabel||oq(n),...n.actions||{},...n.extraProps||{}};if(n.icon){let e=n.icon?n.icon:`div`;return(0,G.jsx)(dq,{...a,operator:r,children:(0,G.jsx)(e,{className:`icon`,"aria-hidden":`true`})})}return n.latex?(0,G.jsx)(pq,{...a,operator:r,children:(0,G.jsx)(fq,{children:(0,G.jsx)(xq,{definition:e})})}):(0,G.jsx)(uq,{...a,operator:r,children:n.label||n.write||n.name})};render(){let{className:e,onFocus:t,layoutForKeyPad:n}=this.props;this.buttonRefs=[];let r=this.toRenderModel(),i=r.length%5?1:0,a={gridTemplateColumns:`repeat(${Math.floor(r.length/5)+i}, minmax(min-content, 150px))`,...wq(n)},o=0,s=e=>{let t=o++,n=this.renderKey(e,t);return W.cloneElement(n,{ref:e=>{this.buttonRefs[t]=e}})};return(0,G.jsx)(lq,{ref:this.keypadRef,className:[e,this.props.mode].filter(Boolean).join(` `),style:a,onFocus:t,role:`grid`,"aria-label":`Math keypad`,children:r.map(e=>s(e))})}};M();var Eq=e=>{if(e.command)return{value:e.command,type:`command`};if(e.write)return{value:e.write};if(e.keystroke)return{type:`cursor`,value:e.keystroke}},Dq=class extends W.Component{static propTypes={className:j.string,controlledKeypadMode:j.bool,mode:j.oneOfType([j.string,j.number]),layoutForKeyPad:j.object,onClick:j.func.isRequired,onFocus:j.func,noDecimal:j.bool,additionalKeys:j.array,setKeypadInteraction:j.func,onRequestClose:j.func};static defaultProps={mode:`scientific`,noDecimal:!1,additionalKeys:[]};keypadPress=e=>{let{onClick:t}=this.props;t(Eq(e))};render(){let{mode:e,onFocus:t,controlledKeypadMode:n,noDecimal:r,className:i,additionalKeys:a,layoutForKeyPad:o,setKeypadInteraction:s,onRequestClose:c}=this.props,l=BK(a);return(0,G.jsx)(Tq,{className:i,controlledKeypadMode:n,onFocus:t,noDecimal:r,layoutForKeyPad:o,additionalKeys:IW(RK(e),l),onPress:this.keypadPress,mode:e,setKeypadInteraction:s,onRequestClose:c})}},Oq=function(e){e.registerEmbed(`newLine`,()=>({htmlString:`<div class="newLine"></div>`,text:()=>`testText`,latex:()=>`\\embed{newLine}[]`}))},kq=s(((e,t)=>{(function(e,n){"use strict";typeof t==`object`&&typeof t.exports==`object`?t.exports=e.document?n(e,!0):function(e){if(!e.document)throw Error(`jQuery requires a window with a document`);return n(e)}:n(e)})(typeof window<`u`?window:e,function(e,t){"use strict";var n=[],r=Object.getPrototypeOf,i=n.slice,a=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},o=n.push,s=n.indexOf,c={},l=c.toString,u=c.hasOwnProperty,d=u.toString,f=d.call(Object),p={},m=function(e){return typeof e==`function`&&typeof e.nodeType!=`number`&&typeof e.item!=`function`},h=function(e){return e!=null&&e===e.window},g=e.document,_={type:!0,src:!0,nonce:!0,noModule:!0};function v(e,t,n){n||=g;var r,i,a=n.createElement(`script`);if(a.text=e,t)for(r in _)i=t[r]||t.getAttribute&&t.getAttribute(r),i&&a.setAttribute(r,i);n.head.appendChild(a).parentNode.removeChild(a)}function y(e){return e==null?e+``:typeof e==`object`||typeof e==`function`?c[l.call(e)]||`object`:typeof e}var b=`3.7.1`,x=/HTML$/i,S=function(e,t){return new S.fn.init(e,t)};S.fn=S.prototype={jquery:b,constructor:S,length:0,toArray:function(){return i.call(this)},get:function(e){return e==null?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,a,o=arguments[0]||{},s=1,c=arguments.length,l=!1;for(typeof o==`boolean`&&(l=o,o=arguments[s]||{},s++),typeof o!=`object`&&!m(o)&&(o={}),s===c&&(o=this,s--);s<c;s++)if((e=arguments[s])!=null)for(t in e)r=e[t],!(t===`__proto__`||o===r)&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=o[t],a=i&&!Array.isArray(n)?[]:!i&&!S.isPlainObject(n)?{}:n,i=!1,o[t]=S.extend(l,a,r)):r!==void 0&&(o[t]=r));return o},S.extend({expando:`jQuery`+(b+Math.random()).replace(/\D/g,``),isReady:!0,error:function(e){throw Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!e||l.call(e)!==`[object Object]`?!1:(t=r(e),t?(n=u.call(t,`constructor`)&&t.constructor,typeof n==`function`&&d.call(n)===f):!0)},isEmptyObject:function(e){for(var t in e)return!1;return!0},globalEval:function(e,t,n){v(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(C(e))for(n=e.length;r<n&&t.call(e[r],r,e[r])!==!1;r++);else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},text:function(e){var t,n=``,r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=S.text(t);return i===1||i===11?e.textContent:i===9?e.documentElement.textContent:i===3||i===4?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return e!=null&&(C(Object(e))?S.merge(n,typeof e==`string`?[e]:e):o.call(n,e)),n},inArray:function(e,t,n){return t==null?-1:s.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!x.test(t||n&&n.nodeName||`HTML`)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],a=0,o=e.length,s=!n;a<o;a++)r=!t(e[a],a),r!==s&&i.push(e[a]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)i=t(e[o],o,n),i!=null&&s.push(i);else for(o in e)i=t(e[o],o,n),i!=null&&s.push(i);return a(s)},guid:1,support:p}),typeof Symbol==`function`&&(S.fn[Symbol.iterator]=n[Symbol.iterator]),S.each(`Boolean Number String Function Array Date RegExp Object Error Symbol`.split(` `),function(e,t){c[`[object `+t+`]`]=t.toLowerCase()});function C(e){var t=!!e&&`length`in e&&e.length,n=y(e);return m(e)||h(e)?!1:n===`array`||t===0||typeof t==`number`&&t>0&&t-1 in e}function w(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var T=n.pop,E=n.sort,D=n.splice,O=`[\\x20\\t\\r\\n\\f]`,k=RegExp(`^`+O+`+|((?:^|[^\\\\])(?:\\\\.)*)`+O+`+$`,`g`);S.contains=function(e,t){var n=t&&t.parentNode;return e===n||!!(n&&n.nodeType===1&&(e.contains?e.contains(n):e.compareDocumentPosition&&e.compareDocumentPosition(n)&16))};var A=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function j(e,t){return t?e===`\0`?`�`:e.slice(0,-1)+`\\`+e.charCodeAt(e.length-1).toString(16)+` `:`\\`+e}S.escapeSelector=function(e){return(e+``).replace(A,j)};var M=g,N=o;(function(){var t,r,a,o,c,l=N,d,f,m,h,g,_=S.expando,v=0,y=0,b=fe(),x=fe(),C=fe(),A=fe(),j=function(e,t){return e===t&&(c=!0),0},P=`checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped`,F=`(?:\\\\[\\da-fA-F]{1,6}`+O+`?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+`,ee=`\\[`+O+`*(`+F+`)(?:`+O+`*([*^$|!~]?=)`+O+`*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(`+F+`))|)`+O+`*\\]`,te=`:(`+F+`)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|`+ee+`)*)|.*)\\)|)`,I=RegExp(O+`+`,`g`),ne=RegExp(`^`+O+`*,`+O+`*`),re=RegExp(`^`+O+`*([>+~]|`+O+`)`+O+`*`),ie=RegExp(O+`|>`),L=new RegExp(te),R=RegExp(`^`+F+`$`),ae={ID:RegExp(`^#(`+F+`)`),CLASS:RegExp(`^\\.(`+F+`)`),TAG:RegExp(`^(`+F+`|[*])`),ATTR:RegExp(`^`+ee),PSEUDO:RegExp(`^`+te),CHILD:RegExp(`^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(`+O+`*(even|odd|(([+-]|)(\\d*)n|)`+O+`*(?:([+-]|)`+O+`*(\\d+)|))`+O+`*\\)|)`,`i`),bool:RegExp(`^(?:`+P+`)$`,`i`),needsContext:RegExp(`^`+O+`*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(`+O+`*((?:-\\d)?\\d*)`+O+`*\\)|)(?=[^-]|$)`,`i`)},z=/^(?:input|select|textarea|button)$/i,B=/^h\d$/i,oe=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,se=/[+~]/,ce=RegExp(`\\\\[\\da-fA-F]{1,6}`+O+`?|\\\\([^\\r\\n\\f])`,`g`),V=function(e,t){var n=`0x`+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320))},le=function(){ye()},ue=Ce(function(e){return e.disabled===!0&&w(e,`fieldset`)},{dir:`parentNode`,next:`legend`});function de(){try{return d.activeElement}catch{}}try{l.apply(n=i.call(M.childNodes),M.childNodes),n[M.childNodes.length].nodeType}catch{l={apply:function(e,t){N.apply(e,i.call(t))},call:function(e){N.apply(e,i.call(arguments,1))}}}function H(e,t,n,r){var i,a,o,s,c,u,f,g=t&&t.ownerDocument,v=t?t.nodeType:9;if(n||=[],typeof e!=`string`||!e||v!==1&&v!==9&&v!==11)return n;if(!r&&(ye(t),t||=d,m)){if(v!==11&&(c=oe.exec(e))){if(i=c[1]){if(v===9)if(o=t.getElementById(i)){if(o.id===i)return l.call(n,o),n}else return n;else if(g&&(o=g.getElementById(i))&&H.contains(t,o)&&o.id===i)return l.call(n,o),n}else if(c[2])return l.apply(n,t.getElementsByTagName(e)),n;else if((i=c[3])&&t.getElementsByClassName)return l.apply(n,t.getElementsByClassName(i)),n}if(!A[e+` `]&&(!h||!h.test(e))){if(f=e,g=t,v===1&&(ie.test(e)||re.test(e))){for(g=se.test(e)&&ve(t.parentNode)||t,(g!=t||!p.scope)&&((s=t.getAttribute(`id`))?s=S.escapeSelector(s):t.setAttribute(`id`,s=_)),u=xe(e),a=u.length;a--;)u[a]=(s?`#`+s:`:scope`)+` `+Se(u[a]);f=u.join(`,`)}try{return l.apply(n,g.querySelectorAll(f)),n}catch{A(e,!0)}finally{s===_&&t.removeAttribute(`id`)}}}return je(e.replace(k,`$1`),t,n,r)}function fe(){var e=[];function t(n,i){return e.push(n+` `)>r.cacheLength&&delete t[e.shift()],t[n+` `]=i}return t}function pe(e){return e[_]=!0,e}function me(e){var t=d.createElement(`fieldset`);try{return!!e(t)}catch{return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e){return function(t){return w(t,`input`)&&t.type===e}}function ge(e){return function(t){return(w(t,`input`)||w(t,`button`))&&t.type===e}}function U(e){return function(t){return`form`in t?t.parentNode&&t.disabled===!1?`label`in t?`label`in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ue(t)===e:t.disabled===e:`label`in t?t.disabled===e:!1}}function _e(e){return pe(function(t){return t=+t,pe(function(n,r){for(var i,a=e([],n.length,t),o=a.length;o--;)n[i=a[o]]&&(n[i]=!(r[i]=n[i]))})})}function ve(e){return e&&e.getElementsByTagName!==void 0&&e}function ye(e){var t,n=e?e.ownerDocument||e:M;return n==d||n.nodeType!==9||!n.documentElement?d:(d=n,f=d.documentElement,m=!S.isXMLDoc(d),g=f.matches||f.webkitMatchesSelector||f.msMatchesSelector,f.msMatchesSelector&&M!=d&&(t=d.defaultView)&&t.top!==t&&t.addEventListener(`unload`,le),p.getById=me(function(e){return f.appendChild(e).id=S.expando,!d.getElementsByName||!d.getElementsByName(S.expando).length}),p.disconnectedMatch=me(function(e){return g.call(e,`*`)}),p.scope=me(function(){return d.querySelectorAll(`:scope`)}),p.cssHas=me(function(){try{return d.querySelector(`:has(*,:jqfake)`),!1}catch{return!0}}),p.getById?(r.filter.ID=function(e){var t=e.replace(ce,V);return function(e){return e.getAttribute(`id`)===t}},r.find.ID=function(e,t){if(t.getElementById!==void 0&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(ce,V);return function(e){var n=e.getAttributeNode!==void 0&&e.getAttributeNode(`id`);return n&&n.value===t}},r.find.ID=function(e,t){if(t.getElementById!==void 0&&m){var n,r,i,a=t.getElementById(e);if(a){if(n=a.getAttributeNode(`id`),n&&n.value===e)return[a];for(i=t.getElementsByName(e),r=0;a=i[r++];)if(n=a.getAttributeNode(`id`),n&&n.value===e)return[a]}return[]}}),r.find.TAG=function(e,t){return t.getElementsByTagName===void 0?t.querySelectorAll(e):t.getElementsByTagName(e)},r.find.CLASS=function(e,t){if(t.getElementsByClassName!==void 0&&m)return t.getElementsByClassName(e)},h=[],me(function(e){var t;f.appendChild(e).innerHTML=`<a id='`+_+`' href='' disabled='disabled'></a><select id='`+_+`-\r\\' disabled='disabled'><option selected=''></option></select>`,e.querySelectorAll(`[selected]`).length||h.push(`\\[`+O+`*(?:value|`+P+`)`),e.querySelectorAll(`[id~=`+_+`-]`).length||h.push(`~=`),e.querySelectorAll(`a#`+_+`+*`).length||h.push(`.#.+[+~]`),e.querySelectorAll(`:checked`).length||h.push(`:checked`),t=d.createElement(`input`),t.setAttribute(`type`,`hidden`),e.appendChild(t).setAttribute(`name`,`D`),f.appendChild(e).disabled=!0,e.querySelectorAll(`:disabled`).length!==2&&h.push(`:enabled`,`:disabled`),t=d.createElement(`input`),t.setAttribute(`name`,``),e.appendChild(t),e.querySelectorAll(`[name='']`).length||h.push(`\\[`+O+`*name`+O+`*=`+O+`*(?:''|"")`)}),p.cssHas||h.push(`:has`),h=h.length&&new RegExp(h.join(`|`)),j=function(e,t){if(e===t)return c=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1,n&1||!p.sortDetached&&t.compareDocumentPosition(e)===n?e===d||e.ownerDocument==M&&H.contains(M,e)?-1:t===d||t.ownerDocument==M&&H.contains(M,t)?1:o?s.call(o,e)-s.call(o,t):0:n&4?-1:1)},d)}for(t in H.matches=function(e,t){return H(e,null,null,t)},H.matchesSelector=function(e,t){if(ye(e),m&&!A[t+` `]&&(!h||!h.test(t)))try{var n=g.call(e,t);if(n||p.disconnectedMatch||e.document&&e.document.nodeType!==11)return n}catch{A(t,!0)}return H(t,d,null,[e]).length>0},H.contains=function(e,t){return(e.ownerDocument||e)!=d&&ye(e),S.contains(e,t)},H.attr=function(e,t){(e.ownerDocument||e)!=d&&ye(e);var n=r.attrHandle[t.toLowerCase()],i=n&&u.call(r.attrHandle,t.toLowerCase())?n(e,t,!m):void 0;return i===void 0?e.getAttribute(t):i},H.error=function(e){throw Error(`Syntax error, unrecognized expression: `+e)},S.uniqueSort=function(e){var t,n=[],r=0,a=0;if(c=!p.sortStable,o=!p.sortStable&&i.call(e,0),E.call(e,j),c){for(;t=e[a++];)t===e[a]&&(r=n.push(a));for(;r--;)D.call(e,n[r],1)}return o=null,e},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(i.apply(this)))},r=S.expr={cacheLength:50,createPseudo:pe,match:ae,attrHandle:{},find:{},relative:{">":{dir:`parentNode`,first:!0}," ":{dir:`parentNode`},"+":{dir:`previousSibling`,first:!0},"~":{dir:`previousSibling`}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ce,V),e[3]=(e[3]||e[4]||e[5]||``).replace(ce,V),e[2]===`~=`&&(e[3]=` `+e[3]+` `),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)===`nth`?(e[3]||H.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]===`even`||e[3]===`odd`)),e[5]=+(e[7]+e[8]||e[3]===`odd`)):e[3]&&H.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ae.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||``:n&&L.test(n)&&(t=xe(n,!0))&&(t=n.indexOf(`)`,n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ce,V).toLowerCase();return e===`*`?function(){return!0}:function(e){return w(e,t)}},CLASS:function(e){var t=b[e+` `];return t||(t=RegExp(`(^|`+O+`)`+e+`(`+O+`|$)`))&&b(e,function(e){return t.test(typeof e.className==`string`&&e.className||e.getAttribute!==void 0&&e.getAttribute(`class`)||``)})},ATTR:function(e,t,n){return function(r){var i=H.attr(r,e);return i==null?t===`!=`:t?(i+=``,t===`=`?i===n:t===`!=`?i!==n:t===`^=`?n&&i.indexOf(n)===0:t===`*=`?n&&i.indexOf(n)>-1:t===`$=`?n&&i.slice(-n.length)===n:t===`~=`?(` `+i.replace(I,` `)+` `).indexOf(n)>-1:t===`|=`?i===n||i.slice(0,n.length+1)===n+`-`:!1):!0}},CHILD:function(e,t,n,r,i){var a=e.slice(0,3)!==`nth`,o=e.slice(-4)!==`last`,s=t===`of-type`;return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,c){var l,u,d,f,p,m=a===o?`previousSibling`:`nextSibling`,h=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!c&&!s,b=!1;if(h){if(a){for(;m;){for(d=t;d=d[m];)if(s?w(d,g):d.nodeType===1)return!1;p=m=e===`only`&&!p&&`nextSibling`}return!0}if(p=[o?h.firstChild:h.lastChild],o&&y){for(u=h[_]||(h[_]={}),l=u[e]||[],f=l[0]===v&&l[1],b=f&&l[2],d=f&&h.childNodes[f];d=++f&&d&&d[m]||(b=f=0)||p.pop();)if(d.nodeType===1&&++b&&d===t){u[e]=[v,f,b];break}}else if(y&&(u=t[_]||(t[_]={}),l=u[e]||[],f=l[0]===v&&l[1],b=f),b===!1)for(;(d=++f&&d&&d[m]||(b=f=0)||p.pop())&&!((s?w(d,g):d.nodeType===1)&&++b&&(y&&(u=d[_]||(d[_]={}),u[e]=[v,b]),d===t)););return b-=i,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||H.error(`unsupported pseudo: `+e);return i[_]?i(t):i.length>1?(n=[e,e,``,t],r.setFilters.hasOwnProperty(e.toLowerCase())?pe(function(e,n){for(var r,a=i(e,t),o=a.length;o--;)r=s.call(e,a[o]),e[r]=!(n[r]=a[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:pe(function(e){var t=[],n=[],r=Ae(e.replace(k,`$1`));return r[_]?pe(function(e,t,n,i){for(var a,o=r(e,null,i,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))}):function(e,i,a){return t[0]=e,r(t,null,a,n),t[0]=null,!n.pop()}}),has:pe(function(e){return function(t){return H(e,t).length>0}}),contains:pe(function(e){return e=e.replace(ce,V),function(t){return(t.textContent||S.text(t)).indexOf(e)>-1}}),lang:pe(function(e){return R.test(e||``)||H.error(`unsupported lang: `+e),e=e.replace(ce,V).toLowerCase(),function(t){var n;do if(n=m?t.lang:t.getAttribute(`xml:lang`)||t.getAttribute(`lang`))return n=n.toLowerCase(),n===e||n.indexOf(e+`-`)===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===de()&&d.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:U(!1),disabled:U(!0),checked:function(e){return w(e,`input`)&&!!e.checked||w(e,`option`)&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return B.test(e.nodeName)},input:function(e){return z.test(e.nodeName)},button:function(e){return w(e,`input`)&&e.type===`button`||w(e,`button`)},text:function(e){var t;return w(e,`input`)&&e.type===`text`&&((t=e.getAttribute(`type`))==null||t.toLowerCase()===`text`)},first:_e(function(){return[0]}),last:_e(function(e,t){return[t-1]}),eq:_e(function(e,t,n){return[n<0?n+t:n]}),even:_e(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:_e(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:_e(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:_e(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=he(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ge(t);function be(){}be.prototype=r.filters=r.pseudos,r.setFilters=new be;function xe(e,t){var n,i,a,o,s,c,l,u=x[e+` `];if(u)return t?0:u.slice(0);for(s=e,c=[],l=r.preFilter;s;){for(o in(!n||(i=ne.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),c.push(a=[])),n=!1,(i=re.exec(s))&&(n=i.shift(),a.push({value:n,type:i[0].replace(k,` `)}),s=s.slice(n.length)),r.filter)(i=ae[o].exec(s))&&(!l[o]||(i=l[o](i)))&&(n=i.shift(),a.push({value:n,type:o,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?H.error(e):x(e,c).slice(0)}function Se(e){for(var t=0,n=e.length,r=``;t<n;t++)r+=e[t].value;return r}function Ce(e,t,n){var r=t.dir,i=t.next,a=i||r,o=n&&a===`parentNode`,s=y++;return t.first?function(t,n,i){for(;t=t[r];)if(t.nodeType===1||o)return e(t,n,i);return!1}:function(t,n,c){var l,u,d=[v,s];if(c){for(;t=t[r];)if((t.nodeType===1||o)&&e(t,n,c))return!0}else for(;t=t[r];)if(t.nodeType===1||o){if(u=t[_]||(t[_]={}),i&&w(t,i))t=t[r]||t;else if((l=u[a])&&l[0]===v&&l[1]===s)return d[2]=l[2];else if(u[a]=d,d[2]=e(t,n,c))return!0}return!1}}function we(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Te(e,t,n){for(var r=0,i=t.length;r<i;r++)H(e,t[r],n);return n}function Ee(e,t,n,r,i){for(var a,o=[],s=0,c=e.length,l=t!=null;s<c;s++)(a=e[s])&&(!n||n(a,r,i))&&(o.push(a),l&&t.push(s));return o}function De(e,t,n,r,i,a){return r&&!r[_]&&(r=De(r)),i&&!i[_]&&(i=De(i,a)),pe(function(a,o,c,u){var d,f,p,m,h=[],g=[],_=o.length,v=a||Te(t||`*`,c.nodeType?[c]:c,[]),y=e&&(a||!t)?Ee(v,h,e,c,u):v;if(n?(m=i||(a?e:_||r)?[]:o,n(y,m,c,u)):m=y,r)for(d=Ee(m,g),r(d,[],c,u),f=d.length;f--;)(p=d[f])&&(m[g[f]]=!(y[g[f]]=p));if(a){if(i||e){if(i){for(d=[],f=m.length;f--;)(p=m[f])&&d.push(y[f]=p);i(null,m=[],d,u)}for(f=m.length;f--;)(p=m[f])&&(d=i?s.call(a,p):h[f])>-1&&(a[d]=!(o[d]=p))}}else m=Ee(m===o?m.splice(_,m.length):m),i?i(null,o,m,u):l.apply(o,m)})}function Oe(e){for(var t,n,i,o=e.length,c=r.relative[e[0].type],l=c||r.relative[` `],u=+!!c,d=Ce(function(e){return e===t},l,!0),f=Ce(function(e){return s.call(t,e)>-1},l,!0),p=[function(e,n,r){var i=!c&&(r||n!=a)||((t=n).nodeType?d(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[Ce(we(p),n)];else{if(n=r.filter[e[u].type].apply(null,e[u].matches),n[_]){for(i=++u;i<o&&!r.relative[e[i].type];i++);return De(u>1&&we(p),u>1&&Se(e.slice(0,u-1).concat({value:e[u-2].type===` `?`*`:``})).replace(k,`$1`),n,u<i&&Oe(e.slice(u,i)),i<o&&Oe(e=e.slice(i)),i<o&&Se(e))}p.push(n)}return we(p)}function ke(e,t){var n=t.length>0,i=e.length>0,o=function(o,s,c,u,f){var p,h,g,_=0,y=`0`,b=o&&[],x=[],C=a,w=o||i&&r.find.TAG(`*`,f),E=v+=C==null?1:Math.random()||.1,D=w.length;for(f&&(a=s==d||s||f);y!==D&&(p=w[y])!=null;y++){if(i&&p){for(h=0,!s&&p.ownerDocument!=d&&(ye(p),c=!m);g=e[h++];)if(g(p,s||d,c)){l.call(u,p);break}f&&(v=E)}n&&((p=!g&&p)&&_--,o&&b.push(p))}if(_+=y,n&&y!==_){for(h=0;g=t[h++];)g(b,x,s,c);if(o){if(_>0)for(;y--;)b[y]||x[y]||(x[y]=T.call(u));x=Ee(x)}l.apply(u,x),f&&!o&&x.length>0&&_+t.length>1&&S.uniqueSort(u)}return f&&(v=E,a=C),b};return n?pe(o):o}function Ae(e,t){var n,r=[],i=[],a=C[e+` `];if(!a){for(t||=xe(e),n=t.length;n--;)a=Oe(t[n]),a[_]?r.push(a):i.push(a);a=C(e,ke(i,r)),a.selector=e}return a}function je(e,t,n,i){var a,o,s,c,u,d=typeof e==`function`&&e,f=!i&&xe(e=d.selector||e);if(n||=[],f.length===1){if(o=f[0]=f[0].slice(0),o.length>2&&(s=o[0]).type===`ID`&&t.nodeType===9&&m&&r.relative[o[1].type]){if(t=(r.find.ID(s.matches[0].replace(ce,V),t)||[])[0],t)d&&(t=t.parentNode);else return n;e=e.slice(o.shift().value.length)}for(a=ae.needsContext.test(e)?0:o.length;a--&&(s=o[a],!r.relative[c=s.type]);)if((u=r.find[c])&&(i=u(s.matches[0].replace(ce,V),se.test(o[0].type)&&ve(t.parentNode)||t))){if(o.splice(a,1),e=i.length&&Se(o),!e)return l.apply(n,i),n;break}}return(d||Ae(e,f))(i,t,!m,n,!t||se.test(e)&&ve(t.parentNode)||t),n}p.sortStable=_.split(``).sort(j).join(``)===_,ye(),p.sortDetached=me(function(e){return e.compareDocumentPosition(d.createElement(`fieldset`))&1}),S.find=H,S.expr[`:`]=S.expr.pseudos,S.unique=S.uniqueSort,H.compile=Ae,H.select=je,H.setDocument=ye,H.tokenize=xe,H.escape=S.escapeSelector,H.getText=S.text,H.isXML=S.isXMLDoc,H.selectors=S.expr,H.support=S.support,H.uniqueSort=S.uniqueSort})();var P=function(e,t,n){for(var r=[],i=n!==void 0;(e=e[t])&&e.nodeType!==9;)if(e.nodeType===1){if(i&&S(e).is(n))break;r.push(e)}return r},F=function(e,t){for(var n=[];e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n},ee=S.expr.match.needsContext,te=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function I(e,t,n){return m(t)?S.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):typeof t==`string`?S.filter(t,e,n):S.grep(e,function(e){return s.call(t,e)>-1!==n})}S.filter=function(e,t,n){var r=t[0];return n&&(e=`:not(`+e+`)`),t.length===1&&r.nodeType===1?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return e.nodeType===1}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if(typeof e!=`string`)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(I(this,e||[],!1))},not:function(e){return this.pushStack(I(this,e||[],!0))},is:function(e){return!!I(this,typeof e==`string`&&ee.test(e)?S(e):e||[],!1).length}});var ne,re=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,ie=S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n||=ne,typeof e==`string`)if(r=e[0]===`<`&&e[e.length-1]===`>`&&e.length>=3?[null,e,null]:re.exec(e),r&&(r[1]||!t))if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),te.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}else return i=g.getElementById(r[2]),i&&(this[0]=i,this.length=1),this;else if(!t||t.jquery)return(t||n).find(e);else return this.constructor(t).find(e);else if(e.nodeType)return this[0]=e,this.length=1,this;else if(m(e))return n.ready===void 0?e(S):n.ready(e);return S.makeArray(e,this)};ie.prototype=S.fn,ne=S(g);var L=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,a=[],o=typeof e!=`string`&&S(e);if(!ee.test(e)){for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:n.nodeType===1&&S.find.matchesSelector(n,e))){a.push(n);break}}return this.pushStack(a.length>1?S.uniqueSort(a):a)},index:function(e){return e?typeof e==`string`?s.call(S(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}});function ae(e,t){for(;(e=e[t])&&e.nodeType!==1;);return e}S.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return P(e,`parentNode`)},parentsUntil:function(e,t,n){return P(e,`parentNode`,n)},next:function(e){return ae(e,`nextSibling`)},prev:function(e){return ae(e,`previousSibling`)},nextAll:function(e){return P(e,`nextSibling`)},prevAll:function(e){return P(e,`previousSibling`)},nextUntil:function(e,t,n){return P(e,`nextSibling`,n)},prevUntil:function(e,t,n){return P(e,`previousSibling`,n)},siblings:function(e){return F((e.parentNode||{}).firstChild,e)},children:function(e){return F(e.firstChild)},contents:function(e){return e.contentDocument!=null&&r(e.contentDocument)?e.contentDocument:(w(e,`template`)&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,r){var i=S.map(this,t,n);return e.slice(-5)!==`Until`&&(r=n),r&&typeof r==`string`&&(i=S.filter(r,i)),this.length>1&&(R[e]||S.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}});var z=/[^\x20\t\r\n\f]+/g;function B(e){var t={};return S.each(e.match(z)||[],function(e,n){t[n]=!0}),t}S.Callbacks=function(e){e=typeof e==`string`?B(e):S.extend({},e);var t,n,r,i,a=[],o=[],s=-1,c=function(){for(i||=e.once,r=t=!0;o.length;s=-1)for(n=o.shift();++s<a.length;)a[s].apply(n[0],n[1])===!1&&e.stopOnFalse&&(s=a.length,n=!1);e.memory||(n=!1),t=!1,i&&(a=n?[]:``)},l={add:function(){return a&&(n&&!t&&(s=a.length-1,o.push(n)),(function t(n){S.each(n,function(n,r){m(r)?(!e.unique||!l.has(r))&&a.push(r):r&&r.length&&y(r)!==`string`&&t(r)})})(arguments),n&&!t&&c()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;(n=S.inArray(t,a,n))>-1;)a.splice(n,1),n<=s&&s--}),this},has:function(e){return e?S.inArray(e,a)>-1:a.length>0},empty:function(){return a&&=[],this},disable:function(){return i=o=[],a=n=``,this},disabled:function(){return!a},lock:function(){return i=o=[],!n&&!t&&(a=n=``),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n||=[],n=[e,n.slice?n.slice():n],o.push(n),t||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function oe(e){return e}function se(e){throw e}function ce(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.extend({Deferred:function(t){var n=[[`notify`,`progress`,S.Callbacks(`memory`),S.Callbacks(`memory`),2],[`resolve`,`done`,S.Callbacks(`once memory`),S.Callbacks(`once memory`),0,`resolved`],[`reject`,`fail`,S.Callbacks(`once memory`),S.Callbacks(`once memory`),1,`rejected`]],r=`pending`,i={state:function(){return r},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return S.Deferred(function(t){S.each(n,function(n,r){var i=m(e[r[4]])&&e[r[4]];a[r[1]](function(){var e=i&&i.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+`With`](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var a=0;function o(t,n,r,i){return function(){var s=this,c=arguments,l=function(){var e,l;if(!(t<a)){if(e=r.apply(s,c),e===n.promise())throw TypeError(`Thenable self-resolution`);l=e&&(typeof e==`object`||typeof e==`function`)&&e.then,m(l)?i?l.call(e,o(a,n,oe,i),o(a,n,se,i)):(a++,l.call(e,o(a,n,oe,i),o(a,n,se,i),o(a,n,oe,n.notifyWith))):(r!==oe&&(s=void 0,c=[e]),(i||n.resolveWith)(s,c))}},u=i?l:function(){try{l()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,u.error),t+1>=a&&(r!==se&&(s=void 0,c=[e]),n.rejectWith(s,c))}};t?u():(S.Deferred.getErrorHook?u.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(u.error=S.Deferred.getStackHook()),e.setTimeout(u))}}return S.Deferred(function(e){n[0][3].add(o(0,e,m(i)?i:oe,e.notifyWith)),n[1][3].add(o(0,e,m(t)?t:oe)),n[2][3].add(o(0,e,m(r)?r:se))}).promise()},promise:function(e){return e==null?i:S.extend(e,i)}},a={};return S.each(n,function(e,t){var o=t[2],s=t[5];i[t[1]]=o.add,s&&o.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),o.add(t[3].fire),a[t[0]]=function(){return a[t[0]+`With`](this===a?void 0:this,arguments),this},a[t[0]+`With`]=o.fireWith}),i.promise(a),t&&t.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),a=i.call(arguments),o=S.Deferred(),s=function(e){return function(n){r[e]=this,a[e]=arguments.length>1?i.call(arguments):n,--t||o.resolveWith(r,a)}};if(t<=1&&(ce(e,o.done(s(n)).resolve,o.reject,!t),o.state()===`pending`||m(a[n]&&a[n].then)))return o.then();for(;n--;)ce(a[n],s(n),o.reject);return o.promise()}});var V=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&V.test(t.name)&&e.console.warn(`jQuery.Deferred exception: `+t.message,t.stack,n)},S.readyException=function(t){e.setTimeout(function(){throw t})};var le=S.Deferred();S.fn.ready=function(e){return le.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(e===!0?--S.readyWait:S.isReady)||(S.isReady=!0,!(e!==!0&&--S.readyWait>0)&&le.resolveWith(g,[S]))}}),S.ready.then=le.then;function ue(){g.removeEventListener(`DOMContentLoaded`,ue),e.removeEventListener(`load`,ue),S.ready()}g.readyState===`complete`||g.readyState!==`loading`&&!g.documentElement.doScroll?e.setTimeout(S.ready):(g.addEventListener(`DOMContentLoaded`,ue),e.addEventListener(`load`,ue));var de=function(e,t,n,r,i,a,o){var s=0,c=e.length,l=n==null;if(y(n)===`object`)for(s in i=!0,n)de(e,t,s,n[s],!0,a,o);else if(r!==void 0&&(i=!0,m(r)||(o=!0),l&&(o?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<c;s++)t(e[s],n,o?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):c?t(e[0],n):a},H=/^-ms-/,fe=/-([a-z])/g;function pe(e,t){return t.toUpperCase()}function me(e){return e.replace(H,`ms-`).replace(fe,pe)}var he=function(e){return e.nodeType===1||e.nodeType===9||!+e.nodeType};function ge(){this.expando=S.expando+ ge.uid++}ge.uid=1,ge.prototype={cache:function(e){var t=e[this.expando];return t||(t={},he(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if(typeof t==`string`)i[me(t)]=n;else for(r in t)i[me(r)]=t[r];return i},get:function(e,t){return t===void 0?this.cache(e):e[this.expando]&&e[this.expando][me(t)]},access:function(e,t,n){return t===void 0||t&&typeof t==`string`&&n===void 0?this.get(e,t):(this.set(e,t,n),n===void 0?t:n)},remove:function(e,t){var n,r=e[this.expando];if(r!==void 0){if(t!==void 0)for(Array.isArray(t)?t=t.map(me):(t=me(t),t=(t in r)?[t]:t.match(z)||[]),n=t.length;n--;)delete r[t[n]];(t===void 0||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return t!==void 0&&!S.isEmptyObject(t)}};var U=new ge,_e=new ge,ve=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ye=/[A-Z]/g;function be(e){return e===`true`?!0:e===`false`?!1:e===`null`?null:e===+e+``?+e:ve.test(e)?JSON.parse(e):e}function xe(e,t,n){var r;if(n===void 0&&e.nodeType===1)if(r=`data-`+t.replace(ye,`-$&`).toLowerCase(),n=e.getAttribute(r),typeof n==`string`){try{n=be(n)}catch{}_e.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return _e.hasData(e)||U.hasData(e)},data:function(e,t,n){return _e.access(e,t,n)},removeData:function(e,t){_e.remove(e,t)},_data:function(e,t,n){return U.access(e,t,n)},_removeData:function(e,t){U.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,i,a=this[0],o=a&&a.attributes;if(e===void 0){if(this.length&&(i=_e.get(a),a.nodeType===1&&!U.get(a,`hasDataAttrs`))){for(n=o.length;n--;)o[n]&&(r=o[n].name,r.indexOf(`data-`)===0&&(r=me(r.slice(5)),xe(a,r,i[r])));U.set(a,`hasDataAttrs`,!0)}return i}return typeof e==`object`?this.each(function(){_e.set(this,e)}):de(this,function(t){var n;if(a&&t===void 0)return n=_e.get(a,e),n!==void 0||(n=xe(a,e),n!==void 0)?n:void 0;this.each(function(){_e.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){_e.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||`fx`)+`queue`,r=U.get(e,t),n&&(!r||Array.isArray(n)?r=U.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t||=`fx`;var n=S.queue(e,t),r=n.length,i=n.shift(),a=S._queueHooks(e,t);i===`inprogress`&&(i=n.shift(),r--),i&&(t===`fx`&&n.unshift(`inprogress`),delete a.stop,i.call(e,function(){S.dequeue(e,t)},a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+`queueHooks`;return U.get(e,n)||U.access(e,n,{empty:S.Callbacks(`once memory`).add(function(){U.remove(e,[t+`queue`,n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return typeof e!=`string`&&(t=e,e=`fx`,n--),arguments.length<n?S.queue(this[0],e):t===void 0?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),e===`fx`&&n[0]!==`inprogress`&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||`fx`,[])},promise:function(e,t){var n,r=1,i=S.Deferred(),a=this,o=this.length,s=function(){--r||i.resolveWith(a,[a])};for(typeof e!=`string`&&(t=e,e=void 0),e||=`fx`;o--;)n=U.get(a[o],e+`queueHooks`),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Se=`[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)`,Ce=RegExp(`^(?:([+-])=|)(`+Se+`)([a-z%]*)$`,`i`),we=[`Top`,`Right`,`Bottom`,`Left`],Te=g.documentElement,Ee=function(e){return S.contains(e.ownerDocument,e)},De={composed:!0};Te.getRootNode&&(Ee=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(De)===e.ownerDocument});var Oe=function(e,t){return e=t||e,e.style.display===`none`||e.style.display===``&&Ee(e)&&S.css(e,`display`)===`none`};function ke(e,t,n,r){var i,a,o=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,``)},c=s(),l=n&&n[3]||(S.cssNumber[t]?``:`px`),u=e.nodeType&&(S.cssNumber[t]||l!==`px`&&+c)&&Ce.exec(S.css(e,t));if(u&&u[3]!==l){for(c/=2,l||=u[3],u=+c||1;o--;)S.style(e,t,u+l),(1-a)*(1-(a=s()/c||.5))<=0&&(o=0),u/=a;u*=2,S.style(e,t,u+l),n||=[]}return n&&(u=+u||+c||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=u,r.end=i)),i}var Ae={};function je(e){var t,n=e.ownerDocument,r=e.nodeName,i=Ae[r];return i||(t=n.body.appendChild(n.createElement(r)),i=S.css(t,`display`),t.parentNode.removeChild(t),i===`none`&&(i=`block`),Ae[r]=i,i)}function Me(e,t){for(var n,r,i=[],a=0,o=e.length;a<o;a++)r=e[a],r.style&&(n=r.style.display,t?(n===`none`&&(i[a]=U.get(r,`display`)||null,i[a]||(r.style.display=``)),r.style.display===``&&Oe(r)&&(i[a]=je(r))):n!==`none`&&(i[a]=`none`,U.set(r,`display`,n)));for(a=0;a<o;a++)i[a]!=null&&(e[a].style.display=i[a]);return e}S.fn.extend({show:function(){return Me(this,!0)},hide:function(){return Me(this)},toggle:function(e){return typeof e==`boolean`?e?this.show():this.hide():this.each(function(){Oe(this)?S(this).show():S(this).hide()})}});var Ne=/^(?:checkbox|radio)$/i,Pe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Fe=/^$|^module$|\/(?:java|ecma)script/i;(function(){var e=g.createDocumentFragment().appendChild(g.createElement(`div`)),t=g.createElement(`input`);t.setAttribute(`type`,`radio`),t.setAttribute(`checked`,`checked`),t.setAttribute(`name`,`t`),e.appendChild(t),p.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML=`<textarea>x</textarea>`,p.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,e.innerHTML=`<option></option>`,p.option=!!e.lastChild})();var Ie={thead:[1,`<table>`,`</table>`],col:[2,`<table><colgroup>`,`</colgroup></table>`],tr:[2,`<table><tbody>`,`</tbody></table>`],td:[3,`<table><tbody><tr>`,`</tr></tbody></table>`],_default:[0,``,``]};Ie.tbody=Ie.tfoot=Ie.colgroup=Ie.caption=Ie.thead,Ie.th=Ie.td,p.option||(Ie.optgroup=Ie.option=[1,`<select multiple='multiple'>`,`</select>`]);function Le(e,t){var n=e.getElementsByTagName===void 0?e.querySelectorAll===void 0?[]:e.querySelectorAll(t||`*`):e.getElementsByTagName(t||`*`);return t===void 0||t&&w(e,t)?S.merge([e],n):n}function Re(e,t){for(var n=0,r=e.length;n<r;n++)U.set(e[n],`globalEval`,!t||U.get(t[n],`globalEval`))}var ze=/<|&#?\w+;/;function Be(e,t,n,r,i){for(var a,o,s,c,l,u,d=t.createDocumentFragment(),f=[],p=0,m=e.length;p<m;p++)if(a=e[p],a||a===0)if(y(a)===`object`)S.merge(f,a.nodeType?[a]:a);else if(!ze.test(a))f.push(t.createTextNode(a));else{for(o||=d.appendChild(t.createElement(`div`)),s=(Pe.exec(a)||[``,``])[1].toLowerCase(),c=Ie[s]||Ie._default,o.innerHTML=c[1]+S.htmlPrefilter(a)+c[2],u=c[0];u--;)o=o.lastChild;S.merge(f,o.childNodes),o=d.firstChild,o.textContent=``}for(d.textContent=``,p=0;a=f[p++];){if(r&&S.inArray(a,r)>-1){i&&i.push(a);continue}if(l=Ee(a),o=Le(d.appendChild(a),`script`),l&&Re(o),n)for(u=0;a=o[u++];)Fe.test(a.type||``)&&n.push(a)}return d}var Ve=/^([^.]*)(?:\.(.+)|)/;function He(){return!0}function Ue(){return!1}function We(e,t,n,r,i,a){var o,s;if(typeof t==`object`){for(s in typeof n!=`string`&&(r||=n,n=void 0),t)We(e,s,n,r,t[s],a);return e}if(r==null&&i==null?(i=n,r=n=void 0):i??(typeof n==`string`?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=Ue;else if(!i)return e;return a===1&&(o=i,i=function(e){return S().off(e),o.apply(this,arguments)},i.guid=o.guid||=S.guid++),e.each(function(){S.event.add(this,t,i,r,n)})}S.event={global:{},add:function(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h,g=U.get(e);if(he(e))for(n.handler&&(a=n,n=a.handler,i=a.selector),i&&S.find.matchesSelector(Te,i),n.guid||=S.guid++,(c=g.events)||(c=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(t){return S!==void 0&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),t=(t||``).match(z)||[``],l=t.length;l--;)s=Ve.exec(t[l])||[],p=h=s[1],m=(s[2]||``).split(`.`).sort(),p&&(d=S.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=S.event.special[p]||{},u=S.extend({type:p,origType:h,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:m.join(`.`)},a),(f=c[p])||(f=c[p]=[],f.delegateCount=0,(!d.setup||d.setup.call(e,r,m,o)===!1)&&e.addEventListener&&e.addEventListener(p,o)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,u):f.push(u),S.event.global[p]=!0)},remove:function(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h,g=U.hasData(e)&&U.get(e);if(!(!g||!(c=g.events))){for(t=(t||``).match(z)||[``],l=t.length;l--;){if(s=Ve.exec(t[l])||[],p=h=s[1],m=(s[2]||``).split(`.`).sort(),!p){for(p in c)S.event.remove(e,p+t[l],n,r,!0);continue}for(d=S.event.special[p]||{},p=(r?d.delegateType:d.bindType)||p,f=c[p]||[],s=s[2]&&RegExp(`(^|\\.)`+m.join(`\\.(?:.*\\.|)`)+`(\\.|$)`),o=a=f.length;a--;)u=f[a],(i||h===u.origType)&&(!n||n.guid===u.guid)&&(!s||s.test(u.namespace))&&(!r||r===u.selector||r===`**`&&u.selector)&&(f.splice(a,1),u.selector&&f.delegateCount--,d.remove&&d.remove.call(e,u));o&&!f.length&&((!d.teardown||d.teardown.call(e,m,g.handle)===!1)&&S.removeEvent(e,p,g.handle),delete c[p])}S.isEmptyObject(c)&&U.remove(e,`handle events`)}},dispatch:function(e){var t,n,r,i,a,o,s=Array(arguments.length),c=S.event.fix(e),l=(U.get(this,`events`)||Object.create(null))[c.type]||[],u=S.event.special[c.type]||{};for(s[0]=c,t=1;t<arguments.length;t++)s[t]=arguments[t];if(c.delegateTarget=this,!(u.preDispatch&&u.preDispatch.call(this,c)===!1)){for(o=S.event.handlers.call(this,c,l),t=0;(i=o[t++])&&!c.isPropagationStopped();)for(c.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!c.isImmediatePropagationStopped();)(!c.rnamespace||a.namespace===!1||c.rnamespace.test(a.namespace))&&(c.handleObj=a,c.data=a.data,r=((S.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,s),r!==void 0&&(c.result=r)===!1&&(c.preventDefault(),c.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,c),c.result}},handlers:function(e,t){var n,r,i,a,o,s=[],c=t.delegateCount,l=e.target;if(c&&l.nodeType&&!(e.type===`click`&&e.button>=1)){for(;l!==this;l=l.parentNode||this)if(l.nodeType===1&&!(e.type===`click`&&l.disabled===!0)){for(a=[],o={},n=0;n<c;n++)r=t[n],i=r.selector+` `,o[i]===void 0&&(o[i]=r.needsContext?S(i,this).index(l)>-1:S.find(i,this,null,[l]).length),o[i]&&a.push(r);a.length&&s.push({elem:l,handlers:a})}}return l=this,c<t.length&&s.push({elem:l,handlers:t.slice(c)}),s},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:m(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Ne.test(t.type)&&t.click&&w(t,`input`)&&Ge(t,`click`,!0),!1},trigger:function(e){var t=this||e;return Ne.test(t.type)&&t.click&&w(t,`input`)&&Ge(t,`click`),!0},_default:function(e){var t=e.target;return Ne.test(t.type)&&t.click&&w(t,`input`)&&U.get(t,`click`)||w(t,`a`)}},beforeunload:{postDispatch:function(e){e.result!==void 0&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}};function Ge(e,t,n){if(!n){U.get(e,t)===void 0&&S.event.add(e,t,He);return}U.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var n,r=U.get(this,t);if(e.isTrigger&1&&this[t]){if(r)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),U.set(this,t,r),this[t](),n=U.get(this,t),U.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(U.set(this,t,S.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=He)}})}S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.defaultPrevented===void 0&&e.returnValue===!1?He:Ue,this.target=e.target&&e.target.nodeType===3?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ue,isPropagationStopped:Ue,isImmediatePropagationStopped:Ue,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=He,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=He,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=He,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:`focusin`,blur:`focusout`},function(e,t){function n(e){if(g.documentMode){var n=U.get(this,`handle`),r=S.event.fix(e);r.type=e.type===`focusin`?`focus`:`blur`,r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else S.event.simulate(t,e.target,S.event.fix(e))}S.event.special[e]={setup:function(){var r;if(Ge(this,e,!0),g.documentMode)r=U.get(this,t),r||this.addEventListener(t,n),U.set(this,t,(r||0)+1);else return!1},trigger:function(){return Ge(this,e),!0},teardown:function(){var e;if(g.documentMode)e=U.get(this,t)-1,e?U.set(this,t,e):(this.removeEventListener(t,n),U.remove(this,t));else return!1},_default:function(t){return U.get(t.target,e)},delegateType:t},S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=g.documentMode?this:r,a=U.get(i,t);a||(g.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),U.set(i,t,(a||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=g.documentMode?this:r,a=U.get(i,t)-1;a?U.set(i,t,a):(g.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),U.remove(i,t))}}}),S.each({mouseenter:`mouseover`,mouseleave:`mouseout`,pointerenter:`pointerover`,pointerleave:`pointerout`},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,a=e.handleObj;return(!i||i!==r&&!S.contains(r,i))&&(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,r){return We(this,e,t,n,r)},one:function(e,t,n,r){return We(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+`.`+r.namespace:r.origType,r.selector,r.handler),this;if(typeof e==`object`){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||typeof t==`function`)&&(n=t,t=void 0),n===!1&&(n=Ue),this.each(function(){S.event.remove(this,e,n,t)})}});var Ke=/<script|<style|<link/i,qe=/checked\s*(?:[^=]|=\s*.checked.)/i,Je=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Ye(e,t){return w(e,`table`)&&w(t.nodeType===11?t.firstChild:t,`tr`)&&S(e).children(`tbody`)[0]||e}function Xe(e){return e.type=(e.getAttribute(`type`)!==null)+`/`+e.type,e}function Ze(e){return(e.type||``).slice(0,5)===`true/`?e.type=e.type.slice(5):e.removeAttribute(`type`),e}function Qe(e,t){var n,r,i,a,o,s,c;if(t.nodeType===1){if(U.hasData(e)&&(a=U.get(e),c=a.events,c))for(i in U.remove(t,`handle events`),c)for(n=0,r=c[i].length;n<r;n++)S.event.add(t,i,c[i][n]);_e.hasData(e)&&(o=_e.access(e),s=S.extend({},o),_e.set(t,s))}}function $e(e,t){var n=t.nodeName.toLowerCase();n===`input`&&Ne.test(e.type)?t.checked=e.checked:(n===`input`||n===`textarea`)&&(t.defaultValue=e.defaultValue)}function et(e,t,n,r){t=a(t);var i,o,s,c,l,u,d=0,f=e.length,h=f-1,g=t[0],_=m(g);if(_||f>1&&typeof g==`string`&&!p.checkClone&&qe.test(g))return e.each(function(i){var a=e.eq(i);_&&(t[0]=g.call(this,i,a.html())),et(a,t,n,r)});if(f&&(i=Be(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,i.childNodes.length===1&&(i=o),o||r)){for(s=S.map(Le(i,`script`),Xe),c=s.length;d<f;d++)l=i,d!==h&&(l=S.clone(l,!0,!0),c&&S.merge(s,Le(l,`script`))),n.call(e[d],l,d);if(c)for(u=s[s.length-1].ownerDocument,S.map(s,Ze),d=0;d<c;d++)l=s[d],Fe.test(l.type||``)&&!U.access(l,`globalEval`)&&S.contains(u,l)&&(l.src&&(l.type||``).toLowerCase()!==`module`?S._evalUrl&&!l.noModule&&S._evalUrl(l.src,{nonce:l.nonce||l.getAttribute(`nonce`)},u):v(l.textContent.replace(Je,``),l,u))}return e}function tt(e,t,n){for(var r,i=t?S.filter(t,e):e,a=0;(r=i[a])!=null;a++)!n&&r.nodeType===1&&S.cleanData(Le(r)),r.parentNode&&(n&&Ee(r)&&Re(Le(r,`script`)),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,a,o,s=e.cloneNode(!0),c=Ee(e);if(!p.noCloneChecked&&(e.nodeType===1||e.nodeType===11)&&!S.isXMLDoc(e))for(o=Le(s),a=Le(e),r=0,i=a.length;r<i;r++)$e(a[r],o[r]);if(t)if(n)for(a||=Le(e),o||=Le(s),r=0,i=a.length;r<i;r++)Qe(a[r],o[r]);else Qe(e,s);return o=Le(s,`script`),o.length>0&&Re(o,!c&&Le(e,`script`)),s},cleanData:function(e){for(var t,n,r,i=S.event.special,a=0;(n=e[a])!==void 0;a++)if(he(n)){if(t=n[U.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[U.expando]=void 0}n[_e.expando]&&(n[_e.expando]=void 0)}}}),S.fn.extend({detach:function(e){return tt(this,e,!0)},remove:function(e){return tt(this,e)},text:function(e){return de(this,function(e){return e===void 0?S.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return et(this,arguments,function(e){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&Ye(this,e).appendChild(e)})},prepend:function(){return et(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=Ye(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return et(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return et(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;(e=this[t])!=null;t++)e.nodeType===1&&(S.cleanData(Le(e,!1)),e.textContent=``);return this},clone:function(e,t){return e??=!1,t??=e,this.map(function(){return S.clone(this,e,t)})},html:function(e){return de(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===void 0&&t.nodeType===1)return t.innerHTML;if(typeof e==`string`&&!Ke.test(e)&&!Ie[(Pe.exec(e)||[``,``])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)t=this[n]||{},t.nodeType===1&&(S.cleanData(Le(t,!1)),t.innerHTML=e);t=0}catch{}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return et(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(Le(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:`append`,prependTo:`prepend`,insertBefore:`before`,insertAfter:`after`,replaceAll:`replaceWith`},function(e,t){S.fn[e]=function(e){for(var n,r=[],i=S(e),a=i.length-1,s=0;s<=a;s++)n=s===a?this:this.clone(!0),S(i[s])[t](n),o.apply(r,n.get());return this.pushStack(r)}});var nt=RegExp(`^(`+Se+`)(?!px)[a-z%]+$`,`i`),rt=/^--/,it=function(t){var n=t.ownerDocument.defaultView;return(!n||!n.opener)&&(n=e),n.getComputedStyle(t)},at=function(e,t,n){var r,i,a={};for(i in t)a[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=a[i];return r},ot=new RegExp(we.join(`|`),`i`);(function(){function t(){if(u){l.style.cssText=`position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0`,u.style.cssText=`position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%`,Te.appendChild(l).appendChild(u);var t=e.getComputedStyle(u);r=t.top!==`1%`,c=n(t.marginLeft)===12,u.style.right=`60%`,o=n(t.right)===36,i=n(t.width)===36,u.style.position=`absolute`,a=n(u.offsetWidth/3)===12,Te.removeChild(l),u=null}}function n(e){return Math.round(parseFloat(e))}var r,i,a,o,s,c,l=g.createElement(`div`),u=g.createElement(`div`);u.style&&(u.style.backgroundClip=`content-box`,u.cloneNode(!0).style.backgroundClip=``,p.clearCloneStyle=u.style.backgroundClip===`content-box`,S.extend(p,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),c},scrollboxSize:function(){return t(),a},reliableTrDimensions:function(){var t,n,r,i;return s??(t=g.createElement(`table`),n=g.createElement(`tr`),r=g.createElement(`div`),t.style.cssText=`position:absolute;left:-11111px;border-collapse:separate`,n.style.cssText=`box-sizing:content-box;border:1px solid`,n.style.height=`1px`,r.style.height=`9px`,r.style.display=`block`,Te.appendChild(t).appendChild(n).appendChild(r),i=e.getComputedStyle(n),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,Te.removeChild(t)),s}}))})();function st(e,t,n){var r,i,a,o,s=rt.test(t),c=e.style;return n||=it(e),n&&(o=n.getPropertyValue(t)||n[t],s&&o&&(o=o.replace(k,`$1`)||void 0),o===``&&!Ee(e)&&(o=S.style(e,t)),!p.pixelBoxStyles()&&nt.test(o)&&ot.test(t)&&(r=c.width,i=c.minWidth,a=c.maxWidth,c.minWidth=c.maxWidth=c.width=o,o=n.width,c.width=r,c.minWidth=i,c.maxWidth=a)),o===void 0?o:o+``}function ct(e,t){return{get:function(){if(e()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}var lt=[`Webkit`,`Moz`,`ms`],ut=g.createElement(`div`).style,dt={};function ft(e){for(var t=e[0].toUpperCase()+e.slice(1),n=lt.length;n--;)if(e=lt[n]+t,e in ut)return e}function pt(e){return S.cssProps[e]||dt[e]||(e in ut?e:dt[e]=ft(e)||e)}var mt=/^(none|table(?!-c[ea]).+)/,ht={position:`absolute`,visibility:`hidden`,display:`block`},gt={letterSpacing:`0`,fontWeight:`400`};function _t(e,t,n){var r=Ce.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||`px`):t}function vt(e,t,n,r,i,a){var o=+(t===`width`),s=0,c=0,l=0;if(n===(r?`border`:`content`))return 0;for(;o<4;o+=2)n===`margin`&&(l+=S.css(e,n+we[o],!0,i)),r?(n===`content`&&(c-=S.css(e,`padding`+we[o],!0,i)),n!==`margin`&&(c-=S.css(e,`border`+we[o]+`Width`,!0,i))):(c+=S.css(e,`padding`+we[o],!0,i),n===`padding`?s+=S.css(e,`border`+we[o]+`Width`,!0,i):c+=S.css(e,`border`+we[o]+`Width`,!0,i));return!r&&a>=0&&(c+=Math.max(0,Math.ceil(e[`offset`+t[0].toUpperCase()+t.slice(1)]-a-c-s-.5))||0),c+l}function yt(e,t,n){var r=it(e),i=(!p.boxSizingReliable()||n)&&S.css(e,`boxSizing`,!1,r)===`border-box`,a=i,o=st(e,t,r),s=`offset`+t[0].toUpperCase()+t.slice(1);if(nt.test(o)){if(!n)return o;o=`auto`}return(!p.boxSizingReliable()&&i||!p.reliableTrDimensions()&&w(e,`tr`)||o===`auto`||!parseFloat(o)&&S.css(e,`display`,!1,r)===`inline`)&&e.getClientRects().length&&(i=S.css(e,`boxSizing`,!1,r)===`border-box`,a=s in e,a&&(o=e[s])),o=parseFloat(o)||0,o+vt(e,t,n||(i?`border`:`content`),a,r,o)+`px`}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=st(e,`opacity`);return n===``?`1`:n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(!(!e||e.nodeType===3||e.nodeType===8||!e.style)){var i,a,o,s=me(t),c=rt.test(t),l=e.style;if(c||(t=pt(s)),o=S.cssHooks[t]||S.cssHooks[s],n!==void 0){if(a=typeof n,a===`string`&&(i=Ce.exec(n))&&i[1]&&(n=ke(e,t,i),a=`number`),n==null||n!==n)return;a===`number`&&!c&&(n+=i&&i[3]||(S.cssNumber[s]?``:`px`)),!p.clearCloneStyle&&n===``&&t.indexOf(`background`)===0&&(l[t]=`inherit`),(!o||!(`set`in o)||(n=o.set(e,n,r))!==void 0)&&(c?l.setProperty(t,n):l[t]=n)}else return o&&`get`in o&&(i=o.get(e,!1,r))!==void 0?i:l[t]}},css:function(e,t,n,r){var i,a,o,s=me(t);return rt.test(t)||(t=pt(s)),o=S.cssHooks[t]||S.cssHooks[s],o&&`get`in o&&(i=o.get(e,!0,n)),i===void 0&&(i=st(e,t,r)),i===`normal`&&t in gt&&(i=gt[t]),n===``||n?(a=parseFloat(i),n===!0||isFinite(a)?a||0:i):i}}),S.each([`height`,`width`],function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return mt.test(S.css(e,`display`))&&(!e.getClientRects().length||!e.getBoundingClientRect().width)?at(e,ht,function(){return yt(e,t,r)}):yt(e,t,r)},set:function(e,n,r){var i,a=it(e),o=!p.scrollboxSize()&&a.position===`absolute`,s=(o||r)&&S.css(e,`boxSizing`,!1,a)===`border-box`,c=r?vt(e,t,r,s,a):0;return s&&o&&(c-=Math.ceil(e[`offset`+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-vt(e,t,`border`,!1,a)-.5)),c&&(i=Ce.exec(n))&&(i[3]||`px`)!==`px`&&(e.style[t]=n,n=S.css(e,t)),_t(e,n,c)}}}),S.cssHooks.marginLeft=ct(p.reliableMarginLeft,function(e,t){if(t)return(parseFloat(st(e,`marginLeft`))||e.getBoundingClientRect().left-at(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+`px`}),S.each({margin:``,padding:``,border:`Width`},function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a=typeof n==`string`?n.split(` `):[n];r<4;r++)i[e+we[r]+t]=a[r]||a[r-2]||a[0];return i}},e!==`margin`&&(S.cssHooks[e+t].set=_t)}),S.fn.extend({css:function(e,t){return de(this,function(e,t,n){var r,i,a={},o=0;if(Array.isArray(t)){for(r=it(e),i=t.length;o<i;o++)a[t[o]]=S.css(e,t[o],!1,r);return a}return n===void 0?S.css(e,t):S.style(e,t,n)},e,t,arguments.length>1)}});function bt(e,t,n,r,i){return new bt.prototype.init(e,t,n,r,i)}S.Tween=bt,bt.prototype={constructor:bt,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(S.cssNumber[n]?``:`px`)},cur:function(){var e=bt.propHooks[this.prop];return e&&e.get?e.get(this):bt.propHooks._default.get(this)},run:function(e){var t,n=bt.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):bt.propHooks._default.set(this),this}},bt.prototype.init.prototype=bt.prototype,bt.propHooks={_default:{get:function(e){var t;return e.elem.nodeType!==1||e.elem[e.prop]!=null&&e.elem.style[e.prop]==null?e.elem[e.prop]:(t=S.css(e.elem,e.prop,``),!t||t===`auto`?0:t)},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):e.elem.nodeType===1&&(S.cssHooks[e.prop]||e.elem.style[pt(e.prop)]!=null)?S.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},bt.propHooks.scrollTop=bt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return .5-Math.cos(e*Math.PI)/2},_default:`swing`},S.fx=bt.prototype.init,S.fx.step={};var xt,St,Ct=/^(?:toggle|show|hide)$/,wt=/queueHooks$/;function Tt(){St&&(g.hidden===!1&&e.requestAnimationFrame?e.requestAnimationFrame(Tt):e.setTimeout(Tt,S.fx.interval),S.fx.tick())}function Et(){return e.setTimeout(function(){xt=void 0}),xt=Date.now()}function Dt(e,t){var n,r=0,i={height:e};for(t=+!!t;r<4;r+=2-t)n=we[r],i[`margin`+n]=i[`padding`+n]=e;return t&&(i.opacity=i.width=e),i}function Ot(e,t,n){for(var r,i=(At.tweeners[t]||[]).concat(At.tweeners[`*`]),a=0,o=i.length;a<o;a++)if(r=i[a].call(n,t,e))return r}function W(e,t,n){var r,i,a,o,s,c,l,u,d=`width`in t||`height`in t,f=this,p={},m=e.style,h=e.nodeType&&Oe(e),g=U.get(e,`fxshow`);for(r in n.queue||(o=S._queueHooks(e,`fx`),o.unqueued??(o.unqueued=0,s=o.empty.fire,o.empty.fire=function(){o.unqueued||s()}),o.unqueued++,f.always(function(){f.always(function(){o.unqueued--,S.queue(e,`fx`).length||o.empty.fire()})})),t)if(i=t[r],Ct.test(i)){if(delete t[r],a||=i===`toggle`,i===(h?`hide`:`show`))if(i===`show`&&g&&g[r]!==void 0)h=!0;else continue;p[r]=g&&g[r]||S.style(e,r)}if(c=!S.isEmptyObject(t),!(!c&&S.isEmptyObject(p)))for(r in d&&e.nodeType===1&&(n.overflow=[m.overflow,m.overflowX,m.overflowY],l=g&&g.display,l??=U.get(e,`display`),u=S.css(e,`display`),u===`none`&&(l?u=l:(Me([e],!0),l=e.style.display||l,u=S.css(e,`display`),Me([e]))),(u===`inline`||u===`inline-block`&&l!=null)&&S.css(e,`float`)===`none`&&(c||(f.done(function(){m.display=l}),l??=(u=m.display,u===`none`?``:u)),m.display=`inline-block`)),n.overflow&&(m.overflow=`hidden`,f.always(function(){m.overflow=n.overflow[0],m.overflowX=n.overflow[1],m.overflowY=n.overflow[2]})),c=!1,p)c||(g?`hidden`in g&&(h=g.hidden):g=U.access(e,`fxshow`,{display:l}),a&&(g.hidden=!h),h&&Me([e],!0),f.done(function(){for(r in h||Me([e]),U.remove(e,`fxshow`),p)S.style(e,r,p[r])})),c=Ot(h?g[r]:0,r,f),r in g||(g[r]=c.start,h&&(c.end=c.start,c.start=0))}function kt(e,t){var n,r,i,a,o;for(n in e)if(r=me(n),i=t[r],a=e[n],Array.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),o=S.cssHooks[r],o&&`expand`in o)for(n in a=o.expand(a),delete e[r],a)n in e||(e[n]=a[n],t[n]=i);else t[r]=i}function At(e,t,n){var r,i,a=0,o=At.prefilters.length,s=S.Deferred().always(function(){delete c.elem}),c=function(){if(i)return!1;for(var t=xt||Et(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),a=0,o=l.tweens.length;a<o;a++)l.tweens[a].run(r);return s.notifyWith(e,[l,r,n]),r<1&&o?n:(o||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:xt||Et(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),u=l.props;for(kt(u,l.opts.specialEasing);a<o;a++)if(r=At.prefilters[a].call(l,e,u,l.opts),r)return m(r.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return S.map(u,Ot,l),m(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(c,{elem:e,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(At,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ke(n.elem,e,Ce.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=[`*`]):e=e.match(z);for(var n,r=0,i=e.length;r<i;r++)n=e[r],At.tweeners[n]=At.tweeners[n]||[],At.tweeners[n].unshift(t)},prefilters:[W],prefilter:function(e,t){t?At.prefilters.unshift(e):At.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&typeof e==`object`?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:typeof r.duration!=`number`&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),(r.queue==null||r.queue===!0)&&(r.queue=`fx`),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Oe).css(`opacity`,0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=S.isEmptyObject(e),a=S.speed(t,n,r),o=function(){var t=At(this,S.extend({},e),a);(i||U.get(this,`finish`))&&t.stop(!0)};return o.finish=o,i||a.queue===!1?this.each(o):this.queue(a.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return typeof e!=`string`&&(n=t,t=e,e=void 0),t&&this.queue(e||`fx`,[]),this.each(function(){var t=!0,i=e!=null&&e+`queueHooks`,a=S.timers,o=U.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&wt.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem===this&&(e==null||a[i].queue===e)&&(a[i].anim.stop(n),t=!1,a.splice(i,1));(t||!n)&&S.dequeue(this,e)})},finish:function(e){return e!==!1&&(e||=`fx`),this.each(function(){var t,n=U.get(this),r=n[e+`queue`],i=n[e+`queueHooks`],a=S.timers,o=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),S.each([`toggle`,`show`,`hide`],function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,i){return e==null||typeof e==`boolean`?n.apply(this,arguments):this.animate(Dt(t,!0),e,r,i)}}),S.each({slideDown:Dt(`show`),slideUp:Dt(`hide`),slideToggle:Dt(`toggle`),fadeIn:{opacity:`show`},fadeOut:{opacity:`hide`},fadeToggle:{opacity:`toggle`}},function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(xt=Date.now();t<n.length;t++)e=n[t],!e()&&n[t]===e&&n.splice(t--,1);n.length||S.fx.stop(),xt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){St||(St=!0,Tt())},S.fx.stop=function(){St=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,n){return t=S.fx&&S.fx.speeds[t]||t,n||=`fx`,this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},(function(){var e=g.createElement(`input`),t=g.createElement(`select`).appendChild(g.createElement(`option`));e.type=`checkbox`,p.checkOn=e.value!==``,p.optSelected=t.selected,e=g.createElement(`input`),e.value=`t`,e.type=`radio`,p.radioValue=e.value===`t`})();var jt,Mt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return de(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(!(a===3||a===8||a===2)){if(e.getAttribute===void 0)return S.prop(e,t,n);if((a!==1||!S.isXMLDoc(e))&&(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?jt:void 0)),n!==void 0){if(n===null){S.removeAttr(e,t);return}return i&&`set`in i&&(r=i.set(e,n,t))!==void 0?r:(e.setAttribute(t,n+``),n)}return i&&`get`in i&&(r=i.get(e,t))!==null?r:(r=S.find.attr(e,t),r??void 0)}},attrHooks:{type:{set:function(e,t){if(!p.radioValue&&t===`radio`&&w(e,`input`)){var n=e.value;return e.setAttribute(`type`,t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(z);if(i&&e.nodeType===1)for(;n=i[r++];)e.removeAttribute(n)}}),jt={set:function(e,t,n){return t===!1?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Mt[t]||S.find.attr;Mt[t]=function(e,t,r){var i,a,o=t.toLowerCase();return r||(a=Mt[o],Mt[o]=i,i=n(e,t,r)==null?null:o,Mt[o]=a),i}});var Nt=/^(?:input|select|textarea|button)$/i,Pt=/^(?:a|area)$/i;S.fn.extend({prop:function(e,t){return de(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,a=e.nodeType;if(!(a===3||a===8||a===2))return(a!==1||!S.isXMLDoc(e))&&(t=S.propFix[t]||t,i=S.propHooks[t]),n===void 0?i&&`get`in i&&(r=i.get(e,t))!==null?r:e[t]:i&&`set`in i&&(r=i.set(e,n,t))!==void 0?r:e[t]=n},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,`tabindex`);return t?parseInt(t,10):Nt.test(e.nodeName)||Pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:`htmlFor`,class:`className`}}),p.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each([`tabIndex`,`readOnly`,`maxLength`,`cellSpacing`,`cellPadding`,`rowSpan`,`colSpan`,`useMap`,`frameBorder`,`contentEditable`],function(){S.propFix[this.toLowerCase()]=this});function Ft(e){return(e.match(z)||[]).join(` `)}function It(e){return e.getAttribute&&e.getAttribute(`class`)||``}function Lt(e){return Array.isArray(e)?e:typeof e==`string`&&e.match(z)||[]}S.fn.extend({addClass:function(e){var t,n,r,i,a,o;return m(e)?this.each(function(t){S(this).addClass(e.call(this,t,It(this)))}):(t=Lt(e),t.length?this.each(function(){if(r=It(this),n=this.nodeType===1&&` `+Ft(r)+` `,n){for(a=0;a<t.length;a++)i=t[a],n.indexOf(` `+i+` `)<0&&(n+=i+` `);o=Ft(n),r!==o&&this.setAttribute(`class`,o)}}):this)},removeClass:function(e){var t,n,r,i,a,o;return m(e)?this.each(function(t){S(this).removeClass(e.call(this,t,It(this)))}):arguments.length?(t=Lt(e),t.length?this.each(function(){if(r=It(this),n=this.nodeType===1&&` `+Ft(r)+` `,n){for(a=0;a<t.length;a++)for(i=t[a];n.indexOf(` `+i+` `)>-1;)n=n.replace(` `+i+` `,` `);o=Ft(n),r!==o&&this.setAttribute(`class`,o)}}):this):this.attr(`class`,``)},toggleClass:function(e,t){var n,r,i,a,o=typeof e,s=o===`string`||Array.isArray(e);return m(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,It(this),t),t)}):typeof t==`boolean`&&s?t?this.addClass(e):this.removeClass(e):(n=Lt(e),this.each(function(){if(s)for(a=S(this),i=0;i<n.length;i++)r=n[i],a.hasClass(r)?a.removeClass(r):a.addClass(r);else (e===void 0||o===`boolean`)&&(r=It(this),r&&U.set(this,`__className__`,r),this.setAttribute&&this.setAttribute(`class`,r||e===!1?``:U.get(this,`__className__`)||``))}))},hasClass:function(e){var t,n,r=0;for(t=` `+e+` `;n=this[r++];)if(n.nodeType===1&&(` `+Ft(It(n))+` `).indexOf(t)>-1)return!0;return!1}});var Rt=/\r/g;S.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=m(e),this.each(function(n){var i;this.nodeType===1&&(i=r?e.call(this,n,S(this).val()):e,i==null?i=``:typeof i==`number`?i+=``:Array.isArray(i)&&(i=S.map(i,function(e){return e==null?``:e+``})),t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()],(!t||!(`set`in t)||t.set(this,i,`value`)===void 0)&&(this.value=i))})):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()],t&&`get`in t&&(n=t.get(i,`value`))!==void 0?n:(n=i.value,typeof n==`string`?n.replace(Rt,``):n??``)):void 0}}),S.extend({valHooks:{option:{get:function(e){return S.find.attr(e,`value`)??Ft(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,a=e.selectedIndex,o=e.type===`select-one`,s=o?null:[],c=o?a+1:i.length;for(r=a<0?c:o?a:0;r<c;r++)if(n=i[r],(n.selected||r===a)&&!n.disabled&&(!n.parentNode.disabled||!w(n.parentNode,`optgroup`))){if(t=S(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,a=S.makeArray(t),o=i.length;o--;)r=i[o],(r.selected=S.inArray(S.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),S.each([`radio`,`checkbox`],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},p.checkOn||(S.valHooks[this].get=function(e){return e.getAttribute(`value`)===null?`on`:e.value})});var zt=e.location,Bt={guid:Date.now()},Vt=/\?/;S.parseXML=function(t){var n,r;if(!t||typeof t!=`string`)return null;try{n=new e.DOMParser().parseFromString(t,`text/xml`)}catch{}return r=n&&n.getElementsByTagName(`parsererror`)[0],(!n||r)&&S.error(`Invalid XML: `+(r?S.map(r.childNodes,function(e){return e.textContent}).join(`
298
- `):t)),n};var Ht=/^(?:focusinfocus|focusoutblur)$/,Ut=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,n,r,i){var a,o,s,c,l,d,f,p,_=[r||g],v=u.call(t,`type`)?t.type:t,y=u.call(t,`namespace`)?t.namespace.split(`.`):[];if(o=p=s=r||=g,!(r.nodeType===3||r.nodeType===8)&&!Ht.test(v+S.event.triggered)&&(v.indexOf(`.`)>-1&&(y=v.split(`.`),v=y.shift(),y.sort()),l=v.indexOf(`:`)<0&&`on`+v,t=t[S.expando]?t:new S.Event(v,typeof t==`object`&&t),t.isTrigger=i?2:3,t.namespace=y.join(`.`),t.rnamespace=t.namespace?RegExp(`(^|\\.)`+y.join(`\\.(?:.*\\.|)`)+`(\\.|$)`):null,t.result=void 0,t.target||=r,n=n==null?[t]:S.makeArray(n,[t]),f=S.event.special[v]||{},!(!i&&f.trigger&&f.trigger.apply(r,n)===!1))){if(!i&&!f.noBubble&&!h(r)){for(c=f.delegateType||v,Ht.test(c+v)||(o=o.parentNode);o;o=o.parentNode)_.push(o),s=o;s===(r.ownerDocument||g)&&_.push(s.defaultView||s.parentWindow||e)}for(a=0;(o=_[a++])&&!t.isPropagationStopped();)p=o,t.type=a>1?c:f.bindType||v,d=(U.get(o,`events`)||Object.create(null))[t.type]&&U.get(o,`handle`),d&&d.apply(o,n),d=l&&o[l],d&&d.apply&&he(o)&&(t.result=d.apply(o,n),t.result===!1&&t.preventDefault());return t.type=v,!i&&!t.isDefaultPrevented()&&(!f._default||f._default.apply(_.pop(),n)===!1)&&he(r)&&l&&m(r[v])&&!h(r)&&(s=r[l],s&&(r[l]=null),S.event.triggered=v,t.isPropagationStopped()&&p.addEventListener(v,Ut),r[v](),t.isPropagationStopped()&&p.removeEventListener(v,Ut),S.event.triggered=void 0,s&&(r[l]=s)),t.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}});var Wt=/\[\]$/,Gt=/\r?\n/g,Kt=/^(?:submit|button|image|reset|file)$/i,qt=/^(?:input|select|textarea|keygen)/i;function Jt(e,t,n,r){var i;if(Array.isArray(t))S.each(t,function(t,i){n||Wt.test(e)?r(e,i):Jt(e+`[`+(typeof i==`object`&&i?t:``)+`]`,i,n,r)});else if(!n&&y(t)===`object`)for(i in t)Jt(e+`[`+i+`]`,t[i],n,r);else r(e,t)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+`=`+encodeURIComponent(n??``)};if(e==null)return``;if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Jt(n,e[n],t,i);return r.join(`&`)},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,`elements`);return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(`:disabled`)&&qt.test(this.nodeName)&&!Kt.test(e)&&(this.checked||!Ne.test(e))}).map(function(e,t){var n=S(this).val();return n==null?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Gt,`\r
299
- `)}}):{name:t.name,value:n.replace(Gt,`\r
300
- `)}}).get()}});var Yt=/%20/g,Xt=/#.*$/,Zt=/([?&])_=[^&]*/,Qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,$t=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,en=/^(?:GET|HEAD)$/,tn=/^\/\//,nn={},rn={},an=`*/*`,on=g.createElement(`a`);on.href=zt.href;function G(e){return function(t,n){typeof t!=`string`&&(n=t,t=`*`);var r,i=0,a=t.toLowerCase().match(z)||[];if(m(n))for(;r=a[i++];)r[0]===`+`?(r=r.slice(1)||`*`,(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function sn(e,t,n,r){var i={},a=e===rn;function o(s){var c;return i[s]=!0,S.each(e[s]||[],function(e,s){var l=s(t,n,r);if(typeof l==`string`&&!a&&!i[l])return t.dataTypes.unshift(l),o(l),!1;if(a)return!(c=l)}),c}return o(t.dataTypes[0])||!i[`*`]&&o(`*`)}function cn(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)t[n]!==void 0&&((i[n]?e:r||={})[n]=t[n]);return r&&S.extend(!0,e,r),e}function ln(e,t,n){for(var r,i,a,o,s=e.contents,c=e.dataTypes;c[0]===`*`;)c.shift(),r===void 0&&(r=e.mimeType||t.getResponseHeader(`Content-Type`));if(r){for(i in s)if(s[i]&&s[i].test(r)){c.unshift(i);break}}if(c[0]in n)a=c[0];else{for(i in n){if(!c[0]||e.converters[i+` `+c[0]]){a=i;break}o||=i}a||=o}if(a)return a!==c[0]&&c.unshift(a),n[a]}function un(e,t,n,r){var i,a,o,s,c,l={},u=e.dataTypes.slice();if(u[1])for(o in e.converters)l[o.toLowerCase()]=e.converters[o];for(a=u.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!c&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),c=a,a=u.shift(),a){if(a===`*`)a=c;else if(c!==`*`&&c!==a){if(o=l[c+` `+a]||l[`* `+a],!o){for(i in l)if(s=i.split(` `),s[1]===a&&(o=l[c+` `+s[0]]||l[`* `+s[0]],o)){o===!0?o=l[i]:l[i]!==!0&&(a=s[0],u.unshift(s[1]));break}}if(o!==!0)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:`parsererror`,error:o?e:`No conversion from `+c+` to `+a}}}}return{state:`success`,data:t}}S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zt.href,type:`GET`,isLocal:$t.test(zt.protocol),global:!0,processData:!0,async:!0,contentType:`application/x-www-form-urlencoded; charset=UTF-8`,accepts:{"*":an,text:`text/plain`,html:`text/html`,xml:`application/xml, text/xml`,json:`application/json, text/javascript`},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:`responseXML`,text:`responseText`,json:`responseJSON`},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?cn(cn(e,S.ajaxSettings),t):cn(S.ajaxSettings,e)},ajaxPrefilter:G(nn),ajaxTransport:G(rn),ajax:function(t,n){typeof t==`object`&&(n=t,t=void 0),n||={};var r,i,a,o,s,c,l,u,d,f,p=S.ajaxSetup({},n),m=p.context||p,h=p.context&&(m.nodeType||m.jquery)?S(m):S.event,_=S.Deferred(),v=S.Callbacks(`once memory`),y=p.statusCode||{},b={},x={},C=`canceled`,w={readyState:0,getResponseHeader:function(e){var t;if(l){if(!o)for(o={};t=Qt.exec(a);)o[t[1].toLowerCase()+` `]=(o[t[1].toLowerCase()+` `]||[]).concat(t[2]);t=o[e.toLowerCase()+` `]}return t==null?null:t.join(`, `)},getAllResponseHeaders:function(){return l?a:null},setRequestHeader:function(e,t){return l??(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return l??(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)w.always(e[w.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||C;return r&&r.abort(t),T(0,t),this}};if(_.promise(w),p.url=((t||p.url||zt.href)+``).replace(tn,zt.protocol+`//`),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||`*`).toLowerCase().match(z)||[``],p.crossDomain==null){c=g.createElement(`a`);try{c.href=p.url,c.href=c.href,p.crossDomain=on.protocol+`//`+on.host!=c.protocol+`//`+c.host}catch{p.crossDomain=!0}}if(p.data&&p.processData&&typeof p.data!=`string`&&(p.data=S.param(p.data,p.traditional)),sn(nn,p,n,w),l)return w;for(d in u=S.event&&p.global,u&&S.active++===0&&S.event.trigger(`ajaxStart`),p.type=p.type.toUpperCase(),p.hasContent=!en.test(p.type),i=p.url.replace(Xt,``),p.hasContent?p.data&&p.processData&&(p.contentType||``).indexOf(`application/x-www-form-urlencoded`)===0&&(p.data=p.data.replace(Yt,`+`)):(f=p.url.slice(i.length),p.data&&(p.processData||typeof p.data==`string`)&&(i+=(Vt.test(i)?`&`:`?`)+p.data,delete p.data),p.cache===!1&&(i=i.replace(Zt,`$1`),f=(Vt.test(i)?`&`:`?`)+`_=`+ Bt.guid+++f),p.url=i+f),p.ifModified&&(S.lastModified[i]&&w.setRequestHeader(`If-Modified-Since`,S.lastModified[i]),S.etag[i]&&w.setRequestHeader(`If-None-Match`,S.etag[i])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader(`Content-Type`,p.contentType),w.setRequestHeader(`Accept`,p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+(p.dataTypes[0]===`*`?``:`, `+an+`; q=0.01`):p.accepts[`*`]),p.headers)w.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(p.beforeSend.call(m,w,p)===!1||l))return w.abort();if(C=`abort`,v.add(p.complete),w.done(p.success),w.fail(p.error),r=sn(rn,p,n,w),!r)T(-1,`No Transport`);else{if(w.readyState=1,u&&h.trigger(`ajaxSend`,[w,p]),l)return w;p.async&&p.timeout>0&&(s=e.setTimeout(function(){w.abort(`timeout`)},p.timeout));try{l=!1,r.send(b,T)}catch(e){if(l)throw e;T(-1,e)}}function T(t,n,o,c){var d,f,g,b,x,C=n;l||(l=!0,s&&e.clearTimeout(s),r=void 0,a=c||``,w.readyState=t>0?4:0,d=t>=200&&t<300||t===304,o&&(b=ln(p,w,o)),!d&&S.inArray(`script`,p.dataTypes)>-1&&S.inArray(`json`,p.dataTypes)<0&&(p.converters[`text script`]=function(){}),b=un(p,b,w,d),d?(p.ifModified&&(x=w.getResponseHeader(`Last-Modified`),x&&(S.lastModified[i]=x),x=w.getResponseHeader(`etag`),x&&(S.etag[i]=x)),t===204||p.type===`HEAD`?C=`nocontent`:t===304?C=`notmodified`:(C=b.state,f=b.data,g=b.error,d=!g)):(g=C,(t||!C)&&(C=`error`,t<0&&(t=0))),w.status=t,w.statusText=(n||C)+``,d?_.resolveWith(m,[f,C,w]):_.rejectWith(m,[w,C,g]),w.statusCode(y),y=void 0,u&&h.trigger(d?`ajaxSuccess`:`ajaxError`,[w,p,d?f:g]),v.fireWith(m,[w,C]),u&&(h.trigger(`ajaxComplete`,[w,p]),--S.active||S.event.trigger(`ajaxStop`)))}return w},getJSON:function(e,t,n){return S.get(e,t,n,`json`)},getScript:function(e,t){return S.get(e,void 0,t,`script`)}}),S.each([`get`,`post`],function(e,t){S[t]=function(e,n,r,i){return m(n)&&(i||=r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:n,success:r},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){for(var t in e.headers)t.toLowerCase()===`content-type`&&(e.contentType=e.headers[t]||``)}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:`GET`,dataType:`script`,cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not(`body`).each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch{}};var dn={0:200,1223:204},fn=S.ajaxSettings.xhr();p.cors=!!fn&&`withCredentials`in fn,p.ajax=fn=!!fn,S.ajaxTransport(function(t){var n,r;if(p.cors||fn&&!t.crossDomain)return{send:function(i,a){var o,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)s[o]=t.xhrFields[o];for(o in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),!t.crossDomain&&!i[`X-Requested-With`]&&(i[`X-Requested-With`]=`XMLHttpRequest`),i)s.setRequestHeader(o,i[o]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,e===`abort`?s.abort():e===`error`?typeof s.status==`number`?a(s.status,s.statusText):a(0,`error`):a(dn[s.status]||s.status,s.statusText,(s.responseType||`text`)!==`text`||typeof s.responseText!=`string`?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n(`error`),s.onabort===void 0?s.onreadystatechange=function(){s.readyState===4&&e.setTimeout(function(){n&&r()})}:s.onabort=r,n=n(`abort`);try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:`text/javascript, application/javascript, application/ecmascript, application/x-ecmascript`},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter(`script`,function(e){e.cache===void 0&&(e.cache=!1),e.crossDomain&&(e.type=`GET`)}),S.ajaxTransport(`script`,function(e){if(e.crossDomain||e.scriptAttrs){var t,n;return{send:function(r,i){t=S(`<script>`).attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on(`load error`,n=function(e){t.remove(),n=null,e&&i(e.type===`error`?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}}});var pn=[],mn=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:`callback`,jsonpCallback:function(){var e=pn.pop()||S.expando+`_`+ Bt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter(`json jsonp`,function(t,n,r){var i,a,o,s=t.jsonp!==!1&&(mn.test(t.url)?`url`:typeof t.data==`string`&&(t.contentType||``).indexOf(`application/x-www-form-urlencoded`)===0&&mn.test(t.data)&&`data`);if(s||t.dataTypes[0]===`jsonp`)return i=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(mn,`$1`+i):t.jsonp!==!1&&(t.url+=(Vt.test(t.url)?`&`:`?`)+t.jsonp+`=`+i),t.converters[`script json`]=function(){return o||S.error(i+` was not called`),o[0]},t.dataTypes[0]=`json`,a=e[i],e[i]=function(){o=arguments},r.always(function(){a===void 0?S(e).removeProp(i):e[i]=a,t[i]&&(t.jsonpCallback=n.jsonpCallback,pn.push(i)),o&&m(a)&&a(o[0]),o=a=void 0}),`script`}),p.createHTMLDocument=(function(){var e=g.implementation.createHTMLDocument(``).body;return e.innerHTML=`<form></form><form></form>`,e.childNodes.length===2})(),S.parseHTML=function(e,t,n){if(typeof e!=`string`)return[];typeof t==`boolean`&&(n=t,t=!1);var r,i,a;return t||(p.createHTMLDocument?(t=g.implementation.createHTMLDocument(``),r=t.createElement(`base`),r.href=g.location.href,t.head.appendChild(r)):t=g),i=te.exec(e),a=!n&&[],i?[t.createElement(i[1])]:(i=Be([e],t,a),a&&a.length&&S(a).remove(),S.merge([],i.childNodes))},S.fn.load=function(e,t,n){var r,i,a,o=this,s=e.indexOf(` `);return s>-1&&(r=Ft(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&typeof t==`object`&&(i=`POST`),o.length>0&&S.ajax({url:e,type:i||`GET`,dataType:`html`,data:t}).done(function(e){a=arguments,o.html(r?S(`<div>`).append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){o.each(function(){n.apply(this,a||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,a,o,s,c,l,u=S.css(e,`position`),d=S(e),f={};u===`static`&&(e.style.position=`relative`),s=d.offset(),a=S.css(e,`top`),c=S.css(e,`left`),l=(u===`absolute`||u===`fixed`)&&(a+c).indexOf(`auto`)>-1,l?(r=d.position(),o=r.top,i=r.left):(o=parseFloat(a)||0,i=parseFloat(c)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),t.top!=null&&(f.top=t.top-s.top+o),t.left!=null&&(f.left=t.left-s.left+i),`using`in t?t.using.call(e,f):d.css(f)}},S.fn.extend({offset:function(e){if(arguments.length)return e===void 0?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if(S.css(r,`position`)===`fixed`)t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&S.css(e,`position`)===`static`;)e=e.parentNode;e&&e!==r&&e.nodeType===1&&(i=S(e).offset(),i.top+=S.css(e,`borderTopWidth`,!0),i.left+=S.css(e,`borderLeftWidth`,!0))}return{top:t.top-i.top-S.css(r,`marginTop`,!0),left:t.left-i.left-S.css(r,`marginLeft`,!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&S.css(e,`position`)===`static`;)e=e.offsetParent;return e||Te})}}),S.each({scrollLeft:`pageXOffset`,scrollTop:`pageYOffset`},function(e,t){var n=t===`pageYOffset`;S.fn[e]=function(r){return de(this,function(e,r,i){var a;if(h(e)?a=e:e.nodeType===9&&(a=e.defaultView),i===void 0)return a?a[t]:e[r];a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[r]=i},e,r,arguments.length)}}),S.each([`top`,`left`],function(e,t){S.cssHooks[t]=ct(p.pixelPosition,function(e,n){if(n)return n=st(e,t),nt.test(n)?S(e).position()[t]+`px`:n})}),S.each({Height:`height`,Width:`width`},function(e,t){S.each({padding:`inner`+e,content:t,"":`outer`+e},function(n,r){S.fn[r]=function(i,a){var o=arguments.length&&(n||typeof i!=`boolean`),s=n||(i===!0||a===!0?`margin`:`border`);return de(this,function(t,n,i){var a;return h(t)?r.indexOf(`outer`)===0?t[`inner`+e]:t.document.documentElement[`client`+e]:t.nodeType===9?(a=t.documentElement,Math.max(t.body[`scroll`+e],a[`scroll`+e],t.body[`offset`+e],a[`offset`+e],a[`client`+e])):i===void 0?S.css(t,n,s):S.style(t,n,i,s)},t,o?i:void 0,o)}})}),S.each([`ajaxStart`,`ajaxStop`,`ajaxComplete`,`ajaxError`,`ajaxSuccess`,`ajaxSend`],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,`**`):this.off(t,e||`**`,n)},hover:function(e,t){return this.on(`mouseenter`,e).on(`mouseleave`,t||e)}}),S.each(`blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu`.split(` `),function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var hn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,a;if(typeof t==`string`&&(n=e[t],t=e,e=n),m(e))return r=i.call(arguments,2),a=function(){return e.apply(t||this,r.concat(i.call(arguments)))},a.guid=e.guid=e.guid||S.guid++,a},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=w,S.isFunction=m,S.isWindow=h,S.camelCase=me,S.type=y,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return(t===`number`||t===`string`)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return e==null?``:(e+``).replace(hn,`$1`)},typeof define==`function`&&define.amd&&define(`jquery`,[],function(){return S});var gn=e.jQuery,_n=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=_n),t&&e.jQuery===S&&(e.jQuery=gn),S},t===void 0&&(e.jQuery=e.$=S),S})})),Aq=s(((e,t)=>{var n=kq();typeof window<`u`&&!window.jQuery&&(window.jQuery=n),t.exports=n})),jq=s((()=>{(function(){function e(){}function t(e){var t=e.length-1;return function(){var n=h.call(arguments,0,t),r=h.call(arguments,t);return e.apply(this,n.concat([r]))}}function n(e){return t(function(t,n){return typeof t!=`function`&&(t=g(t)),e.call(this,function(e){return t.apply(e,[e].concat(n))})})}function r(e){var t=h.call(arguments,1);return function(){return e.apply(this,t)}}function i(e,t){if(!t)throw Error(`prayer failed: `+e)}function a(e){i(`a direction was passed`,e===v||e===y)}function o(e,t,n){i(`a parent is always present`,e),i(`leftward is properly set up`,function(){return t?t[y]===n&&t.parent===e:e.ends[v]===n}()),i(`rightward is properly set up`,function(){return n?n[v]===t&&n.parent===e:e.ends[y]===t}())}function s(){window.console&&console.warn(`You are using the MathQuill API without specifying an interface version, which will fail in v1.0.0. Easiest fix is to do the following before doing anything else:
301
-
302
- MathQuill = MathQuill.getInterface(1);
303
- // now MathQuill.MathField() works like it used to
304
-
305
- See also the "\`dev\` branch (2014–2015) → v0.10.0 Migration Guide" at
306
- https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide`)}function c(e){return s(),$e(e)}function l(t){function n(e){var t,n;return e&&e.nodeType?(t=b(e).children(`.mq-root-block`).attr(rt),n=t&&S.byId[t].controller,n?i[n.KIND_OF_MQ](n):null):null}function r(e,t){var n,r,a;for(n in t&&t.handlers&&(t.handlers={fns:t.handlers,APIClasses:i}),t)t.hasOwnProperty(n)&&(r=t[n],a=M[n],e[n]=a?a(r):r)}var i,a,o;if(!(F<=t&&t<=ee))throw`Only interface versions between `+F+` and `+ee+` supported. You specified: `+t;for(o in i={},n.L=v,n.R=y,n.saneKeyboardEvents=ne,n.config=function(e){return r(j.p,e),this},n.registerEmbed=function(e,t){if(!/^[a-z][a-z0-9]*$/i.test(e))throw`Embed name must start with letter and be only letters and digits`;P[e]=t},a=i.AbstractMathQuill=_(N,function(e){e.init=function(e){this.__controller=e,this.__options=e.options,this.id=e.id,this.data=e.data},e.parseLatex=function(e){return this.__controller.parseLatex(e)},e.__mathquillify=function(e){var t,n=this.__controller,r=n.root,i=n.container;n.createTextarea(),t=i.addClass(e).contents().detach(),r.jQ=b(`<span class="mq-root-block"/>`).attr(rt,r.id).appendTo(i),this.latex(t.text()),this.revert=function(){return i.empty().unbind(`.mathquill`).removeClass(`mq-editable-field mq-math-mode mq-text-mode`).append(t)}},e.config=function(e){return r(this.__options,e),this},e.el=function(){return this.__controller.container[0]},e.text=function(){return this.__controller.exportText()},e.latex=function(e){return arguments.length>0?(this.__controller.renderLatexMath(e),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()},e.html=function(){return this.__controller.root.jQ.html().replace(/ mathquill-(?:command|block)-id="?\d+"?/g,``).replace(/<span class="?mq-cursor( mq-blink)?"?>.?<\/span>/i,``).replace(/ mq-hasCursor|mq-hasCursor ?/,``).replace(/ class=(""|(?= |>))/g,``)},e.reflow=function(){return this.__controller.root.postOrder(`reflow`),this}}),n.prototype=a.prototype,i.EditableField=_(a,function(t,n){t.__mathquillify=function(){return n.__mathquillify.apply(this,arguments),this.__controller.editable=!0,this.__controller.delegateMouseEvents(),this.__controller.editablesTextareaEvents(),this},t.focus=function(){return this.__controller.textarea.focus(),this},t.blur=function(){return this.__controller.textarea.blur(),this},t.write=function(e){return this.__controller.writeLatex(e),this.__controller.scrollHoriz(),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this},t.empty=function(){var e=this.__controller.root,t=this.__controller.cursor;return e.eachChild(`postOrder`,`dispose`),e.ends[v]=e.ends[y]=0,e.jQ.empty(),delete t.selection,t.insAtRightEnd(e),this},t.cmd=function(e){var t,n=this.__controller.notify(),r=n.cursor;return/^\\[a-z]+$/i.test(e)&&!r.isTooDeep()?(e=e.slice(1),(t=w[e])&&(e=t(e),r.selection&&e.replaces(r.replaceSelection()),e.createLeftOf(r.show()),this.__controller.scrollHoriz())):r.parent.write(r,e),n.blurred&&r.hide().parent.blur(),this},t.select=function(){var e=this.__controller;for(e.notify(`move`).cursor.insAtRightEnd(e.root);e.cursor[v];)e.selectLeft();return this},t.clearSelection=function(){return this.__controller.cursor.clearSelection(),this},t.moveToDirEnd=function(e){return this.__controller.notify(`move`).cursor.insAtDirEnd(e,this.__controller.root),this},t.moveToLeftEnd=function(){return this.moveToDirEnd(v)},t.moveToRightEnd=function(){return this.moveToDirEnd(y)},t.keystroke=function(t){var n;for(t=t.replace(/^\s+|\s+$/g,``).split(/\s+/),n=0;n<t.length;n+=1)this.__controller.keystroke(t[n],{preventDefault:e});return this},t.typedText=function(e){for(var t=0;t<e.length;t+=1)this.__controller.typedText(e.charAt(t));return this},t.dropEmbedded=function(e,t,n){var r,i=e-b(window).scrollLeft(),a=t-b(window).scrollTop(),o=document.elementFromPoint(i,a);this.__controller.seek(b(o),e,t),r=Ze().setOptions(n),r.createLeftOf(this.__controller.cursor)},t.clickAt=function(e,t,n){n||=document.elementFromPoint(e,t);var r=this.__controller,i=r.root;return tt.contains(i.jQ[0],n)||(n=i.jQ[0]),r.seek(b(n),e+pageXOffset,t+pageYOffset),r.blurred&&this.focus(),this},t.ignoreNextMousedown=function(e){return this.__controller.cursor.options.ignoreNextMousedown=e,this}}),n.EditableField=function(){throw`wtf don't call me, I'm 'abstract'`},n.EditableField.prototype=i.EditableField.prototype,A)(function(e,r){var a=i[e]=r(i);n[e]=function(r,i){var o,s=n(r);return s instanceof a||!r||!r.nodeType?s:(o=k(a.RootBlock(),b(r),j()),o.KIND_OF_MQ=e,a(o).__mathquillify(i,t))},n[e].prototype=a.prototype})(o,A[o]);return n}function u(e){var t,n=`moveOutOf deleteOutOf selectOutOf upOutOf downOutOf`.split(` `);for(t=0;t<n.length;t+=1)(function(t){e[t]=function(e){this.controller.handle(t,e)}})(n[t]);e.reflow=function(){this.controller.handle(`reflow`),this.controller.handle(`edited`),this.controller.handle(`edit`)}}function d(e,t,n){return _(ce,{ctrlSeq:e,htmlTemplate:`<`+t+` `+n+`>&0</`+t+`>`})}function f(e){var t=this.parent,n=e;do{if(n[y])return e.insLeftOf(t);n=n.parent.parent}while(n!==t);e.insRightOf(t)}function p(e,t){e.jQadd=function(){t.jQadd.apply(this,arguments),this.delimjQs=this.jQ.children(`:first`).add(this.jQ.children(`:last`)),this.contentjQ=this.jQ.children(`:eq(1)`)},e.reflow=function(){var e=this.contentjQ.outerHeight()/parseFloat(this.contentjQ.css(`fontSize`));we(this.delimjQs,it(1+.2*(e-1),1.2),1.2*e)}}function m(e,t){var t=t||e,n=Ye[e],i=Ye[t];T[e]=r(Je,v,e,n,t,i),T[n]=r(Je,y,e,n,t,i)}var h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,ee,te,I,ne,re,ie,L,R,ae,z,B,oe,se,ce,V,le,ue,de,H,fe,pe,me,he,ge,U,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt=window.jQuery,nt=`mathquill-command-id`,rt=`mathquill-block-id`,it=Math.min,at=Math.max;if(!tt)throw`MathQuill requires jQuery 1.5.2+ to be loaded first`;for(U in h=[].slice,g=t(function(e,n){return t(function(t,r){if(e in t)return t[e].apply(t,n.concat(r))})}),_=function(e,t,n){function r(e){return typeof e==`object`}function i(e){return typeof e==`function`}function a(){}return function e(n,o){function s(){var e=new c;return i(e.init)&&e.init.apply(e,arguments),e}function c(){}var l,u,d;return o===void 0&&(o=n,n=Object),s.Bare=c,l=a.prototype=n.prototype,u=c.prototype=s.prototype=s.p=new a,u.constructor=s,s.extend=function(t){return e(s,t)},(s.open=function(e){if(d={},i(e)?d=e.call(s,u,l,s,n):r(e)&&(d=e),r(d))for(var a in d)t.call(d,a)&&(u[a]=d[a]);return i(u.init)||(u.init=n),s})(o)}}(0,{}.hasOwnProperty),v=-1,y=1,b=_(tt,function(e){e.insDirOf=function(e,t){return e===v?this.insertBefore(t.first()):this.insertAfter(t.last())},e.insAtDirEnd=function(e,t){return e===v?this.prependTo(t):this.appendTo(t)}}),x=_(function(e){e.parent=0,e[v]=0,e[y]=0,e.init=function(e,t,n){this.parent=e,this[v]=t,this[y]=n},this.copy=function(e){return x(e.parent,e[v],e[y])}}),S=_(function(e){function t(){return r+=1}e[v]=0,e[y]=0,e.parent=0;var r=0;this.byId={},e.init=function(){this.id=t(),S.byId[this.id]=this,this.ends={},this.ends[v]=0,this.ends[y]=0},e.dispose=function(){delete S.byId[this.id]},e.toString=function(){return`{{ MathQuill Node #`+this.id+` }}`},e.jQ=b(),e.jQadd=function(e){return this.jQ=this.jQ.add(e)},e.jQize=function(e){function t(e){var n,r;for(e.getAttribute&&(n=e.getAttribute(`mathquill-command-id`),r=e.getAttribute(`mathquill-block-id`),n&&S.byId[n].jQadd(e),r&&S.byId[r].jQadd(e)),e=e.firstChild;e;e=e.nextSibling)t(e)}var n;for(e=b(e||this.html()),n=0;n<e.length;n+=1)t(e[n]);return e},e.createDir=function(e,t){a(e);var n=this;return n.jQize(),n.jQ.insDirOf(e,t.jQ),t[e]=n.adopt(t.parent,t[v],t[y]),n},e.createLeftOf=function(e){return this.createDir(v,e)},e.selectChildren=function(e,t){return O(e,t)},e.bubble=n(function(e){var t;for(t=this;t&&!1!==e(t);t=t.parent);return this}),e.postOrder=n(function(e){return function t(n){n.eachChild(t),e(n)}(this),this}),e.isEmpty=function(){return this.ends[v]===0&&this.ends[y]===0},e.isStyleBlock=function(){return!1},e.children=function(){return C(this.ends[v],this.ends[y])},e.eachChild=function(){var e=this.children();return e.each.apply(e,arguments),this},e.foldChildren=function(e,t){return this.children().fold(e,t)},e.withDirAdopt=function(e,t,n,r){return C(this,this).withDirAdopt(e,t,n,r),this},e.adopt=function(e,t,n){return C(this,this).adopt(e,t,n),this},e.disown=function(){return C(this,this).disown(),this},e.remove=function(){return this.jQ.remove(),this.postOrder(`dispose`),this.disown()}}),C=_(function(e){e.init=function(e,t,n){if(n===void 0&&(n=v),a(n),i(`no half-empty fragments`,!e==!t),this.ends={},e){i(`withDir is passed to Fragment`,e instanceof S),i(`oppDir is passed to Fragment`,t instanceof S),i(`withDir and oppDir have the same parent`,e.parent===t.parent),this.ends[n]=e,this.ends[-n]=t;var r=this.fold([],function(e,t){return e.push.apply(e,t.jQ.get()),e});this.jQ=this.jQ.add(r)}},e.jQ=b(),e.withDirAdopt=function(e,t,n,r){return e===v?this.adopt(t,n,r):this.adopt(t,r,n)},e.adopt=function(e,t,n){var r,i,a;return o(e,t,n),r=this,r.disowned=!1,(i=r.ends[v])?(a=r.ends[y],t||(e.ends[v]=i),n?n[v]=a:e.ends[y]=a,r.ends[y][y]=n,r.each(function(n){n[v]=t,n.parent=e,t&&(t[y]=n),t=n}),r):this},e.disown=function(){var e,t,n=this,r=n.ends[v];return!r||n.disowned?n:(n.disowned=!0,e=n.ends[y],t=r.parent,o(t,r[v],r),o(t,e,e[y]),r[v]?r[v][y]=e[y]:t.ends[v]=e[y],e[y]?e[y][v]=r[v]:t.ends[y]=r[v],n)},e.remove=function(){return this.jQ.remove(),this.each(`postOrder`,`dispose`),this.disown()},e.each=n(function(e){var t=this,n=t.ends[v];if(!n)return t;for(;n!==t.ends[y][y]&&!1!==e(n);n=n[y]);return t}),e.fold=function(e,t){return this.each(function(n){e=t.call(this,e,n)}),e}}),w={},T={},E={},D=_(x,function(e){e.init=function(e,t){this.parent=e,this.options=t;var n=this.jQ=this._jQ=b(`<span class="mq-cursor">&#8203;</span>`);this.blink=function(){n.toggleClass(`mq-blink`)},this.upDownCache={}},e.show=function(){return this.jQ=this._jQ.removeClass(`mq-blink`),`intervalId`in this?clearInterval(this.intervalId):(this[y]?this.selection&&this.selection.ends[v][v]===this[v]?this.jQ.insertBefore(this.selection.jQ):this.jQ.insertBefore(this[y].jQ.first()):this.jQ.appendTo(this.parent.jQ),this.parent.focus()),this.intervalId=setInterval(this.blink,500),this},e.hide=function(){return`intervalId`in this&&clearInterval(this.intervalId),delete this.intervalId,this.jQ.detach(),this.jQ=b(),this},e.withDirInsertAt=function(e,t,n,r){var i=this.parent;this.parent=t,this[e]=n,this[-e]=r,i!==t&&i.blur&&i.blur(this)},e.insDirOf=function(e,t){return a(e),this.jQ.insDirOf(e,t.jQ),this.withDirInsertAt(e,t.parent,t[e],t),this.parent.jQ.addClass(`mq-hasCursor`),this},e.insLeftOf=function(e){return this.insDirOf(v,e)},e.insRightOf=function(e){return this.insDirOf(y,e)},e.insAtDirEnd=function(e,t){return a(e),this.jQ.insAtDirEnd(e,t.jQ),this.withDirInsertAt(e,t,0,t.ends[e]),t.focus(),this},e.insAtLeftEnd=function(e){return this.insAtDirEnd(v,e)},e.insAtRightEnd=function(e){return this.insAtDirEnd(y,e)},e.jumpUpDown=function(e,t){var n,r,i=this;i.upDownCache[e.id]=x.copy(i),n=i.upDownCache[t.id],n?n[y]?i.insLeftOf(n[y]):i.insAtRightEnd(n.parent):(r=i.offset().left,t.seek(r,i))},e.offset=function(){var e=this,t=e.jQ.removeClass(`mq-cursor`).offset();return e.jQ.addClass(`mq-cursor`),t},e.unwrapGramp=function(){var e=this.parent.parent,t=e.parent,n=e[y],r=this,i=e[v];if(e.disown().eachChild(function(r){r.isEmpty()||(r.children().adopt(t,i,n).each(function(t){t.jQ.insertBefore(e.jQ.first())}),i=r.ends[y])}),!this[y])if(this[v])this[y]=this[v][y];else for(;!this[y];){if(this.parent=this.parent[y],!this.parent){this[y]=e[y],this.parent=t;break}this[y]=this.parent.ends[v]}this[y]?this.insLeftOf(this[y]):this.insAtRightEnd(t),e.jQ.remove(),e[v].siblingDeleted&&e[v].siblingDeleted(r.options,y),e[y].siblingDeleted&&e[y].siblingDeleted(r.options,v)},e.startSelection=function(){var e,t=this.anticursor=x.copy(this),n=t.ancestors={};for(e=t;e.parent;e=e.parent)n[e.parent.id]=e},e.endSelection=function(){delete this.anticursor},e.select=function(){var e,t,n,r,a,o,s,c=this.anticursor;if(this[v]===c[v]&&this.parent===c.parent)return!1;for(e=this;e.parent;e=e.parent)if(e.parent.id in c.ancestors){t=e.parent;break}if(i(`cursor and anticursor in the same tree`,t),n=c.ancestors[t.id],o=y,e[v]!==n){for(s=e;s;s=s[y])if(s[y]===n[y]){o=v,r=e,a=n;break}}return o===y&&(r=n,a=e),r instanceof x&&(r=r[y]),a instanceof x&&(a=a[v]),this.hide().selection=t.selectChildren(r,a),this.insDirOf(o,this.selection.ends[o]),this.selectionChanged(),!0},e.clearSelection=function(){return this.selection&&(this.selection.clear(),delete this.selection,this.selectionChanged()),this},e.deleteSelection=function(){this.selection&&(this[v]=this.selection.ends[v][v],this[y]=this.selection.ends[y][y],this.selection.remove(),this.selectionChanged(),delete this.selection)},e.replaceSelection=function(){var e=this.selection;return e&&(this[v]=e.ends[v][v],this[y]=e.ends[y][y],delete this.selection),e},e.depth=function(){for(var e=this,t=0;e=e.parent;)t+=+(e instanceof oe);return t},e.isTooDeep=function(e){if(this.options.maxDepth!==void 0)return this.depth()+(e||0)>this.options.maxDepth},e.howDeep=function(){for(var e=0,t=this;t=t.parent;)e++;return 1+Math.floor(e/2)},e.tooDeep=function(){var e=this.options.maxDepth;return e&&this.howDeep()>e}}),O=_(C,function(e,t){e.init=function(){t.init.apply(this,arguments),this.jQ=this.jQ.wrapAll(`<span class="mq-selection"></span>`).parent()},e.adopt=function(){return this.jQ.replaceWith(this.jQ=this.jQ.children()),t.adopt.apply(this,arguments)},e.clear=function(){return this.jQ.replaceWith(this.jQ[0].childNodes),this},e.join=function(e){return this.fold(``,function(t,n){return t+n[e]()})}}),k=_(function(e){e.init=function(e,t,n){this.id=e.id,this.data={},this.root=e,this.container=t,this.options=n,e.controller=this,this.cursor=e.cursor=D(e,n)},e.handle=function(e,t){var n,r=this.options.handlers;r&&r.fns[e]&&(n=r.APIClasses[this.KIND_OF_MQ](this),t===v||t===y?r.fns[e](t,n):r.fns[e](n))};var t=[];this.onNotify=function(e){t.push(e)},e.notify=function(){for(var e=0;e<t.length;e+=1)t[e].apply(this.cursor,arguments);return this}}),A={},j=_(),M={},N=_(),P={},c.prototype=N.p,c.VERSION=`{VERSION}`,c.interfaceVersion=function(e){if(e!==1)throw`Only interface version 1 supported. You specified: `+e;return s=function(){window.console&&console.warn(`You called MathQuill.interfaceVersion(1); to specify the interface version, which will fail in v1.0.0. You can fix this easily by doing this before doing anything else:
307
-
308
- MathQuill = MathQuill.getInterface(1);
309
- // now MathQuill.MathField() works like it used to
310
-
311
- See also the "\`dev\` branch (2014–2015) → v0.10.0 Migration Guide" at
312
- https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide`)},s(),c},c.getInterface=l,F=l.MIN=1,ee=l.MAX=2,c.noConflict=function(){return window.MathQuill=te,c},te=window.MathQuill,window.MathQuill=c,I=_(function(e,t,n){function r(e,t){throw e=e?`'`+e+`'`:`EOF`,`Parse Error: `+t+` at `+e}var a,o,s;e.init=function(e){this._=e},e.parse=function(e){function t(e,t){return t}return this.skip(s)._(``+e,t,r)},e.or=function(e){i(`or is passed a parser`,e instanceof n);var t=this;return n(function(n,r,i){function a(t){return e._(n,r,i)}return t._(n,r,a)})},e.then=function(e){var t=this;return n(function(r,a,o){function s(t,r){var s=e instanceof n?e:e(r);return i(`a parser is returned`,s instanceof n),s._(t,a,o)}return t._(r,s,o)})},e.many=function(){var e=this;return n(function(t,n,r){function i(e,n){return t=e,o.push(n),!0}function a(){return!1}for(var o=[];e._(t,i,a););return n(t,o)})},e.times=function(e,t){arguments.length<2&&(t=e);var r=this;return n(function(n,i,a){function o(e,t){return d.push(t),n=e,!0}function s(e,t){return l=t,n=e,!1}function c(e,t){return!1}var l,u,d=[],f=!0;for(u=0;u<e;u+=1)if(!(f=r._(n,o,s)))return a(n,l);for(;u<t&&f;u+=1)f=r._(n,o,c);return i(n,d)})},e.result=function(e){return this.then(o(e))},e.atMost=function(e){return this.times(0,e)},e.atLeast=function(e){var t=this;return t.times(e).then(function(e){return t.many().map(function(t){return e.concat(t)})})},e.map=function(e){return this.then(function(t){return o(e(t))})},e.skip=function(e){return this.then(function(t){return e.result(t)})},this.string=function(e){var t=e.length,r=`expected '`+e+`'`;return n(function(n,i,a){var o=n.slice(0,t);return o===e?i(n.slice(t),o):a(n,r)})},a=this.regex=function(e){i(`regexp parser is anchored`,e.toString().charAt(1)===`^`);var t=`expected `+e;return n(function(n,r,i){var a,o=e.exec(n);return o?(a=o[0],r(n.slice(a.length),a)):i(n,t)})},o=n.succeed=function(e){return n(function(t,n){return n(t,e)})},n.fail=function(e){return n(function(t,n,r){return r(t,e)})},n.letter=a(/^[a-z]/i),n.letters=a(/^[a-z]*/i),n.digit=a(/^[0-9]/),n.digits=a(/^[0-9]*/),n.whitespace=a(/^\s+/),n.optWhitespace=a(/^\s*/),n.any=n(function(e,t,n){return e?t(e.slice(1),e.charAt(0)):n(e,`expected any character`)}),n.all=n(function(e,t,n){return t(``,e)}),s=n.eof=n(function(e,t,n){return e?n(e,`expected EOF`):t(e,e)})}),ne=function(){function t(e){var t,r=e.which||e.keyCode,i=n[r],a=[];return e.ctrlKey&&a.push(`Ctrl`),e.originalEvent&&e.originalEvent.metaKey&&a.push(`Meta`),e.altKey&&a.push(`Alt`),e.shiftKey&&a.push(`Shift`),t=i||String.fromCharCode(r),a.length||i?(a.push(t),a.join(`-`)):t}var n={8:`Backspace`,9:`Tab`,10:`Enter`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Esc`,32:`Spacebar`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`Left`,38:`Up`,39:`Right`,40:`Down`,45:`Insert`,46:`Del`,144:`NumLock`};return function(n,r){function i(e){S=e,clearTimeout(g),g=setTimeout(e)}function a(t){i(function(n){S=e,clearTimeout(g),t(n)})}function o(t){S(),S=e,clearTimeout(g),b.val(t),t&&b[0]&&b[0].select&&b[0].select(),_=!!t}function s(){var e=b[0];return`selectionStart`in e&&e.selectionStart!==e.selectionEnd}function c(){r.keystroke(t(v),v)}function l(e){v=e,y=null,_&&a(function(e){e&&e.type===`focusout`||!b[0]||!b[0].select||b[0].select()}),c()}function u(e){v&&y&&c(),y=e,i(f)}function d(e){v&&!y&&i(f)}function f(){if(!s()){var e=b.val();e.length===1?(b.val(``),r.typedText(e)):e&&b[0]&&b[0].select&&b[0].select()}}function p(){v=y=null}function m(e){b.focus(),i(h)}function h(){var e=b.val();b.val(``),e&&r.paste(e)}var g,_,v=null,y=null,b=tt(n),x=tt(r.container||b),S=e;return x.bind(`keydown keypress input keyup focusout paste`,function(e){S(e)}),_=!1,x.bind({keydown:l,keypress:u,keyup:d,focusout:p,cut:function(){a(function(){r.cut()})},copy:function(){a(function(){r.copy()})},paste:m}),{select:o}}}(),k.open(function(e,t){e.exportText=function(){return this.root.foldChildren(``,function(e,t){return e+t.text()})}}),k.open(function(e){e.focusBlurEvents=function(){function e(){clearTimeout(n),a.selection&&a.selection.jQ.addClass(`mq-blur`),t()}function t(){a.hide().parent.blur(),r.container.removeClass(`mq-focused`),b(window).unbind(`blur`,e)}var n,r=this,i=r.root,a=r.cursor;r.textarea.focus(function(){r.blurred=!1,clearTimeout(n),r.container.addClass(`mq-focused`),a.parent||a.insAtRightEnd(i),a.selection?(a.selection.jQ.removeClass(`mq-blur`),r.selectionChanged()):a.show()}).blur(function(){r.blurred=!0,n=setTimeout(function(){i.postOrder(`intentionalBlur`),a.clearSelection().endSelection(),t()}),b(window).bind(`blur`,e)}),r.blurred=!0,a.hide().parent.blur()}}),k.open(function(e){e.keystroke=function(e,t){this.cursor.parent.keystroke(e,t,this)}}),S.open(function(e){e.keystroke=function(e,t,n){var r=n.cursor;switch(e){case`Ctrl-Shift-Backspace`:case`Ctrl-Backspace`:n.ctrlDeleteDir(v);break;case`Shift-Backspace`:case`Backspace`:n.backspace();break;case`Esc`:case`Tab`:n.escapeDir(y,e,t);return;case`Shift-Tab`:case`Shift-Esc`:n.escapeDir(v,e,t);return;case`End`:n.notify(`move`).cursor.insAtRightEnd(r.parent);break;case`Ctrl-End`:n.notify(`move`).cursor.insAtRightEnd(n.root);break;case`Shift-End`:for(;r[y];)n.selectRight();break;case`Ctrl-Shift-End`:for(;r[y]||r.parent!==n.root;)n.selectRight();break;case`Home`:n.notify(`move`).cursor.insAtLeftEnd(r.parent);break;case`Ctrl-Home`:n.notify(`move`).cursor.insAtLeftEnd(n.root);break;case`Shift-Home`:for(;r[v];)n.selectLeft();break;case`Ctrl-Shift-Home`:for(;r[v]||r.parent!==n.root;)n.selectLeft();break;case`Left`:n.moveLeft();break;case`Shift-Left`:n.selectLeft();break;case`Ctrl-Left`:break;case`Right`:n.moveRight();break;case`Shift-Right`:n.selectRight();break;case`Ctrl-Right`:break;case`Up`:n.moveUp();break;case`Down`:n.moveDown();break;case`Shift-Up`:if(r[v])for(;r[v];)n.selectLeft();else n.selectLeft();case`Shift-Down`:if(r[y])for(;r[y];)n.selectRight();else n.selectRight();case`Ctrl-Up`:case`Ctrl-Down`:break;case`Ctrl-Shift-Del`:case`Ctrl-Del`:n.ctrlDeleteDir(y);break;case`Shift-Del`:case`Del`:n.deleteForward();break;case`Meta-A`:case`Ctrl-A`:for(n.notify(`move`).cursor.insAtRightEnd(n.root);r[v];)n.selectLeft();break;default:return}t.preventDefault(),n.scrollHoriz()},e.moveOutOf=e.moveTowards=e.deleteOutOf=e.deleteTowards=e.unselectInto=e.selectOutOf=e.selectTowards=function(){i(`overridden or never called on this node`)}}),k.open(function(e){function t(e,t){var n=e.notify(`upDown`).cursor,r=t+`Into`,i=t+`OutOf`;return n[y][r]?n.insAtLeftEnd(n[y][r]):n[v][r]?n.insAtRightEnd(n[v][r]):n.parent.bubble(function(e){var t=e[i];if(t&&(typeof t==`function`&&(t=e[i](n)),t instanceof S&&n.jumpUpDown(e,t),!0!==t))return!1}),e}this.onNotify(function(e){e!==`move`&&e!==`upDown`||this.show().clearSelection()}),e.escapeDir=function(e,t,n){a(e);var r=this.cursor;if(r.parent!==this.root&&n.preventDefault(),r.parent!==this.root)return r.parent.moveOutOf(e,r),this.notify(`move`)},M.leftRightIntoCmdGoes=function(e){if(e&&e!==`up`&&e!==`down`)throw`"up" or "down" required for leftRightIntoCmdGoes option, got "`+e+`"`;return e},e.moveDir=function(e){a(e);var t=this.cursor,n=t.options.leftRightIntoCmdGoes;return t.selection?t.insDirOf(e,t.selection.ends[e]):t[e]?t[e].moveTowards(e,t,n):t.parent.moveOutOf(e,t,n),this.notify(`move`)},e.moveLeft=function(){return this.moveDir(v)},e.moveRight=function(){return this.moveDir(y)},e.moveUp=function(){return t(this,`up`)},e.moveDown=function(){return t(this,`down`)},this.onNotify(function(e){e!==`upDown`&&(this.upDownCache={})}),this.onNotify(function(e){e===`edit`&&this.show().deleteSelection()}),e.deleteDir=function(e){var t,n;return a(e),t=this.cursor,n=t.selection,this.notify(`edit`),n||(t[e]?t[e].deleteTowards(e,t):t.parent.deleteOutOf(e,t)),t[v].siblingDeleted&&t[v].siblingDeleted(t.options,y),t[y].siblingDeleted&&t[y].siblingDeleted(t.options,v),t.parent.bubble(`reflow`),this},e.ctrlDeleteDir=function(e){a(e);var t=this.cursor;return!t[e]||t.selection?this.deleteDir(e):(this.notify(`edit`),e===v?C(t.parent.ends[v],t[v]).remove():C(t[y],t.parent.ends[y]).remove(),t.insAtDirEnd(e,t.parent),t[v].siblingDeleted&&t[v].siblingDeleted(t.options,y),t[y].siblingDeleted&&t[y].siblingDeleted(t.options,v),t.parent.bubble(`reflow`),this)},e.backspace=function(){return this.deleteDir(v)},e.deleteForward=function(){return this.deleteDir(y)},this.onNotify(function(e){e!==`select`&&this.endSelection()}),e.selectDir=function(e){var t,n=this.notify(`select`).cursor,r=n.selection;a(e),n.anticursor||n.startSelection(),t=n[e],t?r&&r.ends[e]===t&&n.anticursor[-e]!==t?t.unselectInto(e,n):t.selectTowards(e,n):n.parent.selectOutOf(e,n),n.clearSelection(),n.select()||n.show()},e.selectLeft=function(){return this.selectDir(v)},e.selectRight=function(){return this.selectDir(y)}}),re=/[\\]{2,}/gm,ie=function(){function e(e){var t=oe();return e.adopt(t,0,0),t}function t(e){var t,n=e[0]||oe();for(t=1;t<e.length;t+=1)e[t].children().adopt(n,n.ends[y],0);return n}var n=I.string,r=I.regex,i=I.letter,a=I.any,o=I.optWhitespace,s=I.succeed,c=I.fail,l=i.map(function(e){return fe(e)}),u=r(/^[^${}\\_^]/).map(function(e){return z(e)}),d=r(/^\\not\\[a-z]+/).then(function(e){return E[e]&&E[e]().parser()||c(`unknown compound command: `+e)}),f=r(/^[^\\a-eg-zA-Z]/).or(n(`\\`).then(r(/^begin\{.?matrix\}/).or(r(/^[a-z]+/i)).or(r(/^\s+/).result(` `)).or(a))).then(function(e){e=e.replace(/^begin\{(.?matrix)\}$/,`$1`);var t=w[e];return t?t(e).parser():c(`unknown command: \\`+e)}),p=d.or(f).or(l).or(u),m=n(`{`).then(function(){return g}).skip(n(`}`)),h=o.then(m.or(p.map(e))),g=h.many().map(t).skip(o),_=n(`[`).then(h.then(function(e){return e.join(`latex`)===`]`?c():s(e)}).many().map(t).skip(o)).skip(n(`]`)),v=g;return v.block=h,v.optBlock=_,v}(),k.open(function(e,t){e.exportLatex=function(){return this.root.latex().replace(/(\\[a-z]+) (?![a-z])/gi,`$1`)},e.parseLatex=function(e){return ie.parse(e).postOrder(`finalizeTree`,j.p).join(`latex`).trim()},M.maxDepth=function(e){return typeof e==`number`?e:void 0},e.writeLatex=function(e){var t,n=this.notify(`edit`).cursor,r=I.all,i=I.eof,a=ie.skip(i).or(r.result(!1)).parse(e);return a&&!a.isEmpty()&&a.prepareInsertionAt(n)&&(a.children().adopt(n.parent,n[v],n[y]),t=a.jQize(),t.insertBefore(n.jQ),n[v]=a.ends[y],a.finalizeInsert(n.options,n),a.ends[y][y].siblingCreated&&a.ends[y][y].siblingCreated(n.options,v),a.ends[v][v].siblingCreated&&a.ends[v][v].siblingCreated(n.options,y),n.parent.bubble(`reflow`)),this},e.renderLatexMath=function(e){var t,n,r,i,a,o,s;e&&e.replace&&(e=e.replace(re,`\\`)),t=this.root,n=this.cursor,n.options,r=t.jQ,i=I.all,a=I.eof,o=ie.skip(a).or(i.result(!1)).parse(e),t.eachChild(`postOrder`,`dispose`),t.ends[v]=t.ends[y]=0,o&&o.prepareInsertionAt(n)?(o.children().adopt(t,0,0),s=o.join(`html`),r.html(s),t.jQize(r.children()),t.finalizeInsert(n.options)):r.empty(),delete n.selection,n.insAtRightEnd(t)},e.renderLatexText=function(e){var t,n,r,i,a,o,s,c,l,u,d=this.root,f=this.cursor;if(d.jQ.children().slice(1).remove(),d.eachChild(`postOrder`,`dispose`),d.ends[v]=d.ends[y]=0,delete f.selection,f.show().insAtRightEnd(d),t=I.regex,n=I.string,r=I.eof,i=I.all,a=n(`$`).then(ie).skip(n(`$`).or(r)).map(function(e){var t,n=le(f);return n.createBlocks(),t=n.ends[v],e.children().adopt(t,0,0),n}),o=n(`\\$`).result(`$`),s=o.or(t(/^[^$]/)).map(z),c=a.or(s).many(),l=c.skip(r).or(i.result(!1)).parse(e)){for(u=0;u<l.length;u+=1)l[u].adopt(d,d.ends[y],0);d.jQize().appendTo(d.jQ),d.finalizeInsert(f.options)}}}),k.open(function(t){j.p.ignoreNextMousedown=e,t.delegateMouseEvents=function(){var t=this.root.jQ;this.container.bind(`mousedown.mathquill`,function(n){function r(e){c.anticursor||c.startSelection(),s.seek(b(e.target),e.pageX,e.pageY).cursor.select(),e.target&&b(e.target.ownerDocument).unbind(`mousemove`,i)}function i(e){return delete e.target,r(e)}function a(e){c.selection||s.editable||l.detach(),o.unbind(`mousemove`,r),b(e.target.ownerDocument).unbind(`mousemove`,i).unbind(`mouseup`,a)}var o=b(n.target).closest(`.mq-root-block`),s=S.byId[o.attr(rt)||t.attr(rt)].controller,c=s.cursor,l=(c.blink,s.textareaSpan),u=s.textarea;if(n.preventDefault(),n.target.unselectable=!0,!c.options.ignoreNextMousedown(n)){if(c.options.ignoreNextMousedown=e,l.parent().length===0)return!1;s.blurred&&(s.editable||o.prepend(l),document.body.focus(),u.focus()),n.preventDefault(),n.target.unselectable=!0,c.show(),s.seek(b(n.target),n.pageX,n.pageY).cursor.startSelection(),o.mousemove(r),b(n.target.ownerDocument).mousemove(i).mouseup(a)}})}}),k.open(function(e){e.seek=function(e,t,n){var r,a,o,s=this.notify(`select`).cursor;return e&&((r=e.attr(rt)||e.attr(nt))||(a=e.parent(),r=a.attr(rt)||a.attr(nt))),o=r?S.byId[r]:this.root,i(`nodeId is the id of some Node that exists`,o),s.clearSelection().show(),o.seek(t,s),this.scrollHoriz(),this}}),k.open(function(e){e.scrollHoriz=function(){var e,t,n,r,i,a=this.cursor,o=a.selection,s=this.root.jQ[0].getBoundingClientRect();if(o)if(n=o.jQ[0].getBoundingClientRect(),r=n.left-(s.left+20),i=n.right-(s.right-20),o.ends[v]===a[y])if(r<0)t=r;else{if(!(i>0))return;t=n.left-i<s.left+20?r:i}else if(i>0)t=i;else{if(!(r<0))return;t=n.right-r>s.right-20?i:r}else if((e=a.jQ[0].getBoundingClientRect().left)>s.right-20)t=e-(s.right-20);else{if(!(e<s.left+20))return;t=e-(s.left+20)}this.root.jQ.stop&&typeof this.root.jQ.stop==`function`&&this.root.jQ.stop().animate({scrollLeft:`+=`+t},100)}}),k.open(function(e){j.p.substituteTextarea=function(){return b(`<textarea autocapitalize=off autocomplete=off autocorrect=off spellcheck=false x-palm-disable-ste-all=true />`)[0]},e.createTextarea=function(){var e,t=this.textareaSpan=b(`<span class="mq-textarea"></span>`),n=this.options.substituteTextarea();if(!n.nodeType)throw`substituteTextarea() must return a DOM element, got `+n;n=this.textarea=b(n).appendTo(t),e=this,e.cursor.selectionChanged=function(){e.selectionChanged()}},e.selectionChanged=function(){var e=this;Te(e.container[0]),e.textareaSelectionTimeout===void 0&&(e.textareaSelectionTimeout=setTimeout(function(){e.setTextareaSelection()}))},e.setTextareaSelection=function(){this.textareaSelectionTimeout=void 0;var e=``;this.cursor.selection&&(e=this.cursor.selection.join(`latex`),this.options.statelessClipboard&&(e=`$`+e+`$`)),this.selectFn(e)},e.staticMathTextareaEvents=function(){function e(){i.detach(),t.blurred=!0}var t=this,n=(t.root,t.cursor),r=t.textarea,i=t.textareaSpan;this.container.prepend(tt(`<span class="mq-selectable">`).text(`$`+t.exportLatex()+`$`)),t.blurred=!0,r.bind(`cut paste`,!1).bind(`copy`,function(){t.setTextareaSelection()}).focus(function(){t.blurred=!1}).blur(function(){n.selection&&n.selection.clear(),setTimeout(e)}),t.selectFn=function(e){r.val(e),e&&r.select()}},j.p.substituteKeyboardEvents=ne,e.editablesTextareaEvents=function(){var e=this,t=e.textarea,n=e.textareaSpan,r=this.options.substituteKeyboardEvents(t,this);this.selectFn=function(e){r.select(e)},this.container.prepend(n),this.focusBlurEvents()},e.typedText=function(e){if(e===`
313
- `)return this.handle(`enter`);var t=this.notify().cursor;t.parent.write(t,e),this.scrollHoriz()},e.cut=function(){var e=this,t=e.cursor;t.selection&&setTimeout(function(){e.notify(`edit`),t.parent.bubble(`reflow`)})},e.copy=function(){this.setTextareaSelection()},e.paste=function(e){this.options.statelessClipboard&&(e=e.slice(0,1)===`$`&&e.slice(-1)===`$`?e.slice(1,-1):`\\text{`+e+`}`),this.writeLatex(e).cursor.show()}}),L=_(S,function(e,t){e.finalizeInsert=function(e,t){var n=this;n.postOrder(`finalizeTree`,e),n.postOrder(`contactWeld`,t),n.postOrder(`blur`),n.postOrder(`reflow`),n[y].siblingCreated&&n[y].siblingCreated(e,v),n[v].siblingCreated&&n[v].siblingCreated(e,y),n.bubble(`reflow`)},e.prepareInsertionAt=function(e){var t,n=e.options.maxDepth;if(n!==void 0){if((t=e.depth())>n)return!1;this.removeNodesDeeperThan(n-t)}return!0},e.removeNodesDeeperThan=function(e){for(var t,n=0,r=[[this,n]];r.length;)t=r.shift(),t[0].children().each(function(i){var a=+(i instanceof oe);n=t[1]+a,n<=e?r.push([i,n]):(a?i.children():i).remove()})}}),R=_(L,function(e,t){e.init=function(e,n,r){var i=this;t.init.call(i),i.ctrlSeq||=e,n&&(i.htmlTemplate=n),r&&(i.textTemplate=r)},e.replaces=function(e){e.disown(),this.replacedFragment=e},e.isEmpty=function(){return this.foldChildren(!0,function(e,t){return e&&t.isEmpty()})},e.parser=function(){var e=ie.block,t=this;return e.times(t.numBlocks()).map(function(e){t.blocks=e;for(var n=0;n<e.length;n+=1)e[n].adopt(t,t.ends[y],0);return t})},e.createLeftOf=function(e){var n=this,r=n.replacedFragment;n.createBlocks(),t.createLeftOf.call(n,e),r&&(r.adopt(n.ends[v],0,0),r.jQ.appendTo(n.ends[v].jQ),n.placeCursor(e),n.prepareInsertionAt(e)),n.finalizeInsert(e.options),n.placeCursor(e)},e.createBlocks=function(){var e,t,n=this,r=n.numBlocks(),i=n.blocks=Array(r);for(e=0;e<r;e+=1)t=i[e]=oe(),t.adopt(n,n.ends[y],0)},e.placeCursor=function(e){e.insAtRightEnd(this.foldChildren(this.ends[v],function(e,t){return e.isEmpty()?e:t}))},e.moveTowards=function(e,t,n){var r=n&&this[n+`Into`];t.insAtDirEnd(-e,r||this.ends[-e])},e.deleteTowards=function(e,t){this.isEmpty()?t[e]=this.remove()[e]:this.moveTowards(e,t,null)},e.selectTowards=function(e,t){t[-e]=this,t[e]=this[e]},e.selectChildren=function(){return O(this,this)},e.unselectInto=function(e,t){t.insAtDirEnd(-e,t.anticursor.ancestors[this.id])},e.seek=function(e,t){function n(e){var t={};return t[v]=e.jQ.offset().left,t[y]=t[v]+e.jQ.outerWidth(),t}var r,i=this,a=n(i);return e<a[v]?t.insLeftOf(i):e>a[y]?t.insRightOf(i):(r=a[v],void i.eachChild(function(o){var s=n(o);return e<s[v]?(e-r<s[v]-e?o[v]?t.insAtRightEnd(o[v]):t.insLeftOf(i):t.insAtLeftEnd(o),!1):e>s[y]?void(o[y]?r=s[y]:a[y]-e<e-s[y]?t.insRightOf(i):t.insAtRightEnd(o)):(o.seek(e,t),!1)}))},e.numBlocks=function(){var e=this.htmlTemplate.match(/&\d+/g);return e?e.length:0},e.html=function(){var e,t,n,r=this,a=r.blocks,o=` mathquill-command-id=`+r.id,s=r.htmlTemplate.match(/<[^<>]+>|[^<>]+/g);for(i(`no unmatched angle brackets`,s.join(``)===this.htmlTemplate),e=0,t=s[0];t;e+=1,t=s[e])if(t.slice(-2)===`/>`)s[e]=t.slice(0,-2)+o+`/>`;else if(t.charAt(0)===`<`){i(`not an unmatched top-level close tag`,t.charAt(1)!==`/`),s[e]=t.slice(0,-1)+o+`>`,n=1;do e+=1,t=s[e],i(`no missing close tags`,t),t.slice(0,2)===`</`?--n:t.charAt(0)===`<`&&t.slice(-2)!==`/>`&&(n+=1);while(n>0)}return s.join(``).replace(/>&(\d+)/g,function(e,t){return` mathquill-block-id=`+a[t].id+`>`+a[t].join(`html`)})},e.latex=function(){return this.foldChildren(this.ctrlSeq,function(e,t){return e+`{`+(t.latex()||` `)+`}`})},e.textTemplate=[``],e.text=function(){var e=this,t=0;return e.foldChildren(e.textTemplate[t],function(n,r){t+=1;var i=r.text();return n&&e.textTemplate[t]===`(`&&i[0]===`(`&&i.slice(-1)===`)`?n+i.slice(1,-1)+e.textTemplate[t]:n+i+(e.textTemplate[t]||``)})}}),ae=_(R,function(t,n){t.init=function(e,t,r){r||=e&&e.length>1?e.slice(1):e,n.init.call(this,e,t,[r])},t.parser=function(){return I.succeed(this)},t.numBlocks=function(){return 0},t.replaces=function(e){e.remove()},t.createBlocks=e,t.moveTowards=function(e,t){t.jQ.insDirOf(e,this.jQ),t[-e]=this,t[e]=this[e]},t.deleteTowards=function(e,t){t[e]=this.remove()[e]},t.seek=function(e,t){e-this.jQ.offset().left<this.jQ.outerWidth()/2?t.insLeftOf(this):t.insRightOf(this)},t.latex=function(){return this.ctrlSeq},t.text=function(){return this.textTemplate},t.placeCursor=e,t.isEmpty=function(){return!0}}),z=_(ae,function(e,t){e.init=function(e,n){t.init.call(this,e,`<span>`+(n||e)+`</span>`)}}),B=_(ae,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-binary-operator">`+n+`</span>`,r)}}),oe=_(L,function(e,t){e.join=function(e){return this.foldChildren(``,function(t,n){return t+n[e]()})},e.html=function(){return this.join(`html`)},e.latex=function(){return this.join(`latex`)},e.text=function(){return this.ends[v]===this.ends[y]&&this.ends[v]!==0?this.ends[v].text():this.join(`text`)},e.keystroke=function(e,n,r){return!r.options.spaceBehavesLikeTab||e!==`Spacebar`&&e!==`Shift-Spacebar`?t.keystroke.apply(this,arguments):(n.preventDefault(),void r.escapeDir(e===`Shift-Spacebar`?v:y,e,n))},e.moveOutOf=function(e,t,n){n&&this.parent[n+`Into`]||!this[e]?t.insDirOf(e,this.parent):t.insAtDirEnd(-e,this[e])},e.selectOutOf=function(e,t){t.insDirOf(e,this.parent)},e.deleteOutOf=function(e,t){t.unwrapGramp()},e.seek=function(e,t){var n=this.ends[y];if(!n||n.jQ.offset().left+n.jQ.outerWidth()<e)return t.insAtRightEnd(this);if(e<this.ends[v].jQ.offset().left)return t.insAtLeftEnd(this);for(;e<n.jQ.offset().left;)n=n[v];return n.seek(e,t)},e.chToCmd=function(e,t){var n;return e.match(/^[a-eg-zA-Z]$/)?fe(e):/^\d$/.test(e)?de(e):t&&t.typingSlashWritesDivisionSymbol&&e===`/`?w[`÷`](e):t&&t.typingAsteriskWritesTimesSymbol&&e===`*`?w[`×`](e):(n=T[e]||w[e])?n(e):z(e)},e.write=function(e,t){var n;if(e.tooDeep())return!1;n=this.chToCmd(t,e.options),e.selection&&n.replaces(e.replaceSelection()),e.isTooDeep()||n.createLeftOf(e.show())},e.focus=function(){return this.jQ.addClass(`mq-hasCursor`),this.jQ.removeClass(`mq-empty`),this},e.blur=function(){return this.jQ.removeClass(`mq-hasCursor`),this.isEmpty()&&this.jQ.addClass(`mq-empty`),this}}),j.p.mouseEvents=!0,A.StaticMath=function(e){return _(e.AbstractMathQuill,function(t,n){this.RootBlock=oe,t.__mathquillify=function(e,t){return this.config(e),n.__mathquillify.call(this,`mq-math-mode`),this.__options.mouseEvents&&(this.__controller.delegateMouseEvents(),this.__controller.staticMathTextareaEvents()),this},t.init=function(){n.init.apply(this,arguments),this.__controller.root.postOrder(`registerInnerField`,this.innerFields=[],e.MathField)},t.latex=function(){var t=n.latex.apply(this,arguments);return arguments.length>0&&this.__controller.root.postOrder(`registerInnerField`,this.innerFields=[],e.MathField),t}})},se=_(oe,u),A.MathField=function(t){return _(t.EditableField,function(t,n){this.RootBlock=se,t.__mathquillify=function(t,r){return this.config(t),r>1&&(this.__controller.root.reflow=e),n.__mathquillify.call(this,`mq-editable-field mq-math-mode`),delete this.__controller.root.reflow,this}})},ce=_(S,function(e,t){function n(e){var t,n;return e.jQ[0].normalize(),t=e.jQ.contents().filter(function(e,t){return t.nodeType===3})[0],t||={data:``},i(`only node in TextBlock span is Text node`,t.nodeType===3),n=V(t.data),n.jQadd(t),e.children().disown(),n.adopt(e,0,0)}e.ctrlSeq=`\\text`,e.replaces=function(e){e instanceof C?this.replacedText=e.remove().jQ.text():typeof e==`string`&&(this.replacedText=e)},e.jQadd=function(e){t.jQadd.call(this,e),this.ends[v]&&this.ends[v].jQadd(this.jQ[0].firstChild)},e.createLeftOf=function(e){var n,r=this;if(t.createLeftOf.call(this,e),r[y].siblingCreated&&r[y].siblingCreated(e.options,v),r[v].siblingCreated&&r[v].siblingCreated(e.options,y),r.bubble(`reflow`),e.insAtRightEnd(r),r.replacedText)for(n=0;n<r.replacedText.length;n+=1)r.write(e,r.replacedText.charAt(n))},e.parser=function(){var e=this,t=I.string,n=I.regex;return I.optWhitespace.then(t(`{`)).then(n(/^[^}]*/)).skip(t(`}`)).map(function(t){return t.length===0?C():(V(t).adopt(e,0,0),e)})},e.textContents=function(){return this.foldChildren(``,function(e,t){return e+t.text})},e.text=function(){return`"`+this.textContents()+`"`},e.latex=function(){var e=this.textContents();return e.length===0?``:`\\text{`+e.replace(/\\/g,`\\backslash `).replace(/[{}]/g,`\\$&`)+`}`},e.html=function(){return`<span class="mq-text-mode" mathquill-command-id=`+this.id+`>`+this.textContents()+`</span>`},e.moveTowards=function(e,t){t.insAtDirEnd(-e,this)},e.moveOutOf=function(e,t){t.insDirOf(e,this)},e.unselectInto=e.moveTowards,e.selectTowards=R.prototype.selectTowards,e.deleteTowards=R.prototype.deleteTowards,e.selectOutOf=function(e,t){t.insDirOf(e,this)},e.deleteOutOf=function(e,t){this.isEmpty()&&t.insRightOf(this)},e.write=function(e,n){var r,i;e.show().deleteSelection(),n===`$`?this.isEmpty()?(e.insRightOf(this),z(`\\$`,`$`).createLeftOf(e)):e[y]?e[v]?(r=ce(),i=this.ends[v],i.disown().jQ.detach(),i.adopt(r,0,0),e.insLeftOf(this),t.createLeftOf.call(r,e)):e.insLeftOf(this):e.insRightOf(this):e[v]?(e[v].appendText(n),this.bubble(`reflow`)):V(n).createLeftOf(e)},e.seek=function(e,t){var r,i,a,o,s,c,l,u;for(t.hide(),r=n(this),i=this.jQ.width()/this.text.length,a=Math.round((e-this.jQ.offset().left)/i),a<=0?t.insAtLeftEnd(this):a>=r.text.length?t.insAtRightEnd(this):t.insLeftOf(r.splitRight(a)),o=e-t.show().offset().left,s=o&&o<0?v:y,c=s;t[s]&&o*c>0;)t[s].moveTowards(s,t),c=o,o=e-t.offset().left;s*o<-s*c&&t[-s].moveTowards(-s,t),t.anticursor?t.anticursor.parent===this&&(l=t[v]&&t[v].text.length,this.anticursorPosition===l?t.anticursor=x.copy(t):(this.anticursorPosition<l?(u=t[v].splitRight(this.anticursorPosition),t[v]=u):u=t[y].splitRight(this.anticursorPosition-l),t.anticursor=x(this,u[v],u))):this.anticursorPosition=t[v]&&t[v].text.length},e.blur=function(e){oe.prototype.blur.call(this),e&&(this.textContents()===``?(this.remove(),e[v]===this?e[v]=this[v]:e[y]===this&&(e[y]=this[y])):n(this))},e.focus=oe.prototype.focus}),V=_(S,function(e,t){function n(e,t){return t.charAt(e===v?0:-1+t.length)}e.init=function(e){t.init.call(this),this.text=e},e.jQadd=function(e){this.dom=e,this.jQ=b(e)},e.jQize=function(){return this.jQadd(document.createTextNode(this.text))},e.appendText=function(e){this.text+=e,this.dom.appendData(e)},e.prependText=function(e){this.text=e+this.text,this.dom.insertData(0,e)},e.insTextAtDirEnd=function(e,t){a(t),t===y?this.appendText(e):this.prependText(e)},e.splitRight=function(e){var t=V(this.text.slice(e)).adopt(this.parent,this,this[y]);return t.jQadd(this.dom.splitText(e)),this.text=this.text.slice(0,e),t},e.moveTowards=function(e,t){var r,i;return a(e),r=n(-e,this.text),i=this[-e],i?i.insTextAtDirEnd(r,e):V(r).createDir(-e,t),this.deleteTowards(e,t)},e.latex=function(){return this.text},e.deleteTowards=function(e,t){this.text.length>1?e===y?(this.dom.deleteData(0,1),this.text=this.text.slice(1)):(this.dom.deleteData(-1+this.text.length,1),this.text=this.text.slice(0,-1)):(this.remove(),this.jQ.remove(),t[e]=this[e])},e.selectTowards=function(e,t){var r,i,o,s;return a(e),r=t.anticursor,i=n(-e,this.text),r[e]===this?(o=V(i).createDir(e,t),r[e]=o,t.insDirOf(e,o)):(s=this[-e],s?s.insTextAtDirEnd(i,e):(o=V(i).createDir(-e,t),o.jQ.insDirOf(-e,t.selection.jQ)),this.text.length===1&&r[-e]===this&&(r[-e]=this[-e])),this.deleteTowards(e,t)}}),w.text=w.textnormal=w.textrm=w.textup=w.textmd=ce,w.em=w.italic=w.italics=w.emph=w.textit=w.textsl=d(`\\textit`,`i`,`class="mq-text-mode"`),w.strong=w.bold=w.textbf=d(`\\textbf`,`b`,`class="mq-text-mode"`),w.sf=w.textsf=d(`\\textsf`,`span`,`class="mq-sans-serif mq-text-mode"`),w.tt=w.texttt=d(`\\texttt`,`span`,`class="mq-monospace mq-text-mode"`),w.textsc=d(`\\textsc`,`span`,`style="font-variant:small-caps" class="mq-text-mode"`),w.uppercase=d(`\\uppercase`,`span`,`style="text-transform:uppercase" class="mq-text-mode"`),w.lowercase=d(`\\lowercase`,`span`,`style="text-transform:lowercase" class="mq-text-mode"`),le=_(R,function(e,t){e.init=function(e){t.init.call(this,`$`),this.cursor=e},e.htmlTemplate=`<span class="mq-math-mode">&0</span>`,e.createBlocks=function(){t.createBlocks.call(this),this.ends[v].cursor=this.cursor,this.ends[v].write=function(e,t){t===`$`?this.isEmpty()?(e.insRightOf(this.parent),this.parent.deleteTowards(dir,e),z(`\\$`,`$`).createLeftOf(e.show())):e[y]?e[v]?oe.prototype.write.call(this,e,t):e.insLeftOf(this.parent):e.insRightOf(this.parent):oe.prototype.write.call(this,e,t)}},e.latex=function(){return`$`+this.ends[v].latex()+`$`}}),ue=_(se,function(e,t){e.keystroke=function(e){if(e!==`Spacebar`&&e!==`Shift-Spacebar`)return t.keystroke.apply(this,arguments)},e.write=function(e,t){if(e.show().deleteSelection(),t===`$`)le(e).createLeftOf(e);else{var n;t===`<`?n=`&lt;`:t===`>`&&(n=`&gt;`),z(t,n).createLeftOf(e)}}}),A.TextField=function(e){return _(e.EditableField,function(e,t){this.RootBlock=ue,e.__mathquillify=function(){return t.__mathquillify.call(this,`mq-editable-field mq-text-mode`)},e.latex=function(e){return arguments.length>0?(this.__controller.renderLatexText(e),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()}})},T[`\\`]=_(R,function(e,t){e.ctrlSeq=`\\`,e.replaces=function(e){this._replacedFragment=e.disown(),this.isEmpty=function(){return!1}},e.htmlTemplate=`<span class="mq-latex-command-input mq-non-leaf">\\<span>&0</span></span>`,e.textTemplate=[`\\`],e.createBlocks=function(){t.createBlocks.call(this),this.ends[v].focus=function(){return this.parent.jQ.addClass(`mq-hasCursor`),this.isEmpty()&&this.parent.jQ.removeClass(`mq-empty`),this},this.ends[v].blur=function(){return this.parent.jQ.removeClass(`mq-hasCursor`),this.isEmpty()&&this.parent.jQ.addClass(`mq-empty`),this},this.ends[v].write=function(e,t){e.show().deleteSelection(),t.match(/[a-z]/i)?z(t).createLeftOf(e):(this.parent.renderCommand(e),t===`\\`&&this.isEmpty()||e.parent.write(e,t))},this.ends[v].keystroke=function(e,n,r){return e===`Tab`||e===`Enter`||e===`Spacebar`?(this.parent.renderCommand(r.cursor),void n.preventDefault()):t.keystroke.apply(this,arguments)}},e.createLeftOf=function(e){if(t.createLeftOf.call(this,e),this._replacedFragment){var n=this.jQ[0];this.jQ=this._replacedFragment.jQ.addClass(`mq-blur`).bind(`mousedown mousemove`,function(e){return b(e.target=n).trigger(e),!1}).insertBefore(this.jQ).add(this.jQ)}},e.latex=function(){return`\\`+this.ends[v].latex()+` `},e.renderCommand=function(e){var t,n;this.jQ=this.jQ.last(),this.remove(),this[y]?e.insLeftOf(this[y]):e.insAtRightEnd(this.parent),t=this.ends[v].latex(),t||=` `,n=w[t],n?(n=n(t),this._replacedFragment&&n.replaces(this._replacedFragment),n.createLeftOf(e)):(n=ce(),n.replaces(t),n.createLeftOf(e),e.insRightOf(n),this._replacedFragment&&this._replacedFragment.remove())}}),w[`∉`]=w.notin=r(B,`\\notin `,`&#8713;`),w[`≅`]=w.cong=r(B,`\\cong `,`&#8773;`),w[`≡`]=w.equiv=r(B,`\\equiv `,`&#8801;`),w[`⊕`]=w.oplus=r(B,`\\oplus `,`&#8853;`),w[`⊗`]=w.otimes=r(B,`\\otimes `,`&#8855;`),w[`≠`]=w.ne=w.neq=r(B,`\\ne `,`&ne;`),w[`≇`]=w.ncong=r(B,`\\ncong `,`&ncong;`),w[`∗`]=w.ast=w.star=w.loast=w.lowast=r(B,`\\ast `,`&lowast;`),w.therefor=w.therefore=r(B,`\\therefore `,`&there4;`),w.cuz=w.because=r(B,`\\because `,`&#8757;`),w.prop=w.propto=r(B,`\\propto `,`&prop;`),w[`≈`]=w.asymp=w.approx=r(B,`\\approx `,`&asymp;`),w[`≉`]=w.nasymp=w.napprox=r(B,`\\napprox `,`&nap;`),w.isin=w.in=r(B,`\\in `,`&isin;`),w.ni=w.contains=r(B,`\\ni `,`&ni;`),w.notni=w.niton=w.notcontains=w.doesnotcontain=E[`\\not\\ni`]=r(B,`\\not\\ni `,`&#8716;`),w.sub=w.subset=r(B,`\\subset `,`&sub;`),w.sup=w.supset=w.superset=r(B,`\\supset `,`&sup;`),w.nsub=w.notsub=w.nsubset=w.notsubset=E[`\\not\\subset`]=r(B,`\\not\\subset `,`&#8836;`),w.nsup=w.notsup=w.nsupset=w.notsupset=w.nsuperset=w.notsuperset=E[`\\not\\supset`]=r(B,`\\not\\supset `,`&#8837;`),w.sube=w.subeq=w.subsete=w.subseteq=r(B,`\\subseteq `,`&sube;`),w.supe=w.supeq=w.supsete=w.supseteq=w.supersete=w.superseteq=r(B,`\\supseteq `,`&supe;`),w.nsube=w.nsubeq=w.notsube=w.notsubeq=w.nsubsete=w.nsubseteq=w.notsubsete=w.notsubseteq=E[`\\not\\subseteq`]=r(B,`\\not\\subseteq `,`&#8840;`),w.nsupe=w.nsupeq=w.notsupe=w.notsupeq=w.nsupsete=w.nsupseteq=w.notsupsete=w.notsupseteq=w.nsupersete=w.nsuperseteq=w.notsupersete=w.notsuperseteq=E[`\\not\\supseteq`]=r(B,`\\not\\supseteq `,`&#8841;`),w.N=w.naturals=w.Naturals=r(z,`\\mathbb{N}`,`&#8469;`),w.P=w.primes=w.Primes=w.projective=w.Projective=w.probability=w.Probability=r(z,`\\mathbb{P}`,`&#8473;`),w.Z=w.integers=w.Integers=r(z,`\\mathbb{Z}`,`&#8484;`),w.Q=w.rationals=w.Rationals=r(z,`\\mathbb{Q}`,`&#8474;`),w.R=w.reals=w.Reals=r(z,`\\mathbb{R}`,`&#8477;`),w.C=w.complex=w.Complex=w.complexes=w.Complexes=w.complexplane=w.Complexplane=w.ComplexPlane=r(z,`\\mathbb{C}`,`&#8450;`),w.H=w.Hamiltonian=w.quaternions=w.Quaternions=r(z,`\\mathbb{H}`,`&#8461;`),w.quad=w.emsp=r(z,`\\quad `,` `),w.qquad=r(z,`\\qquad `,` `),w.diamond=r(z,`\\diamond `,`&#9671;`),w.bigtriangleup=r(z,`\\bigtriangleup `,`&#9651;`),w.ominus=r(z,`\\ominus `,`&#8854;`),w.uplus=r(z,`\\uplus `,`&#8846;`),w.bigtriangledown=r(z,`\\bigtriangledown `,`&#9661;`),w.sqcap=r(z,`\\sqcap `,`&#8851;`),w.triangleleft=r(z,`\\triangleleft `,`&#8882;`),w.sqcup=r(z,`\\sqcup `,`&#8852;`),w.triangleright=r(z,`\\triangleright `,`&#8883;`),w.odot=w.circledot=r(z,`\\odot `,`&#8857;`),w.bigcirc=r(z,`\\bigcirc `,`&#9711;`),w.dagger=r(z,`\\dagger `,`&#0134;`),w.ddagger=r(z,`\\ddagger `,`&#135;`),w.wr=r(z,`\\wr `,`&#8768;`),w.amalg=r(z,`\\amalg `,`&#8720;`),w.models=r(z,`\\models `,`&#8872;`),w.prec=r(z,`\\prec `,`&#8826;`),w.succ=r(z,`\\succ `,`&#8827;`),w.preceq=r(z,`\\preceq `,`&#8828;`),w.succeq=r(z,`\\succeq `,`&#8829;`),w.simeq=r(z,`\\simeq `,`&#8771;`),w.mid=r(z,`\\mid `,`&#8739;`),w.ll=r(z,`\\ll `,`&#8810;`),w.gg=r(z,`\\gg `,`&#8811;`),w.parallel=r(z,`\\parallel `,`&#8741;`),w.nparallel=r(z,`\\nparallel `,`&#8742;`),w.bowtie=r(z,`\\bowtie `,`&#8904;`),w.sqsubset=r(z,`\\sqsubset `,`&#8847;`),w.sqsupset=r(z,`\\sqsupset `,`&#8848;`),w.smile=r(z,`\\smile `,`&#8995;`),w.sqsubseteq=r(z,`\\sqsubseteq `,`&#8849;`),w.sqsupseteq=r(z,`\\sqsupseteq `,`&#8850;`),w.doteq=r(z,`\\doteq `,`&#8784;`),w.frown=r(z,`\\frown `,`&#8994;`),w.vdash=r(z,`\\vdash `,`&#8870;`),w.dashv=r(z,`\\dashv `,`&#8867;`),w.nless=r(z,`\\nless `,`&#8814;`),w.ngtr=r(z,`\\ngtr `,`&#8815;`),w.longleftarrow=r(z,`\\longleftarrow `,`&#8592;`),w.longrightarrow=r(z,`\\longrightarrow `,`&#8594;`),w.Longleftarrow=r(z,`\\Longleftarrow `,`&#8656;`),w.Longrightarrow=r(z,`\\Longrightarrow `,`&#8658;`),w.longleftrightarrow=r(z,`\\longleftrightarrow `,`&#8596;`),w.updownarrow=r(z,`\\updownarrow `,`&#8597;`),w.Longleftrightarrow=r(z,`\\Longleftrightarrow `,`&#8660;`),w.Updownarrow=r(z,`\\Updownarrow `,`&#8661;`),w.mapsto=r(z,`\\mapsto `,`&#8614;`),w.nearrow=r(z,`\\nearrow `,`&#8599;`),w.hookleftarrow=r(z,`\\hookleftarrow `,`&#8617;`),w.hookrightarrow=r(z,`\\hookrightarrow `,`&#8618;`),w.searrow=r(z,`\\searrow `,`&#8600;`),w.leftharpoonup=r(z,`\\leftharpoonup `,`&#8636;`),w.rightharpoonup=r(z,`\\rightharpoonup `,`&#8640;`),w.swarrow=r(z,`\\swarrow `,`&#8601;`),w.leftharpoondown=r(z,`\\leftharpoondown `,`&#8637;`),w.rightharpoondown=r(z,`\\rightharpoondown `,`&#8641;`),w.nwarrow=r(z,`\\nwarrow `,`&#8598;`),w.ldots=r(z,`\\ldots `,`&#8230;`),w.cdots=r(z,`\\cdots `,`&#8943;`),w.vdots=r(z,`\\vdots `,`&#8942;`),w.ddots=r(z,`\\ddots `,`&#8945;`),w.surd=r(z,`\\surd `,`&#8730;`),w.triangle=r(z,`\\triangle `,`&#9651;`),w.ell=r(z,`\\ell `,`&#8467;`),w.top=r(z,`\\top `,`&#8868;`),w.flat=r(z,`\\flat `,`&#9837;`),w.natural=r(z,`\\natural `,`&#9838;`),w.sharp=r(z,`\\sharp `,`&#9839;`),w.wp=r(z,`\\wp `,`&#8472;`),w.bot=r(z,`\\bot `,`&#8869;`),w.clubsuit=r(z,`\\clubsuit `,`&#9827;`),w.diamondsuit=r(z,`\\diamondsuit `,`&#9826;`),w.heartsuit=r(z,`\\heartsuit `,`&#9825;`),w.spadesuit=r(z,`\\spadesuit `,`&#9824;`),w.circledot=r(z,`\\circledot `,`&#8857;`),w.middot=r(z,`\\middot `,`&middot;`),w.dottedsquare=r(z,`\\dottedsquare `,`&#11034;`),w.square=r(z,`\\square `,`&#11036;`),w.rectangle=r(z,`\\rectangle `,`&#9647;`),w.oint=r(z,`\\oint `,`&#8750;`),w.bigcap=r(z,`\\bigcap `,`&#8745;`),w.bigcup=r(z,`\\bigcup `,`&#8746;`),w.bigsqcup=r(z,`\\bigsqcup `,`&#8852;`),w.bigvee=r(z,`\\bigvee `,`&#8744;`),w.bigwedge=r(z,`\\bigwedge `,`&#8743;`),w.bigodot=r(z,`\\bigodot `,`&#8857;`),w.bigotimes=r(z,`\\bigotimes `,`&#8855;`),w.bigoplus=r(z,`\\bigoplus `,`&#8853;`),w.biguplus=r(z,`\\biguplus `,`&#8846;`),w.lfloor=r(z,`\\lfloor `,`&#8970;`),w.rfloor=r(z,`\\rfloor `,`&#8971;`),w.lceil=r(z,`\\lceil `,`&#8968;`),w.rceil=r(z,`\\rceil `,`&#8969;`),w.opencurlybrace=w.lbrace=r(z,`\\lbrace `,`{`),w.closecurlybrace=w.rbrace=r(z,`\\rbrace `,`}`),w.lbrack=r(z,`[`),w.rbrack=r(z,`]`),w.mug=r(z,`\\mug `,`µg`),w.mus=r(z,`\\mus `,`µs`),w.mum=r(z,`\\mum `,`µm`),w.muL=r(z,`\\muL `,`µL`),w.slash=r(z,`/`),w.vert=r(z,`|`),w.perp=w.perpendicular=r(z,`\\perp `,`&perp;`),w.nabla=w.del=r(z,`\\nabla `,`&nabla;`),w.hbar=r(z,`\\hbar `,`&#8463;`),w.AA=w.Angstrom=w.angstrom=r(z,`\\text\\AA `,`&#8491;`),w.ring=w.circ=w.circle=r(z,`\\circ `,`&#8728;`),w.bull=w.bullet=r(z,`\\bullet `,`&bull;`),w.setminus=w.smallsetminus=r(z,`\\setminus `,`&#8726;`),w.not=w[`¬`]=w.neg=r(z,`\\neg `,`&not;`),w[`…`]=w.dots=w.ellip=w.hellip=w.ellipsis=w.hellipsis=r(z,`\\dots `,`&hellip;`),w.converges=w.darr=w.dnarr=w.dnarrow=w.downarrow=r(z,`\\downarrow `,`&darr;`),w.dArr=w.dnArr=w.dnArrow=w.Downarrow=r(z,`\\Downarrow `,`&dArr;`),w.diverges=w.uarr=w.uparrow=r(z,`\\uparrow `,`&uarr;`),w.uArr=w.Uparrow=r(z,`\\Uparrow `,`&uArr;`),w.to=r(B,`\\to `,`&rarr;`),w.rarr=w.rightarrow=r(z,`\\rightarrow `,`&rarr;`),w.implies=r(B,`\\Rightarrow `,`&rArr;`),w.rArr=w.Rightarrow=r(z,`\\Rightarrow `,`&rArr;`),w.gets=r(B,`\\gets `,`&larr;`),w.larr=w.leftarrow=r(z,`\\leftarrow `,`&larr;`),w.impliedby=r(B,`\\Leftarrow `,`&lArr;`),w.lArr=w.Leftarrow=r(z,`\\Leftarrow `,`&lArr;`),w.harr=w.lrarr=w.leftrightarrow=r(z,`\\leftrightarrow `,`&harr;`),w.iff=r(B,`\\Leftrightarrow `,`&hArr;`),w.hArr=w.lrArr=w.Leftrightarrow=r(z,`\\Leftrightarrow `,`&hArr;`),w.Re=w.Real=w.real=r(z,`\\Re `,`&real;`),w.Im=w.imag=w.image=w.imagin=w.imaginary=w.Imaginary=r(z,`\\Im `,`&image;`),w.part=w.partial=r(z,`\\partial `,`&part;`),w.infty=w.infin=w.infinity=r(z,`\\infty `,`&infin;`),w.pounds=r(z,`\\pounds `,`&pound;`),w.alef=w.alefsym=w.aleph=w.alephsym=r(z,`\\aleph `,`&alefsym;`),w.xist=w.xists=w.exist=w.exists=r(z,`\\exists `,`&exist;`),w.nexists=w.nexist=r(z,`\\nexists `,`&#8708;`),w.and=w.land=w.wedge=r(B,`\\wedge `,`&and;`),w.or=w.lor=w.vee=r(B,`\\vee `,`&or;`),w.o=w.O=w.empty=w.emptyset=w.oslash=w.Oslash=w.nothing=w.varnothing=r(B,`\\varnothing `,`&empty;`),w.cup=w.union=r(B,`\\cup `,`&cup;`),w.cap=w.intersect=w.intersection=r(B,`\\cap `,`&cap;`),w.deg=w.degree=r(z,`\\degree `,`&deg;`),w.ang=w.angle=r(z,`\\angle `,`&ang;`),w.measuredangle=r(z,`\\measuredangle `,`m&ang;`),de=_(z,function(e,t){e.createLeftOf=function(e){e.options.autoSubscriptNumerals&&e.parent!==e.parent.parent.sub&&(e[v]instanceof H&&!1!==e[v].isItalic||e[v]instanceof Be&&e[v][v]instanceof H&&!1!==e[v][v].isItalic)?(w._().createLeftOf(e),t.createLeftOf.call(this,e),e.insRightOf(e.parent.parent)):t.createLeftOf.call(this,e)}}),H=_(ae,function(e,t){e.init=function(e,n){t.init.call(this,e,`<var>`+(n||e)+`</var>`)},e.text=function(){var e=this.ctrlSeq;return this.isPartOfOperator?e[0]==`\\`?e=e.slice(1,e.length):e[e.length-1]==` `&&(e=e.slice(0,-1)):(!this[v]||this[v]instanceof H||this[v]instanceof B||this[v].ctrlSeq===`\\ `||(e=`*`+e),!this[y]||this[y]instanceof B||this[y]instanceof Be||(e+=`*`)),e}}),j.p.autoCommands={_maxLength:0},M.autoCommands=function(e){var t,n,r,i,a;if(!/^[a-z]+(?: [a-z]+)*$/i.test(e))throw`"`+e+`" not a space-delimited list of only letters`;for(t=e.split(` `),n={},r=0,i=0;i<t.length;i+=1){if(a=t[i],a.length<2)throw`autocommand "`+a+`" not minimum length of 2`;if(w[a]===ge)throw`"`+a+`" is a built-in operator name`;n[a]=1,r=at(r,a.length)}return n._maxLength=r,n},fe=_(H,function(e,t){function n(e){return!e||e instanceof B||e instanceof He}e.init=function(e){return t.init.call(this,this.letter=e)},e.createLeftOf=function(e){var n,r,i,a,o;if(t.createLeftOf.apply(this,arguments),n=e.options.autoCommands,r=n._maxLength,r>0){for(i=``,a=this,o=0;a instanceof fe&&a.ctrlSeq===a.letter&&o<r;)i=a.letter+i,a=a[v],o+=1;for(;i.length;){if(n.hasOwnProperty(i)){for(o=1,a=this;o<i.length;o+=1,a=a[v]);return C(a,this).remove(),e[v]=a[v],w[i](i).createLeftOf(e)}i=i.slice(1)}}},e.italicize=function(e){return this.isItalic=e,this.isPartOfOperator=!e,this.jQ.toggleClass(`mq-operator-name`,!e),this},e.finalizeTree=e.siblingDeleted=e.siblingCreated=function(e,t){t!==v&&this[y]instanceof fe||this.autoUnItalicize(e)},e.autoUnItalicize=function(e){var t,r,i,a,o,s,c,l,u,d,f,p,m=e.autoOperatorNames;if(m._maxLength!==0){for(t=this.letter,r=this[v];r instanceof fe;r=r[v])t=r.letter+t;for(i=this[y];i instanceof fe;i=i[y])t+=i.letter;C(r[y]||this.parent.ends[v],i[v]||this.parent.ends[y]).each(function(e){e.italicize(!0).jQ.removeClass(`mq-first mq-last mq-followed-by-supsub`),e.ctrlSeq=e.letter});t:for(a=0,o=r[y]||this.parent.ends[v];a<t.length;a+=1,o=o[y])for(s=it(m._maxLength,t.length-a);s>0;--s)if(c=t.slice(a,a+s),m.hasOwnProperty(c)){for(l=0,u=o;l<s;l+=1,u=u[y])u.italicize(!1),d=u;f=pe.hasOwnProperty(c),o.ctrlSeq=(f?`\\`:`\\operatorname{`)+o.ctrlSeq,d.ctrlSeq+=f?` `:`}`,he.hasOwnProperty(c)&&d[v][v][v].jQ.addClass(`mq-last`),n(o[v])||o.jQ.addClass(`mq-first`),n(d[y])||(d[y]instanceof Be?(p=d[y],(p.siblingCreated=p.siblingDeleted=function(){p.jQ.toggleClass(`mq-after-operator-name`,!(p[y]instanceof Je))})()):d.jQ.toggleClass(`mq-last`,!(d[y]instanceof Je))),a+=s-1,o=d;continue t}}}}),pe={},me=j.p.autoOperatorNames={_maxLength:9},he={limsup:1,liminf:1,projlim:1,injlim:1},function(){var e,t,n,r,i=`arg deg det dim exp gcd hom inf ker lg ln log max min sup limsup liminf injlim projlim Pr`.split(` `);for(e=0;e<i.length;e+=1)pe[i[e]]=me[i[e]]=1;for(t=`sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth`.split(` `),e=0;e<t.length;e+=1)pe[t[e]]=1;for(n=`sin cos tan sec cosec csc cotan cot ctg`.split(` `),e=0;e<n.length;e+=1)me[n[e]]=me[`arc`+n[e]]=me[n[e]+`h`]=me[`ar`+n[e]+`h`]=me[`arc`+n[e]+`h`]=1;for(r=`gcf hcf lcm proj span`.split(` `),e=0;e<r.length;e+=1)me[r[e]]=1}(),M.autoOperatorNames=function(e){var t,n,r,i,a;if(!/^[a-z]+(?: [a-z]+)*$/i.test(e))throw`"`+e+`" not a space-delimited list of only letters`;for(t=e.split(` `),n={},r=0,i=0;i<t.length;i+=1){if(a=t[i],a.length<2)throw`"`+a+`" not minimum length of 2`;n[a]=1,r=at(r,a.length)}return n._maxLength=r,n},ge=_(ae,function(e,t){e.init=function(e){this.ctrlSeq=e},e.createLeftOf=function(e){var t,n=this.ctrlSeq;for(t=0;t<n.length;t+=1)fe(n.charAt(t)).createLeftOf(e)},e.parser=function(){var e,t=this.ctrlSeq,n=oe();for(e=0;e<t.length;e+=1)fe(t.charAt(e)).adopt(n,n.ends[y],0);return I.succeed(n.children())}}),me)me.hasOwnProperty(U)&&(w[U]=ge);for(Ae in w.operatorname=_(R,function(t){t.createLeftOf=e,t.numBlocks=function(){return 1},t.parser=function(){return ie.block.map(function(e){return e.children()})}}),w.f=_(fe,function(e,t){e.init=function(){ae.p.init.call(this,this.letter=`f`,`<var class="mq-f">f</var>`)},e.italicize=function(e){return this.jQ.html(`f`).toggleClass(`mq-f`,e),t.italicize.apply(this,arguments)}}),w[` `]=w.space=r(z,`\\ `,`&nbsp;`),w[`'`]=w.prime=r(z,`'`,`&prime;`),w[`″`]=w.dprime=r(z,`″`,`&Prime;`),w[`"`]=w.doublePrime=r(z,`"`,`&Prime;`),w.backslash=r(z,`\\backslash `,`\\`),T[`\\`]||=w.backslash,w.$=r(z,`\\$`,`$`),_e=_(ae,function(e,t){e.init=function(e,n){t.init.call(this,e,`<span class="mq-nonSymbola">`+(n||e)+`</span>`)}}),w[`@`]=_e,w[`&`]=r(_e,`\\&`,`&amp;`),w[`%`]=r(_e,`\\%`,`%`),w.alpha=w.beta=w.gamma=w.delta=w.zeta=w.eta=w.theta=w.iota=w.kappa=w.mu=w.nu=w.xi=w.rho=w.sigma=w.tau=w.chi=w.psi=w.omega=_(H,function(e,t){e.init=function(e){t.init.call(this,`\\`+e+` `,`&`+e+`;`)}}),w.phi=r(H,`\\phi `,`&#981;`),w.phiv=w.varphi=r(H,`\\varphi `,`&phi;`),w.epsilon=r(H,`\\epsilon `,`&#1013;`),w.epsiv=w.varepsilon=r(H,`\\varepsilon `,`&epsilon;`),w.piv=w.varpi=r(H,`\\varpi `,`&piv;`),w.sigmaf=w.sigmav=w.varsigma=r(H,`\\varsigma `,`&sigmaf;`),w.thetav=w.vartheta=w.thetasym=r(H,`\\vartheta `,`&thetasym;`),w.upsilon=w.upsi=r(H,`\\upsilon `,`&upsilon;`),w.gammad=w.Gammad=w.digamma=r(H,`\\digamma `,`&#989;`),w.kappav=w.varkappa=r(H,`\\varkappa `,`&#1008;`),w.rhov=w.varrho=r(H,`\\varrho `,`&#1009;`),w.pi=w.π=r(_e,`\\pi `,`&pi;`),w.lambda=r(_e,`\\lambda `,`&lambda;`),w.Upsilon=w.Upsi=w.upsih=w.Upsih=r(ae,`\\Upsilon `,`<var style="font-family: serif">&upsih;</var>`),w.Gamma=w.Delta=w.Theta=w.Lambda=w.Xi=w.Pi=w.Sigma=w.Phi=w.Psi=w.Omega=_(z,function(e,t){e.init=function(e){t.init.call(this,`\\`+e+` `,`&`+e+`;`)}}),w.forall=w[`∀`]=r(z,`\\forall `,`&#8704;`),ve=_(R,function(e){e.init=function(e){this.latex=e},e.createLeftOf=function(e){var t=ie.parse(this.latex);t.children().adopt(e.parent,e[v],e[y]),e[v]=t.ends[y],t.jQize().insertBefore(e.jQ),t.finalizeInsert(e.options,e),t.ends[y][y].siblingCreated&&t.ends[y][y].siblingCreated(e.options,v),t.ends[v][v].siblingCreated&&t.ends[v][v].siblingCreated(e.options,y),e.parent.bubble(`reflow`)},e.parser=function(){var e=ie.parse(this.latex).children();return I.succeed(e)}}),w[`¹`]=r(ve,`^1`),w[`²`]=r(ve,`^2`),w[`³`]=r(ve,`^3`),w[`¼`]=r(ve,`\\frac14`),w[`½`]=r(ve,`\\frac12`),w[`¾`]=r(ve,`\\frac34`),ye=_(B,function(e){e.init=z.prototype.init,e.contactWeld=e.siblingCreated=e.siblingDeleted=function(e,t){function n(e){return e[v]?e[v]instanceof B||/^[,;:\(\[]$/.test(e[v].ctrlSeq)?``:`mq-binary-operator`:e.parent&&e.parent.parent&&e.parent.parent.isStyleBlock()?n(e.parent.parent):``}if(t!==y)return this.jQ[0].className=n(this),this}}),w[`+`]=r(ye,`+`,`+`),w[`–`]=w[`-`]=r(ye,`-`,`&minus;`),w[`±`]=w.pm=w.plusmn=w.plusminus=r(ye,`\\pm `,`&plusmn;`),w.mp=w.mnplus=w.minusplus=r(ye,`\\mp `,`&#8723;`),T[`*`]=w.sdot=w.cdot=r(B,`\\cdot `,`&middot;`,`*`),be=_(B,function(e,t){e.init=function(e,n){this.data=e,this.strict=n;var r=n?`Strict`:``;t.init.call(this,e[`ctrlSeq`+r],e[`html`+r],e[`text`+r])},e.swap=function(e){this.strict=e;var t=e?`Strict`:``;this.ctrlSeq=this.data[`ctrlSeq`+t],this.jQ.html(this.data[`html`+t]),this.textTemplate=[this.data[`text`+t]]},e.deleteTowards=function(e,n){if(e===v&&!this.strict)return this.swap(!0),void this.bubble(`reflow`);t.deleteTowards.apply(this,arguments)}}),xe={ctrlSeq:`\\le `,html:`&le;`,text:`≤`,ctrlSeqStrict:`<`,htmlStrict:`&lt;`,textStrict:`<`},Se={ctrlSeq:`\\ge `,html:`&ge;`,text:`≥`,ctrlSeqStrict:`>`,htmlStrict:`&gt;`,textStrict:`>`},w[`<`]=w.lt=r(be,xe,!0),w[`>`]=w.gt=r(be,Se,!0),w[`≤`]=w.le=w.leq=r(be,xe,!1),w[`≥`]=w.ge=w.geq=r(be,Se,!1),Ce=_(B,function(e,t){e.init=function(){t.init.call(this,`=`,`=`)},e.createLeftOf=function(e){if(e[v]instanceof be&&e[v].strict)return e[v].swap(!1),void e[v].bubble(`reflow`);t.createLeftOf.apply(this,arguments)}}),w[`=`]=Ce,w[`×`]=w.times=r(B,`\\times `,`&times;`,`[x]`),w[`÷`]=w.div=w.divide=w.divides=r(B,`\\div `,`&divide;`,`[/]`),T[`~`]=w.sim=r(B,`\\sim `,`~`,`~`),T[`≁`]=w.nsim=r(B,`\\nsim `,`≁`,`≁`),w.complement=w[`∁`]=r(z,`\\complement `,`&#8705;`),w.nexists=w[`∄`]=r(z,`\\nexists `,`&#8708;`),w.sphericalangle=w[`∢`]=r(z,`\\sphericalangle `,`&#8738;`),w.iint=w[`∬`]=r(z,`\\iint `,`&#8748;`),w.iiint=w[`∭`]=r(z,`\\iiint `,`&#8749;`),w.oiint=w[`∯`]=r(z,`\\oiint `,`&#8751;`),w.oiiint=w[`∰`]=r(z,`\\oiiint `,`&#8752;`),w.backsim=w[`∽`]=r(z,`\\backsim `,`&#8765;`),w.backsimeq=w[`⋍`]=r(z,`\\backsimeq `,`&#8909;`),w.eqsim=w[`≂`]=r(z,`\\eqsim `,`&#8770;`),w.ncong=w[`≇`]=r(z,`\\ncong `,`&#8775;`),w.approxeq=w[`≊`]=r(z,`\\approxeq `,`&#8778;`),w.bumpeq=w[`≏`]=r(z,`\\bumpeq `,`&#8783;`),w.Bumpeq=w[`≎`]=r(z,`\\Bumpeq `,`&#8782;`),w.doteqdot=w[`≑`]=r(z,`\\doteqdot `,`&#8785;`),w.fallingdotseq=w[`≒`]=r(z,`\\fallingdotseq `,`&#8786;`),w.risingdotseq=w[`≓`]=r(z,`\\risingdotseq `,`&#8787;`),w.eqcirc=w[`≖`]=r(z,`\\eqcirc `,`&#8790;`),w.circeq=w[`≗`]=r(z,`\\circeq `,`&#8791;`),w.triangleq=w[`≜`]=r(z,`\\triangleq `,`&#8796;`),w.leqq=w[`≦`]=r(z,`\\leqq `,`&#8806;`),w.geqq=w[`≧`]=r(z,`\\geqq `,`&#8807;`),w.lneqq=w[`≨`]=r(z,`\\lneqq `,`&#8808;`),w.gneqq=w[`≩`]=r(z,`\\gneqq `,`&#8809;`),w.between=w[`≬`]=r(z,`\\between `,`&#8812;`),w.nleq=w[`≰`]=r(z,`\\nleq `,`&#8816;`),w.ngeq=w[`≱`]=r(z,`\\ngeq `,`&#8817;`),w.lesssim=w[`≲`]=r(z,`\\lesssim `,`&#8818;`),w.gtrsim=w[`≳`]=r(z,`\\gtrsim `,`&#8819;`),w.lessgtr=w[`≶`]=r(z,`\\lessgtr `,`&#8822;`),w.gtrless=w[`≷`]=r(z,`\\gtrless `,`&#8823;`),w.preccurlyeq=w[`≼`]=r(z,`\\preccurlyeq `,`&#8828;`),w.succcurlyeq=w[`≽`]=r(z,`\\succcurlyeq `,`&#8829;`),w.precsim=w[`≾`]=r(z,`\\precsim `,`&#8830;`),w.succsim=w[`≿`]=r(z,`\\succsim `,`&#8831;`),w.nprec=w[`⊀`]=r(z,`\\nprec `,`&#8832;`),w.nsucc=w[`⊁`]=r(z,`\\nsucc `,`&#8833;`),w.subsetneq=w[`⊊`]=r(z,`\\subsetneq `,`&#8842;`),w.supsetneq=w[`⊋`]=r(z,`\\supsetneq `,`&#8843;`),w.vDash=w[`⊨`]=r(z,`\\vDash `,`&#8872;`),w.Vdash=w[`⊩`]=r(z,`\\Vdash `,`&#8873;`),w.Vvdash=w[`⊪`]=r(z,`\\Vvdash `,`&#8874;`),w.VDash=w[`⊫`]=r(z,`\\VDash `,`&#8875;`),w.nvdash=w[`⊬`]=r(z,`\\nvdash `,`&#8876;`),w.nvDash=w[`⊭`]=r(z,`\\nvDash `,`&#8877;`),w.nVdash=w[`⊮`]=r(z,`\\nVdash `,`&#8878;`),w.nVDash=w[`⊯`]=r(z,`\\nVDash `,`&#8879;`),w.vartriangleleft=w[`⊲`]=r(z,`\\vartriangleleft `,`&#8882;`),w.vartriangleright=w[`⊳`]=r(z,`\\vartriangleright `,`&#8883;`),w.trianglelefteq=w[`⊴`]=r(z,`\\trianglelefteq `,`&#8884;`),w.trianglerighteq=w[`⊵`]=r(z,`\\trianglerighteq `,`&#8885;`),w.multimap=w[`⊸`]=r(z,`\\multimap `,`&#8888;`),w.Subset=w[`⋐`]=r(z,`\\Subset `,`&#8912;`),w.Supset=w[`⋑`]=r(z,`\\Supset `,`&#8913;`),w.Cap=w[`⋒`]=r(z,`\\Cap `,`&#8914;`),w.Cup=w[`⋓`]=r(z,`\\Cup `,`&#8915;`),w.pitchfork=w[`⋔`]=r(z,`\\pitchfork `,`&#8916;`),w.lessdot=w[`⋖`]=r(z,`\\lessdot `,`&#8918;`),w.gtrdot=w[`⋗`]=r(z,`\\gtrdot `,`&#8919;`),w.lll=w[`⋘`]=r(z,`\\lll `,`&#8920;`),w.ggg=w[`⋙`]=r(z,`\\ggg `,`&#8921;`),w.lesseqgtr=w[`⋚`]=r(z,`\\lesseqgtr `,`&#8922;`),w.gtreqless=w[`⋛`]=r(z,`\\gtreqless `,`&#8923;`),w.curlyeqprec=w[`⋞`]=r(z,`\\curlyeqprec `,`&#8926;`),w.curlyeqsucc=w[`⋟`]=r(z,`\\curlyeqsucc `,`&#8927;`),w.nsim=w[`≁`]=r(z,`\\nsim `,`&#8769;`),w.lnsim=w[`⋦`]=r(z,`\\lnsim `,`&#8934;`),w.gnsim=w[`⋧`]=r(z,`\\gnsim `,`&#8935;`),w.precnsim=w[`⋨`]=r(z,`\\precnsim `,`&#8936;`),w.succnsim=w[`⋩`]=r(z,`\\succnsim `,`&#8937;`),w.ntriangleleft=w[`⋪`]=r(z,`\\ntriangleleft `,`&#8938;`),w.ntriangleright=w[`⋫`]=r(z,`\\ntriangleright `,`&#8939;`),w.ntrianglelefteq=w[`⋬`]=r(z,`\\ntrianglelefteq `,`&#8940;`),w.ntrianglerighteq=w[`⋭`]=r(z,`\\ntrianglerighteq `,`&#8941;`),w.blacksquare=w[`∎`]=r(z,`\\blacksquare `,`&#8718;`),w.colon=w[`∶`]=r(z,`\\colon `,`&#8758;`),w.llcorner=w[`∟`]=r(z,`\\llcorner `,`&#8735;`),w.dotplus=w[`∔`]=r(B,`\\dotplus `,`&#8724;`),w.nmid=w[`∤`]=r(B,`
314
- mid `,`&#8740;`),w.intercal=w[`⊺`]=r(B,`\\intercal `,`&#8890;`),w.veebar=w[`⊻`]=r(B,`\\veebar `,`&#8891;`),w.barwedge=w[`⊼`]=r(B,`\\barwedge `,`&#8892;`),w.ltimes=w[`⋉`]=r(B,`\\ltimes `,`&#8905;`),w.rtimes=w[`⋊`]=r(B,`\\rtimes `,`&#8906;`),w.leftthreetimes=w[`⋋`]=r(B,`\\leftthreetimes `,`&#8907;`),w.rightthreetimes=w[`⋌`]=r(B,`\\rightthreetimes `,`&#8908;`),w.curlyvee=w[`⋎`]=r(B,`\\curlyvee `,`&#8910;`),w.curlywedge=w[`⋏`]=r(B,`\\curlywedge `,`&#8911;`),w.circledcirc=w[`⊚`]=r(B,`\\circledcirc `,`&#8858;`),w.circledast=w[`⊛`]=r(B,`\\circledast `,`&#8859;`),w.circleddash=w[`⊝`]=r(B,`\\circleddash `,`&#8861;`),w.boxplus=w[`⊞`]=r(B,`\\boxplus `,`&#8862;`),w.boxminus=w[`⊟`]=r(B,`\\boxminus `,`&#8863;`),w.boxtimes=w[`⊠`]=r(B,`\\boxtimes `,`&#8864;`),w.boxdot=w[`⊡`]=r(B,`\\boxdot `,`&#8865;`),w[`∂`]=w.partial,w[`∃`]=w.exists,w[`∅`]=w.varnothing,w[`∆`]=w.triangle,w[`∇`]=w.nabla,w[`∈`]=w.in,w[`∊`]=w.in,w[`∋`]=w.ni,w[`∌`]=w.notni,w[`∍`]=w.ni,w[`∐`]=w.amalg,w[`−`]=w[`-`],w[`∓`]=w.mp,w[`∖`]=w.setminus,w[`∘`]=w.circ,w[`∙`]=w.bullet,w[`∝`]=w.propto,w[`∞`]=w.infty,w[`∠`]=w.angle,w[`∡`]=w.measuredangle,w[`∣`]=w.divides,w[`∥`]=w.parallel,w[`∦`]=w.nparallel,w[`∧`]=w.wedge,w[`∨`]=w.vee,w[`∩`]=w.cap,w[`∪`]=w.cup,w[`∮`]=w.oint,w[`∴`]=w.therefore,w[`∵`]=w.because,w[`∼`]=w.sim,w[`≀`]=w.wr,w[`≃`]=w.simeq,w[`≍`]=w.asymp,w[`≐`]=w.doteq,w[`≪`]=w.ll,w[`≫`]=w.gg,w[`≺`]=w.prec,w[`≻`]=w.succ,w[`⊂`]=w.subset,w[`⊃`]=w.supset,w[`⊆`]=w.subseteq,w[`⊇`]=w.supseteq,w[`⊈`]=w.nsubseteq,w[`⊉`]=w.nsupseteq,w[`⊏`]=w.sqsubset,w[`⊐`]=w.sqsupset,w[`⊓`]=w.sqcap,w[`⊔`]=w.sqcup,w[`⊖`]=w.ominus,w[`⊘`]=w.oslash,w[`⊙`]=w.odot,w[`⊢`]=w.vdash,w[`⊣`]=w.dashv,w[`⊤`]=w.top,w[`⊥`]=w.bot,w[`⊧`]=w.models,w[`⋀`]=w.wedge,w[`⋁`]=w.vee,w[`⋂`]=w.cap,w[`⋃`]=w.cup,w[`⋄`]=w.diamond,w[`⋅`]=w.cdot,w[`⋆`]=w.star,w[`⋈`]=w.bowtie,w[`⋮`]=w.vdots,w[`⋯`]=w.cdots,w[`⋱`]=w.ddots,Te=e,Ee=document.createElement(`div`),De=Ee.style,Oe={transform:1,WebkitTransform:1,MozTransform:1,OTransform:1,msTransform:1},Oe)if(Ae in De){ke=Ae;break}for(et in ke?we=function(e,t,n){e.css(ke,`scale(`+t+`,`+n+`)`)}:`filter`in De?(Te=function(e){e.className=e.className},we=function(e,t,n){function r(){e.css(`marginRight`,(i.width()-1)*(t-1)/t+`px`)}var i,a;t/=1+(n-1)/2,e.css(`fontSize`,n+`em`),e.hasClass(`mq-matrixed-container`)||e.addClass(`mq-matrixed-container`).wrapInner(`<span class="mq-matrixed"></span>`),i=e.children().css(`filter`,`progid:DXImageTransform.Microsoft.Matrix(M11=`+t+`,SizingMethod='auto expand')`),r(),a=setInterval(r),b(window).load(function(){clearTimeout(a),r()})}):we=function(e,t,n){e.css(`fontSize`,n+`em`)},je=_(R,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<`+n+` `+r+`>&0</`+n+`>`)}}),Me=_(R,function(e,t){e.init=function(e,n,r){this.args=arguments,this.htmlTemplate=`<`+n+` `+r+`><`+n+` class="mq-xarrow-over">&0</`+n+`><`+n+` class="mq-xarrow-under"></`+n+`></`+n+`>`,t.init.call(this,e),this.textTemplate=[e.replace(`\\`,``)+`(`,`)`]},e.parser=function(){var e=this;return ie.optBlock.then(function(t){return ie.block.map(function(n){var r=Ne.apply(null,e.args);return r.blocks=[t,n],t.adopt(r,0,0),n.adopt(r,t,0),r})}).or(t.parser.call(this))}}),Ne=_(Me,function(e,t){e.init=function(e,t,n){this.htmlTemplate=`<`+t+` `+n+`><`+t+` class="mq-xarrow-over">&1</`+t+`><`+t+` class="mq-xarrow-under">&0</`+t+`></`+t+`>`,R.prototype.init.call(this,e),this.textTemplate=[e.replace(`\\`,``)+`[`,`](`,`)`]},e.latex=function(){return this.ctrlSeq+`[`+this.ends[v].latex()+`]{`+this.ends[y].latex()+`}`},e.finalizeTree=function(){this.downInto=this.ends[v].upOutOf=this.ends[y],this.upInto=this.ends[y].downOutOf=this.ends[v]}}),Pe=function(e){var t=`<span class="`+e+`-inner-right">g</span><span class="`+e+`-inner-left">h</span>`;return _(R,function(n,r){n.init=function(n,i,a){r.init.call(this,n,`<`+i+` `+a+`><`+i+` class="`+e+`-inner">`+t+`<span class="mq-empty-box">&0</span></`+i+`></`+i+`>`)}})},Fe=_(R,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<`+n+` `+r+`><span class="mq-longdiv-curve-border">)</span><span class="mq-longdiv-inner"><span class="mq-empty">&0</span></`+n+`></span>`)}}),Ie=_(R,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-matrix"><span class="mq-paren mq-scaled">[</span><span class="matrix-edit-content-row"><p>`+r+`</p><table class="mq-non-leaf mq-rows-3"><tbody><tr><td class="mq-empty"></td><td class="mq-empty"></td><td class="mq-empty"></td></tr></tbody></table></span><span class="mq-paren mq-scaled">]</span></span>`)}}),Le=_(R,function(e,t){e.init=function(e){t.init.call(this,e,`<span class="mq-non-leaf"><span class="mq-dot-recurring-inner"><span class="mq-dot-recurring">&#x2d9;</span><span class="mq-empty-box">&0</span></span></span>`)}}),Re=_(R,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-matrix"><span class="mq-paren mq-scaled">[</span><span class="matrix-edit-content-col"><p>`+r+`</p></span><span class="matrix-edit-content-col"><table class="mq-non-leaf mq-rows-3"><tbody><tr><td class="mq-empty"></td></tr><tr><td class="mq-empty"></td></tr><tr><td class="mq-empty"></td></tr></tbody></table></span><span class="mq-paren mq-scaled">]</span></span>`)}}),ze=function(e,t){return _(ae,function(n,r){n.init=function(n,i,a){r.init.call(this,n,`<`+i+` `+a+`><`+i+` class="`+e+`-inner">`+t+`</`+i+`></`+i+`>`)}})},w.mathrm=r(je,`\\mathrm`,`span`,`class="mq-roman mq-font"`),w.mathit=r(je,`\\mathit`,`i`,`class="mq-font"`),w.mathbf=r(je,`\\mathbf`,`b`,`class="mq-font"`),w.mathsf=r(je,`\\mathsf`,`span`,`class="mq-sans-serif mq-font"`),w.mathtt=r(je,`\\mathtt`,`span`,`class="mq-monospace mq-font"`),w.underline=r(je,`\\underline`,`span`,`class="mq-non-leaf mq-underline"`),w.overline=w.bar=r(Pe(`mq-overline`),`\\overline`,`span`,`class="mq-non-leaf mq-overline"`),w.longdiv=r(Fe,`\\longdiv`,`span`,`class="mq-non-leaf mq-longdiv"`),w.overrightarrow=r(Pe(`mq-overarrow`),`\\overrightarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-right"`),w.overleftarrow=r(Pe(`mq-overarrow`),`\\overleftarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-left"`),w.xleftarrow=r(Me,`\\xleftarrow`,`span`,`class="mq-non-leaf mq-xarrow mq-arrow-left"`),w.xrightarrow=r(Me,`\\xrightarrow`,`span`,`class="mq-non-leaf mq-xarrow mq-arrow-right"`),w.overleftrightarrow=r(je,`\\overleftrightarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-both"`),w.overarc=r(je,`\\overarc`,`span`,`class="mq-non-leaf mq-overarc"`),w.dot=_(R,function(e,t){e.init=function(){t.init.call(this,`\\dot`,`<span class="mq-non-leaf"><span class="mq-dot-recurring-inner"><span class="mq-dot-recurring">&#x2d9;</span><span class="mq-empty-box">&0</span></span></span>`)}}),w.addmatrixrow=r(Ie,`\\addmatrixrow`,`span`,`+`),w.addmatrixcol=r(Re,`\\addmatrixcol`,`span`,`+`),w.ngtr=w[`≯`]=r(ze(`mq-ngtr`,`&#8815;`),`\\ngtr `,`span`,`class="mq-non-leaf mq-ngtr"`),w.nless=w[`≮`]=r(ze(`mq-nless`,`&#8814;`),`\\nless `,`span`,`class="mq-non-leaf mq-nless"`),w.dot=r(Le,`\\dot`),w.parallelogram=r(ze(`mq-parallelogram`,`&#9649;`),`\\parallelogram `,`span`,`class="mq-non-leaf mq-parallelogram"`),w.textcolor=_(R,function(e,t){e.setColor=function(e){this.color=e,this.htmlTemplate=`<span class="mq-textcolor" style="color:`+e+`">&0</span>`},e.latex=function(){return`\\textcolor{`+this.color+`}{`+this.blocks[0].latex()+`}`},e.parser=function(){var e=this,n=I.optWhitespace,r=I.string,i=I.regex;return n.then(r(`{`)).then(i(/^[#\w\s.,()%-]*/)).skip(r(`}`)).then(function(n){return e.setColor(n),t.parser.call(e)})},e.isStyleBlock=function(){return!0}}),w.class=_(R,function(e,t){e.parser=function(){var e=this,n=I.string,r=I.regex;return I.optWhitespace.then(n(`{`)).then(r(/^[-\w\s\\\xA0-\xFF]*/)).skip(n(`}`)).then(function(n){return e.cls=n||``,e.htmlTemplate=`<span class="mq-class `+n+`">&0</span>`,t.parser.call(e)})},e.latex=function(){return`\\class{`+this.cls+`}{`+this.blocks[0].latex()+`}`},e.isStyleBlock=function(){return!0}}),Be=_(R,function(e,t){e.ctrlSeq=`_{...}^{...}`,e.createLeftOf=function(e){if(this.replacedFragment||e[v]||!e.options.supSubsRequireOperand)return t.createLeftOf.apply(this,arguments)},e.contactWeld=function(e){var t,n,r,i,a,o;for(t=v;t;t=t===v&&y)if(this[t]instanceof Be){for(n=`sub`;n;n=n===`sub`&&`sup`)r=this[n],i=this[t][n],r&&(i?r.isEmpty()?o=x(i,0,i.ends[v]):(r.jQ.children().insAtDirEnd(-t,i.jQ),a=r.children().disown(),o=x(i,a.ends[y],i.ends[v]),t===v?a.adopt(i,i.ends[y],0):a.adopt(i,0,i.ends[v])):this[t].addBlock(r.disown()),this.placeCursor=function(e,n){return function(r){r.insAtDirEnd(-t,e||n)}}(i,r));this.remove(),e&&e[v]===this&&(t===y&&o?o[v]?e.insRightOf(o[v]):e.insAtLeftEnd(o.parent):e.insRightOf(this[t]));break}},j.p.charsThatBreakOutOfSupSub=``,e.finalizeTree=function(){this.ends[v].write=function(e,t){if(e.options.autoSubscriptNumerals&&this===this.parent.sub){if(t===`_`)return;var n=this.chToCmd(t,e.options);return n instanceof ae?e.deleteSelection():e.clearSelection().insRightOf(this.parent),n.createLeftOf(e.show())}e[v]&&!e[y]&&!e.selection&&e.options.charsThatBreakOutOfSupSub.indexOf(t)>-1&&e.insRightOf(this.parent),oe.p.write.apply(this,arguments)}},e.moveTowards=function(e,n,r){n.options.autoSubscriptNumerals&&!this.sup?n.insDirOf(e,this):t.moveTowards.apply(this,arguments)},e.deleteTowards=function(e,n){if(n.options.autoSubscriptNumerals&&this.sub){var r=this.sub.ends[-e];r instanceof ae?r.remove():r&&r.deleteTowards(e,n.insAtDirEnd(-e,this.sub)),this.sub.isEmpty()&&(this.sub.deleteOutOf(v,n.insAtLeftEnd(this.sub)),this.sup&&n.insDirOf(-e,this))}else t.deleteTowards.apply(this,arguments)},e.latex=function(){function e(e,t){var n=t&&t.latex();return t?e+`{`+(n||` `)+`}`:``}return e(`_`,this.sub)+e(`^`,this.sup)},e.addBlock=function(e){this.supsub===`sub`?(this.sup=this.upInto=this.sub.upOutOf=e,e.adopt(this,this.sub,0).downOutOf=this.sub,e.jQ=b(`<span class="mq-sup"/>`).append(e.jQ.children()).attr(rt,e.id).prependTo(this.jQ)):(this.sub=this.downInto=this.sup.downOutOf=e,e.adopt(this,0,this.sup).upOutOf=this.sup,e.jQ=b(`<span class="mq-sub"></span>`).append(e.jQ.children()).attr(rt,e.id).appendTo(this.jQ.removeClass(`mq-sup-only`)),this.jQ.append(`<span style="display:inline-block;width:0">&#8203;</span>`));for(var t=0;t<2;t+=1)(function(e,t,n,r){e[t].deleteOutOf=function(i,a){if(a.insDirOf(this[i]?-i:i,this.parent),!this.isEmpty()){var o=this.ends[i];this.children().disown().withDirAdopt(i,a.parent,a[i],a[-i]).jQ.insDirOf(-i,a.jQ),a[-i]=o}e.supsub=n,delete e[t],delete e[r+`Into`],e[n][r+`OutOf`]=f,delete e[n].deleteOutOf,t===`sub`&&b(e.jQ.addClass(`mq-sup-only`)[0].lastChild).remove(),this.remove()}})(this,`sub sup`.split(` `)[t],`sup sub`.split(` `)[t],`down up`.split(` `)[t])},e.reflow=function(){var e,t,n,r,i,a=this.jQ,o=a.prev();o.length&&(e=a.children(`.mq-sup`),e.length&&(t=parseInt(e.css(`font-size`)),n=e.offset().top+e.height(),r=n-o.offset().top-.7*t,i=parseInt(e.css(`margin-bottom`)),e.css(`margin-bottom`,i+r)))}}),w.subscript=w._=_(Be,function(e,t){e.supsub=`sub`,e.htmlTemplate=`<span class="mq-supsub mq-non-leaf"><span class="mq-sub"><span class="mq-empty-box">&0</span></span><span style="display:inline-block;width:0">&#8203;</span></span>`,e.textTemplate=[`_`],e.finalizeTree=function(){this.downInto=this.sub=this.ends[v],this.sub.upOutOf=f,t.finalizeTree.call(this)}}),w.superscript=w.supscript=w[`^`]=_(Be,function(e,t){e.supsub=`sup`,e.htmlTemplate=`<span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`^`],e.finalizeTree=function(){this.upInto=this.sup=this.ends[y],this.sup.downOutOf=f,t.finalizeTree.call(this)}}),Ve=_(R,function(e,t){e.parser=function(){var e,t=I.string,n=I.optWhitespace,r=I.succeed,i=ie.block,a=this,o=a.blocks=[oe(),oe()];for(e=0;e<o.length;e+=1)o[e].adopt(a,a.ends[y],0);return n.then(t(`_`).or(t(`^`))).then(function(e){var t=o[e===`_`?0:1];return i.then(function(e){return e.children().adopt(t,t.ends[y],0),r(a)})}).many().result(a)},e.finalizeTree=function(){this.downInto=this.ends[v],this.upInto=this.ends[y],this.ends[v].upOutOf=this.ends[y],this.ends[y].downOutOf=this.ends[v]}}),He=_(Ve,function(e,t){e.init=function(e,t){var n=`<span class="mq-large-operator mq-non-leaf"><span class="mq-to"><span>&1</span></span><big>`+t+`</big><span class="mq-from"><span>&0</span></span></span>`;ae.prototype.init.call(this,e,n)},e.latex=function(){function e(e){return e.length===1?e:`{`+(e||` `)+`}`}return this.ctrlSeq+`_`+e(this.ends[v].latex())+`^`+e(this.ends[y].latex())},e.createLeftOf=function(e){t.createLeftOf.apply(this,arguments),e.options.sumStartsWithNEquals&&(fe(`n`).createLeftOf(e),Ce().createLeftOf(e))}}),w[`∑`]=w.sum=w.summation=r(He,`\\sum `,`&sum;`),w[`∏`]=w.prod=w.product=r(He,`\\prod `,`&prod;`),w.coprod=w.coproduct=r(He,`\\coprod `,`&#8720;`),w[`∫`]=w.int=w.integral=_(He,function(e,t){e.init=function(){ae.prototype.init.call(this,`\\int `,`<span class="mq-int mq-non-leaf"><big>&int;</big><span class="mq-supsub mq-non-leaf"><span class="mq-sup"><span class="mq-sup-inner">&1</span></span><span class="mq-sub">&0</span><span style="display:inline-block;width:0">&#8203</span></span></span>`)},e.createLeftOf=R.p.createLeftOf}),w.lim=w.limit=_(Ve,function(e,t){e.init=function(){ae.prototype.init.call(this,`\\lim `,`<span class="mq-lim mq-non-leaf"><span class="mq-un-italicized">lim</span><span class="mq-approaches"><span>&0</span></span></span>`)},e.latex=function(){return this.ctrlSeq+`_`+function(e){return e.length===1?e:`{`+(e||` `)+`}`}(this.ends[v].latex())}}),Ue=w.frac=w.dfrac=w.cfrac=w.fraction=_(R,function(e,t){e.ctrlSeq=`\\frac`,e.htmlTemplate=`<span class="mq-fraction mq-non-leaf"><span class="mq-numerator"><span class="mq-empty-box">&0</span></span><span class="mq-denominator"><span class="mq-empty-box">&1</span></span><span style="display:inline-block;width:0">&#8203;</span></span>`,e.textTemplate=[`(`,`)/(`,`)`],e.finalizeTree=function(){this.upInto=this.ends[y].upOutOf=this.ends[v],this.downInto=this.ends[v].downOutOf=this.ends[y]}}),We=w.over=T[`/`]=_(Ue,function(t,n){t.createLeftOf=function(t){if(!this.replacedFragment){for(var r=t[v];r&&!(r instanceof B||r instanceof(w.text||e)||r instanceof He||r.ctrlSeq===`\\ `||/^[,;:]$/.test(r.ctrlSeq));)r=r[v];r instanceof He&&r[y]instanceof Be&&(r=r[y],r[y]instanceof Be&&r[y].ctrlSeq!=r.ctrlSeq&&(r=r[y])),r===t[v]||t.isTooDeep(1)||(this.replaces(C(r[y]||t.parent.ends[v],t[v])),t[v]=r)}n.createLeftOf.call(this,t)}}),w.underset=_(R,function(e,t){e.ctrlSeq=`\\underset`,e.htmlTemplate=`<span class="mq-underset mq-overunder mq-non-leaf"><span class="mq-over">&1</span><span class="mq-under">&0</span></span>`,e.textTemplate=[`[`,`|`,`]`],e.finalizeTree=function(){this.downInto=this.ends[v].upOutOf=this.ends[y],this.upInto=this.ends[y].downOutOf=this.ends[v]}}),w.overset=_(R,function(e,t){e.ctrlSeq=`\\overset`,e.htmlTemplate=`<span class="mq-overset mq-overunder mq-non-leaf"><span class="mq-over">&0</span><span class="mq-under">&1</span></span>`,e.textTemplate=[`[`,`|`,`]`],e.finalizeTree=function(){this.downInto=this.ends[y].upOutOf=this.ends[v],this.upInto=this.ends[v].downOutOf=this.ends[y]}}),Ge=w.sqrt=w[`√`]=_(R,function(e,t){e.ctrlSeq=`\\sqrt`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-scaled mq-sqrt-prefix">&radic;</span><span class="mq-non-leaf mq-sqrt-stem"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`sqrt(`,`)`],e.parser=function(){return ie.optBlock.then(function(e){return ie.block.map(function(t){var n=Ke();return n.blocks=[e,t],e.adopt(n,0,0),t.adopt(n,e,0),n})}).or(t.parser.call(this))},e.reflow=function(){var e=this.ends[y].jQ.parent();we(e.prev(),1,e.innerHeight()/+e.css(`fontSize`).slice(0,-2)-.1)}}),w.hat=_(R,function(e,t){e.ctrlSeq=`\\hat`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-hat-prefix">^</span><span class="mq-hat-stem">&0</span></span>`,e.textTemplate=[`hat(`,`)`]}),Ke=w.nthroot=_(Ge,function(e,t){e.htmlTemplate=`<sup class="mq-nthroot mq-non-leaf"><span class="mq-empty-box">&0</span></sup><span class="mq-scaled"><span class="mq-sqrt-prefix mq-scaled">&radic;</span><span class="mq-sqrt-stem mq-non-leaf"><span class="mq-empty-box">&1</span></span></span>`,e.textTemplate=[`sqrt[`,`](`,`)`],e.latex=function(){return`\\sqrt[`+this.ends[v].latex()+`]{`+this.ends[y].latex()+`}`}}),qe=_(R,function(e,t){e.init=function(e,n,r){var i=`<span class="mq-non-leaf"><span class="mq-diacritic-above">`+n+`</span><span class="mq-diacritic-stem">&0</span></span>`;t.init.call(this,e,i,r)}}),w.vec=r(qe,`\\vec`,`&rarr;`,[`vec(`,`)`]),w.tilde=r(qe,`\\tilde`,`~`,[`tilde(`,`)`]),w.lrncuberoot=_(Ge,function(e,t){e.ctrlSeq=`\\lrncuberoot`,e.htmlTemplate=`<sup class="mq-nthroot mq-non-leaf"><span class="mq-empty-box">3</span></sup><span class="mq-scaled"><span class="mq-sqrt-prefix mq-scaled">&radic;</span><span class="mq-sqrt-stem mq-non-leaf"><span class="mq-empty-box">&0</span></span></span>`,e.textTemplate=[`sqrt[3](`,`)`],e.latex=function(){return`\\sqrt[3]{`+this.ends[v].latex()+`}`}}),w.abs=_(R,function(e){e.ctrlSeq=`\\abs`,e.htmlTemplate=`<span class="mq-abs mq-non-leaf"><span class="mq-empty-box">&0</span></span>`,e.textTemplate=[`|`,`|`]}),w.lrnplaceholder=_(R,function(e,t){e.ctrlSeq=`\\lrnplaceholder`,e.htmlTemplate=`<span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span>`,e.textTemplate=[``],e.latex=function(){return this.ends[v].latex()}}),w.lrnexponent=_(R,function(e,t){e.ctrSeq=`\\lrnexponent`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">&1</span></span></span></span>`,e.textTemplate=[``,`**`],e.latex=function(){var e=this.ends[y].latex();return e.length>1?e=`{`+e+`}`:e.length===0&&(e=`{ }`),this.ends[v].latex()+`^`+e}}),w.lrnsquaredexponent=_(R,function(e,t){e.ctrSeq=`\\lrnsquaredexponent`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf mq-sup-only"><span class="mq-sup"><span class="mq-empty-box">2</span></span></span></span>`,e.textTemplate=[``,`**2`],e.latex=function(){return this.ends[v].latex()+`^2`}}),w.lrnsubscript=_(R,function(e,t){e.ctrSeq=`\\lrnsubscript`,e.htmlTemplate=`<span class="mq-lrnexponent mq-non-leaf"><span class="mq-lrnplaceholder mq-non-leaf"><span class="mq-empty-box">&0</span></span><span class="mq-supsub mq-non-leaf"><span class="mq-sub"><span class="mq-empty-box">&1</span></span><span style="display:inline-block;width:0">&nbsp;</span></span></span>`,e.textTemplate=[``,`_`],e.latex=function(){return this.ends[v].latex()+`_`+this.ends[y].latex()}}),Je=_(_(R,p),function(t,n){t.init=function(e,t,r,i,a){n.init.call(this,`\\left`+i,void 0,[t,r]),this.side=e,this.sides={},this.sides[v]={ch:t,ctrlSeq:i},this.sides[y]={ch:r,ctrlSeq:a}},t.numBlocks=function(){return 1},t.html=function(){return this.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-scaled mq-paren`+(this.side===y?` mq-ghost`:``)+`">`+this.sides[v].ch+`</span><span class="mq-non-leaf">&0</span><span class="mq-scaled mq-paren`+(this.side===v?` mq-ghost`:``)+`">`+this.sides[y].ch+`</span></span>`,n.html.call(this)},t.latex=function(){return`\\left`+this.sides[v].ctrlSeq+this.ends[v].latex()+`\\right`+this.sides[y].ctrlSeq},t.matchBrack=function(e,t,n){return n instanceof Je&&n.side&&n.side!==-t&&(!e.restrictMismatchedBrackets||Ye[this.sides[this.side].ch]===n.sides[n.side].ch||{"(":`]`,"[":`)`}[this.sides[v].ch]===n.sides[y].ch)&&n},t.closeOpposing=function(e){e.side=0,e.sides[this.side]=this.sides[this.side],e.delimjQs.eq(this.side===v?0:1).removeClass(`mq-ghost`).html(this.sides[this.side].ch)},t.createLeftOf=function(e){var t,r,i;this.replacedFragment||(t=e.options,r=this.sides[v].ch===`|`?this.matchBrack(t,y,e[y])||this.matchBrack(t,v,e[v])||this.matchBrack(t,0,e.parent.parent):this.matchBrack(t,-this.side,e[-this.side])||this.matchBrack(t,-this.side,e.parent.parent)),r?(i=this.side=-r.side,this.closeOpposing(r),r===e.parent.parent&&e[i]&&C(e[i],e.parent.ends[i],-i).disown().withDirAdopt(-i,r.parent,r,r[i]).jQ.insDirOf(i,r.jQ),r.bubble(`reflow`)):(r=this,i=r.side,r.replacedFragment?r.side=0:e[-i]&&(r.replaces(C(e[-i],e.parent.ends[-i],i)),e[-i]=0),n.createLeftOf.call(r,e)),i===v?e.insAtLeftEnd(r.ends[v]):e.insRightOf(r)},t.placeCursor=e,t.unwrap=function(){this.ends[v].children().disown().adopt(this.parent,this,this[y]).jQ.insertAfter(this.jQ),this.remove()},t.deleteSide=function(e,t,n){var r,i,a,o=this.parent,s=this[e],c=o.ends[e];if(e===this.side)return this.unwrap(),void(s?n.insDirOf(-e,s):n.insAtDirEnd(e,o));if(r=n.options,i=!this.side,this.side=-e,this.matchBrack(r,e,this.ends[v].ends[this.side]))this.closeOpposing(this.ends[v].ends[this.side]),a=this.ends[v].ends[e],this.unwrap(),a.siblingCreated&&a.siblingCreated(n.options,e),s?n.insDirOf(-e,s):n.insAtDirEnd(e,o);else{if(this.matchBrack(r,e,this.parent.parent))this.parent.parent.closeOpposing(this),this.parent.parent.unwrap();else{if(t&&i)return this.unwrap(),void(s?n.insDirOf(-e,s):n.insAtDirEnd(e,o));this.sides[e]={ch:Ye[this.sides[this.side].ch],ctrlSeq:Ye[this.sides[this.side].ctrlSeq]},this.delimjQs.removeClass(`mq-ghost`).eq(e===v?0:1).addClass(`mq-ghost`).html(this.sides[e].ch)}s?(a=this.ends[v].ends[e],C(s,c,-e).disown().withDirAdopt(-e,this.ends[v],a,0).jQ.insAtDirEnd(e,this.ends[v].jQ.removeClass(`mq-empty`)),a.siblingCreated&&a.siblingCreated(n.options,e),n.insDirOf(-e,s)):t?n.insDirOf(e,this):n.insAtDirEnd(e,this.ends[v])}},t.deleteTowards=function(e,t){this.deleteSide(-e,!1,t)},t.finalizeTree=function(){this.ends[v].deleteOutOf=function(e,t){this.parent.deleteSide(e,!0,t)},this.finalizeTree=this.intentionalBlur=function(){this.delimjQs.eq(+(this.side===v)).removeClass(`mq-ghost`),this.side=0}},t.siblingCreated=function(e,t){t===-this.side&&this.finalizeTree()}}),Ye={"(":`)`,")":`(`,"[":`]`,"]":`[`,"{":`}`,"}":`{`,"\\{":`\\}`,"\\}":`\\{`,"&lang;":`&rang;`,"&rang;":`&lang;`,"\\langle ":`\\rangle `,"\\rangle ":`\\langle `,"|":`|`,"\\lVert ":`\\rVert `,"\\rVert ":`\\lVert `},m(`(`),m(`[`),m(`{`,`\\{`),w.langle=r(Je,v,`&lang;`,`&rang;`,`\\langle `,`\\rangle `),w.rangle=r(Je,y,`&lang;`,`&rang;`,`\\langle `,`\\rangle `),T[`|`]=r(Je,v,`|`,`|`,`|`,`|`),w.lVert=r(Je,v,`&#8741;`,`&#8741;`,`\\lVert `,`\\rVert `),w.rVert=r(Je,y,`&#8741;`,`&#8741;`,`\\lVert `,`\\rVert `),w.left=_(R,function(e){e.parser=function(){var e=I.regex,t=I.string,n=(I.succeed,I.optWhitespace);return n.then(e(/^(?:[([|]|\\\{|\\langle(?![a-zA-Z])|\\lVert(?![a-zA-Z]))/)).then(function(r){var i=r.charAt(0)===`\\`?r.slice(1):r;return r==`\\langle`&&(i=`&lang;`,r+=` `),r==`\\lVert`&&(i=`&#8741;`,r+=` `),ie.then(function(a){return t(`\\right`).skip(n).then(e(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)).map(function(e){var t,n=e.charAt(0)===`\\`?e.slice(1):e;return e==`\\rangle`&&(n=`&rang;`,e+=` `),e==`\\rVert`&&(n=`&#8741;`,e+=` `),t=Je(0,i,n,r,e),t.blocks=[a],a.adopt(t,0,0),t})})})}}),w.right=_(R,function(e){e.parser=function(){return I.fail(`unmatched \\right`)}}),Xe=w.binom=w.binomial=_(_(R,p),function(e,t){e.ctrlSeq=`\\binom`,e.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-paren mq-scaled">(</span><span class="mq-non-leaf"><span class="mq-array mq-non-leaf"><span>&0</span><span>&1</span></span></span><span class="mq-paren mq-scaled">)</span></span>`,e.textTemplate=[`choose(`,`,`,`)`]}),w.choose=_(Xe,function(e){e.createLeftOf=We.prototype.createLeftOf}),w.editable=w.MathQuillMathField=_(R,function(e,t){e.ctrlSeq=`\\MathQuillMathField`,e.htmlTemplate=`<span class="mq-editable-field"><span class="mq-root-block">&0</span></span>`,e.parser=function(){var e=this,n=I.string,r=I.regex,i=I.succeed;return n(`[`).then(r(/^[a-z][a-z0-9]*/i)).skip(n(`]`)).map(function(t){e.name=t}).or(i()).then(t.parser.call(e))},e.finalizeTree=function(e){var t=k(this.ends[v],this.jQ,e);t.KIND_OF_MQ=`MathField`,t.editable=!0,t.createTextarea(),t.editablesTextareaEvents(),t.cursor.insAtRightEnd(t.root),u(t.root)},e.registerInnerField=function(e,t){e.push(e[this.name]=t(this.ends[v].controller))},e.latex=function(){return this.ends[v].latex()},e.text=function(){return this.ends[v].text()}}),Ze=w.embed=_(ae,function(e,t){e.setOptions=function(e){function t(){return``}return this.text=e.text||t,this.htmlTemplate=e.htmlString||``,this.latex=e.latex||t,this},e.parser=function(){var e=this,t=I.string,n=I.regex,r=I.succeed;return t(`{`).then(n(/^[a-z][a-z0-9]*/i)).skip(t(`}`)).then(function(i){return t(`[`).then(n(/^[-\w\s]*/)).skip(t(`]`)).or(r()).map(function(t){return e.setOptions(P[i](t))})})}}),w.MathQuillResponseContainer=_(R,function(e,t){e.ctrlSeq=`\\MathQuillResponseContainer`,e.htmlTemplate=`<span class="lrn-mq-response-container"><marker class="lrn-qe-keyboard-i-response"></marker><content>Response</content></span>`,e.latex=function(){return`\\MathQuillResponseContainer`},e.text=function(){return this.ends[v].text()}}),w.MathQuillResponseContainerIcon=_(R,function(e,t){e.ctrlSeq=`\\MathQuillResponseContainerIcon`,e.htmlTemplate=`<span class="lrn-mq-response-container-icon"><span class="lrn-qe-keyboard-i-response"></span></span>`,e.latex=function(){return`\\MathQuillResponseContainerIcon`},e.text=function(){return this.ends[v].text()}}),Qe=w.matrix=_(R,function(e,t){var n=_(oe,function(e,t){e.init=function(e,n){return this.column=e,this.row=n,t.init.call(this)},e.keystroke=function(e,n,r){switch(e){case`Shift-Spacebar`:return n.preventDefault(),this.parent.insertColumn(this);case`Shift-Enter`:return this.parent.insertRow(this)}return t.keystroke.apply(this,arguments)},e.deleteOutOf=function(e,n){var r=this,i=arguments;this.parent.backspace(this,e,n,function(){return t.deleteOutOf.apply(r,i)})}}),r={column:`&`,row:`\\\\`};e.parentheses={left:null,right:null},e.maximum={rows:5,columns:5},e.defaults={rows:2,columns:2},e.ctrlSeq=`\\matrix`,e.createBlocks=function(){var e,t,r=this,i=r.blocks=[],a=0;this.htmlTemplate.replace(/&\d+/g,function(o,s){var c=r.htmlTemplate.substring(0,s).match(/<tr[^>]*>/gi).length-1;t=e===c?t+1:0,i[a]=n(t,c),i[a].adopt(r,r.ends[y],0),e=c,a++})},e.reflow=function(){var e=this.jQ.children(`table`),t=e.outerHeight()/+e.css(`fontSize`).slice(0,-2),n=this.jQ.children(`.mq-paren`);n.length&&we(n,it(1+.2*(t-1),1.2),1.05*t)},e.latex=function(){var e,t,n,i=this.getMatrixName(),a=`\\begin{`+i+`}`;for(n=0;n<this.blocks.length;n++)e=this.blocks[n].row,t!==void 0&&(a+=t===e?r.column:r.row),t=e,a+=this.blocks[n].latex();return a+=`\\end{`+i+`}`},e.createLeftOf=function(n){this.cursor=n;var r=Math.min(this.defaults.rows,this.maximum.rows),i=Math.min(this.defaults.columns,this.maximum.columns);this.defaultHtmlTemplate=this.defaultHtmlTemplate||this.generateHtmlTemplate(r,i),e.htmlTemplate=this.defaultHtmlTemplate,t.createLeftOf.call(this,n)},e.getMatrixName=function(){return this.ctrlSeq.replace(`\\`,``)},e.generateHtmlTemplate=function(e,t){function n(e){return e?`<span class="mq-paren mq-scaled">`+e+`</span>`:``}var r,i,a,o=`<span class="mq-matrix mq-non-leaf">`+n(this.parentheses.left);for(o+=`<table class="mq-non-leaf">`,e=Math.min(e,this.maximum.rows),t=Math.min(t,this.maximum.columns),r=0,i=0;i<e;i++){for(o+=`<tr>`,a=0;a<t;a++)o+=`<td>&`+r+`</td>`,r++;o+=`</tr>`}return o+=`</table>`,o+=n(this.parentheses.right)+`</span>`},e.htmlTemplate=e.generateHtmlTemplate(1,1),e.parser=function(){var e=I.regex,t=this,i=this.getMatrixName(),a=RegExp(`^(.*?)\\\\end{`+i+`}`),o=RegExp(`\\\\end{`+i+`}`);return e(a).then(function(e){var i,a,s,c,l=e.replace(o,``),u=[],d=l.split(r.row),f=Math.min(d.length,t.maximum.rows),p=0;for(a=0;a<f;a++)i=d[a].split(r.column),p=Math.max(p,i.length);for(p=Math.min(p,t.maximum.columns),a=0;a<f;a++)for(i=d[a].split(r.column),e=0;e<p;e++)s=n(e,a),c=ie.parse(i[e]||` `),c.children().adopt(s,s.ends[y],0),u.push(s);for(t.htmlTemplate=t.generateHtmlTemplate(f,p),t.blocks=u,a=0;a<u.length;a+=1)u[a].adopt(t,t.ends[y],0);return I.succeed(t)})},e.finalizeTree=function(){var e=this.jQ.find(`table`);e.length&&(this.relink(),e.removeClass(function(e,t){var n=t.match(/mq-rows-\d+/g);return n&&n.join(` `)||``}),e.addClass(`mq-rows-`+e.find(`tr`).length))},e.relink=function(){var e=this.jQ.find(`td`),t=S.byId[e.first().attr(rt)],n=S.byId[e.last().attr(rt)],r=e.eq(0).closest(`tr`),i=[];e.each(function(t){var n,a,o,s=S.byId[b(this).attr(rt)],c=e.eq(t+1),l=b(this).closest(`tr`).next(`tr`),u=b(this).closest(`tr`).index(),d=b(this).index();c.length&&(a=S.byId[c.attr(rt)],s[y]=a,a[v]=s),n=l.length?l.find(`td`).eq(d):r.find(`td`).eq(d+1),n.length&&(o=S.byId[n.attr(rt)],s.downOutOf=o,o.upOutOf=s),s.column=d,s.row=u,i.push(s)}),this.ends[v]=t,this.ends[y]=n,t&&t[v]&&delete t[v],n&&n[y]&&delete n[y],this.blocks=i},e.deleteCell=function(e){function t(){return S.byId[b(this).attr(rt)].isEmpty()}var n,r=e.jQ.closest(`tr`),i=e.jQ.index(),a=r.index(),o=r.find(`td`).not(e.jQ),s=this.jQ.find(`tr`).not(r).map(function(){return b(this).find(`td`)[i]}),c=this.jQ.find(`td`).length===1;return o.filter(t).length===o.length&&s.length&&(o.remove(),e.jQ.remove(),r.remove(),this.finalizeTree()),s.filter(t).length===s.length&&o.length&&(s.remove(),e.jQ.remove(),this.finalizeTree()),c||(a=Math.min(a,this.jQ.find(`tr`).length-1),i=Math.min(i,this.jQ.find(`tr`).eq(a).find(`td`).length-1),n=S.byId[this.jQ.find(`tr`).eq(a).find(`td`).eq(i).attr(rt)]),n},e.addRow=function(e){var t,r,i,a,o;if(!(this.jQ.find(`tr`).length>=this.maximum.rows)){for(t=e.find(`td`).length,r=b(`<tr></tr>`),o=0;o<t;o++)i=n(),i.parent=this,i.jQ=b(`<td class="mq-empty">`).attr(rt,i.id),r.append(i.jQ),a||=i;return r.insertAfter(e),a}},e.addColumn=function(e){var t,r,i,a,o;if(!(e.closest(`tr`).find(`td`).length>=this.maximum.columns))return t=e.index(),r=e.closest(`tr`).index(),i=this,o=[],this.jQ.find(`tr`).each(function(){a=n(),a.parent=i,a.jQ=b(`<td class="mq-empty">`).attr(rt,a.id),a.jQ.insertAfter(b(this).find(`td`).eq(t)),o.push(a)}),o[r]},e.insertColumn=function(e){newBlock=this.addColumn(e.jQ),newBlock&&(this.cursor=this.cursor||this.parent.cursor,this.finalizeTree(),this.bubble(`reflow`).cursor.insAtRightEnd(newBlock))},e.insertRow=function(e){newBlock=this.addRow(e.jQ.closest(`tr`)),newBlock&&(this.cursor=this.cursor||this.parent.cursor,this.finalizeTree(),this.bubble(`reflow`).cursor.insAtRightEnd(newBlock))},e.backspace=function(e,t,n,r){if(e.isEmpty()){var i=this.deleteCell(e);i?n.insAtRightEnd(i):(r(),this.finalizeTree()),this.bubble(`edited`)}}}),w.pmatrix=_(Qe,function(e,t){e.ctrlSeq=`\\pmatrix`,e.parentheses={left:`(`,right:`)`}}),w.bmatrix=_(Qe,function(e,t){e.ctrlSeq=`\\bmatrix`,e.parentheses={left:`[`,right:`]`}}),w.Bmatrix=_(Qe,function(e,t){e.ctrlSeq=`\\Bmatrix`,e.parentheses={left:`{`,right:`}`}}),w.vmatrix=_(Qe,function(e,t){e.ctrlSeq=`\\vmatrix`,e.parentheses={left:`|`,right:`|`}}),w.Vmatrix=_(Qe,function(e,t){e.ctrlSeq=`\\Vmatrix`,e.parentheses={left:`‖`,right:`‖`}}),$e=l(1),$e)(function(e,t){typeof t==`function`?(c[e]=function(){return s(),t.apply(this,arguments)},c[e].prototype=t.prototype):c[e]=t})(et,$e[et])})()})),Mq=s((()=>{})),Nq=s(((e,t)=>{Aq(),jq(),Mq(),t.exports=window.MathQuill}));M();var Pq=u(Nq(),1),Fq;typeof window<`u`&&(Fq=Pq.default.getInterface(2),Fq&&Fq.registerEmbed&&Oq(Fq));var Iq=ey(`math-input:mq:input`),Lq=J(`span`)({}),Rq=class extends W.Component{static propTypes={className:j.string,onClick:j.func,onChange:j.func,latex:j.string,onFocus:j.func,onBlur:j.func};componentDidMount(){if(!Fq)throw Error(`MQ is not defined - but component has mounted?`);this.mathField=Fq.MathField(this.input,{handlers:{edit:this.onInputEdit.bind(this)}}),this.updateLatex()}componentDidUpdate(){this.updateLatex()}updateLatex(){if(!this.mathField)return;let{latex:e}=this.props;e!=null&&this.mathField.latex(e)}clear(){return this.mathField.latex(``),``}blur(){Iq(`blur mathfield`),this.mathField.blur()}focus(){Iq(`focus mathfield...`),this.mathField.focus()}command(e){return Iq(`command: `,e),Array.isArray(e)?e.forEach(e=>{this.mathField.cmd(e)}):this.mathField.cmd(e),this.mathField.focus(),this.mathField.latex()}keystroke(e){return this.mathField.keystroke(e),this.mathField.focus(),this.mathField.latex()}write(e){return Iq(`write: `,e),this.mathField.write(e),this.mathField.focus(),this.mathField.latex()}onInputEdit=()=>{Iq(`[onInputEdit] ...`);let{onChange:e}=this.props;this.mathField&&e&&e(this.mathField.latex())};refresh=()=>{this.blur(),this.focus()};onKeyPress=e=>{e.charCode===13&&e.preventDefault()};onClick=e=>{let{onClick:t}=this.props;this.refresh(),t&&t(e)};shouldComponentUpdate(e){return Iq(`next: `,e.latex),Iq(`current: `,this.mathField.latex()),e.latex!==this.mathField.latex()}render(){let{onFocus:e,onBlur:t,className:n}=this.props;return(0,G.jsx)(Lq,{className:n,onKeyDown:this.onKeyPress,onClick:this.onClick,onFocus:e,onBlur:t,ref:e=>this.input=e})}};M();var zq;typeof window<`u`&&(zq=Pq.default.getInterface(2));var Bq=ey(`pie-lib:math-input:mq:static`),Vq=/\\MathQuillMathField\[r\d*\]\{(.*?)\}/g,Hq=/ /g;function Uq(e=``){return e.replace(Hq,``)}function Wq(e){let t=0;for(let n=0;n<(e||``).length;n++)e[n]===`{`&&t++;return t}var Gq=class extends W.Component{static propTypes={latex:j.string.isRequired,onFocus:j.func,onBlur:j.func,className:j.string,getFieldName:j.func,onSubFieldChange:j.func,onSubFieldFocus:j.func,setInput:j.func};static defaultProps={getFieldName:()=>{}};constructor(e){super(e),this.state={announcement:``,previousLatex:``,inputSource:null,isDeleteKeyPressed:!1},this.inputRef=W.createRef()}componentDidMount(){this.update(),VK(),this.createLiveRegion(),this.addEventListeners()}componentDidUpdate(){this.update(),VK()}componentWillUnmount(){this.removeLiveRegion(),this.removeEventListeners()}createLiveRegion=()=>{this.liveRegion=document.createElement(`div`),this.liveRegion.style.position=`absolute`,this.liveRegion.style.width=`1px`,this.liveRegion.style.height=`1px`,this.liveRegion.style.marginTop=`-1px`,this.liveRegion.style.clip=`rect(1px, 1px, 1px, 1px)`,this.liveRegion.style.overflow=`hidden`,this.liveRegion.setAttribute(`aria-live`,`polite`),this.liveRegion.setAttribute(`aria-atomic`,`true`),document.body.appendChild(this.liveRegion)};addEventListeners=()=>{let e=this.inputRef.current;e&&(e.addEventListener(`keydown`,this.handleKeyDown),e.addEventListener(`click`,this.handleMathKeyboardClick))};removeEventListeners=()=>{let e=this.inputRef.current;e&&(e.removeEventListener(`keydown`,this.handleKeyDown),e.removeEventListener(`click`,this.handleMathKeyboardClick))};removeLiveRegion=()=>{this.liveRegion&&=(document.body.removeChild(this.liveRegion),null)};handleKeyDown=e=>{(e?.key===`Backspace`||e?.key===`Delete`)&&this.setState({isDeleteKeyPressed:!0}),this.setState({inputSource:`keyboard`})};handleMathKeyboardClick=()=>{this.setState({inputSource:`mathKeyboard`})};onInputEdit=e=>{if(!this.mathField)return;let t=this.props.getFieldName(e,this.mathField.innerFields);this.props.onSubFieldChange&&this.props.onSubFieldChange(t,e.latex()),this.announceLatexConversion(e.latex())};announceLatexConversion=e=>{if(!this.state){console.error(`State is not initialized`);return}let{previousLatex:t,inputSource:n,isDeleteKeyPressed:r}=this.state,i=`Converted to math symbol`;if(n===`keyboard`&&!r)if(Wq(e)>Wq(t))this.announceMessage(i);else try{this.mathField.parseLatex(t),this.mathField.parseLatex(e),e==t&&this.announceMessage(i)}catch(e){console.warn(`Error parsing latex:`,e.message),console.warn(e)}this.setState({previousLatex:e,isDeleteKeyPressed:!1})};announceMessage=e=>{this.setState({previousLatex:``}),this.liveRegion&&(this.liveRegion.textContent=e,setTimeout(()=>{this.liveRegion.textContent=``},500))};update=()=>{if(!zq)throw Error(`MQ is not defined - but component has mounted?`);this.mathField||=zq.StaticMath(this.inputRef?.current,{handlers:{edit:this.onInputEdit.bind(this)}});try{this.mathField.parseLatex(this.props.latex),this.mathField.latex(this.props.latex)}catch{this.mathField.latex(`\\MathQuillMathField[r1]{}`)}};blur=()=>{Bq(`blur mathfield`),this.mathField.blur()};focus=()=>{Bq(`focus mathfield...`),this.mathField.focus()};shouldComponentUpdate(e){try{let t=Uq(this.mathField.parseLatex(e.latex)),n=(e.latex.match(Vq)||[]).length,r=t!==Uq(this.mathField.latex().trim())||n!==Object.keys(this.mathField.innerFields).length/2;return Bq(`[shouldComponentUpdate] `,r),r}catch(e){return console.warn(`Error parsing latex:`,e.message,`skip update`),console.warn(e),!1}}onFocus=e=>{try{let t=e.target.parentElement.nextSibling,n=parseInt(t.getAttribute(`mathquill-block-id`),10);n||=(t=t.parentElement,parseInt(t.getAttribute(`mathquill-block-id`),10));let r=this.mathField.innerFields.find(e=>e.id===n);if(r){let e=this.props.getFieldName(r,this.mathField.innerFields);this.props.setInput&&this.props.setInput(r),this.props.onSubFieldFocus(e,r)}}catch(e){console.error(`error finding root block`,e.message)}};render(){let{onBlur:e,className:t}=this.props;return(0,G.jsx)(`span`,{className:t,onFocus:this.onFocus,onBlur:e,ref:this.inputRef})}};M();var Kq=J(`span`)(()=>({display:`inline-flex`,border:`1px solid #C0C3CF`,margin:`1px 5px`,cursor:`pointer`,alignItems:`center`,justifyContent:`center`,minWidth:`50px`,minHeight:`36px`,height:`fit-content`})),qq=J(`div`)(({theme:e})=>({background:e.palette.grey.A100,color:e.palette.grey.A700,display:`inline-flex`,borderRight:`2px solid #C0C3CF`,boxSizing:`border-box`,overflow:`hidden`,fontSize:`12px`,minHeight:`36px`,height:`100%`,alignItems:`center`,fontFamily:`Symbola, Times New Roman, serif`,padding:`0 2px`})),Jq=J(`div`)(()=>({flex:8,color:`var(--pie-text, black)`,padding:`4px !important`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`var(--pie-background, rgba(255, 255, 255, 0))`,"& > .mq-math-mode sup.mq-nthroot":{fontSize:`70% !important`,verticalAlign:`1em !important`},"& > .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-overarrow-inner":{paddingTop:`0 !important`,border:`none !important`},"& .mq-overarrow.mq-arrow-both":{marginTop:`0px`,minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.4em`,left:`-1px`},"&:after":{top:`0px !important`,position:`absolute !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`}})),Yq=e=>{let{node:t,options:n,selected:r}=e,{attrs:i}=t,{value:a,index:o}=i,s=`R ${parseInt(o)+1}`;return(0,G.jsx)(KM,{className:`math-templated`,"data-selected":r,style:{display:`inline-flex`,minHeight:`36px`,minWidth:`50px`,cursor:`pointer`},children:(0,G.jsxs)(Kq,{...i,children:[(0,G.jsx)(qq,{children:s}),(0,G.jsx)(Jq,{children:(0,G.jsx)(Gq,{latex:a})})]})})};Yq.propTypes={attributes:j.object,value:j.string,keyToDisplay:j.string};var Xq={},Zq=e=>String(e||``).replace(/-/g,`_`),Qq=e=>e&&e.attrs&&e.attrs.index!=null?String(e.attrs.index):null,$q=(e,t)=>{let n=[];return e.descendants((e,r)=>{if(e.type&&e.type.name===t){let t=Qq(e);t!=null&&n.push({index:t,pos:r,node:e})}return!0}),n},eJ=(e,t)=>{let n=0;return e.descendants(e=>(e.type&&e.type.name===t&&(n+=1),!0)),n},tJ=({schema:e,typeName:t,index:n})=>{let r=e.nodes[t];return r?r.create({index:String(n),id:String(n),value:``}):null},nJ=(e,t)=>{let n=e.resolve(Math.min(t,e.content.size));return VC.near(n,1)},rJ=UA.create({name:`responseArea`,addOptions(){return{maxResponseAreas:null,error:null,options:null,respAreaToolbar:null,onHandleAreaChange:null}},addProseMirrorPlugins(){if(!this.options.type)return[];let e=Zq(this.options.type);return[new aw({key:new cw(`response-area-watcher:${e}`),view:t=>(Xq[e]===void 0&&(Xq[e]=0,t.state.doc.descendants(t=>{if(t.type&&t.type.name===e){let n=Qq(t);if(n!=null){let t=parseInt(n,10);!Number.isNaN(t)&&t>Xq[e]&&(Xq[e]=t)}}return!0})),{update:(t,n)=>{let r=t.state;if(n.doc.eq(r.doc))return;let i=$q(r.doc,e),a=$q(n.doc,e);if(this.options.toolbar&&(this.options.toolbar.disabled=i.length>=this.options.maxResponseAreas),a.length>i.length){let e=new Set(i.map(e=>e.index)),t=a.filter(t=>!e.has(t.index));t.length&&typeof this.options.onHandleAreaChange==`function`&&this.options.onHandleAreaChange(t)}}})})]},addCommands(){return{insertResponseArea:e=>({tr:t,state:n,dispatch:r,commands:i})=>{let a=Zq(e);if(eJ(n.doc,a)>=this.options.maxResponseAreas)return!1;Xq[a]===void 0&&(Xq[a]=0);let o=Xq[a]+1;Xq[a]+=1;let s=tJ({schema:n.schema,typeName:a,index:o});if(!s)return!1;let{selection:c}=n,l=c.from,u=e=>{try{return t.insert(e,s),e}catch{return null}},d=u(l);if(d??=u(t.doc.content.size),d==null)return!1;if([`math_templated`,`inline_dropdown`,`explicit_constructed_response`].includes(a))t.setSelection(UC.create(t.doc,d));else{let e=d+s.nodeSize;t.setSelection(nJ(t.doc,e))}return r&&(i.focus(),r(t)),!0},refreshResponseArea:()=>({tr:e,state:t,commands:n,dispatch:r})=>{let{selection:i}=t,a=i.$from.nodeAfter,o=i.from;return e.setNodeMarkup(o,void 0,{...a?.attrs,updated:`${Date.now()}`}),e.setSelection(UC.create(e.doc,o)),r&&(n.focus(),r(e)),!0}}}}),iJ=SM.create({name:`explicit_constructed_response`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="explicit_constructed_response"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`explicit_constructed_response`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return eN(e=>(0,G.jsx)(TV,{...e,options:this.options}))}}),aJ=SM.create({name:`math_templated`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="math_templated"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`math_templated`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return eN(e=>(0,G.jsx)(Yq,{...e,options:this.options}))}}),oJ=SM.create({name:`drag_in_the_blank`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},id:{default:null},value:{default:``},inTable:{default:null},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="drag_in_the_blank"]`,getAttrs:e=>({index:e.dataset.index,id:e.dataset.id,value:e.dataset.value,inTable:e.dataset.inTable})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`drag_in_the_blank`,"data-index":e.index,"data-id":e.id,"data-value":e.value,"data-in-table":e.inTable}]},addNodeView(){return eN(e=>(0,G.jsx)(TW,{...e,options:this.options}))}}),sJ=SM.create({name:`inline_dropdown`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{index:{default:null},value:{default:``},updated:{default:``}}},parseHTML(){return[{tag:`span[data-type="inline_dropdown"]`,getAttrs:e=>({index:e.dataset.index,value:e.dataset.value})}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-type":`inline_dropdown`,"data-index":e.index,"data-value":e.value}]},addNodeView(){return eN(e=>(0,G.jsx)(EW,{...e,options:this.options}))}}),cJ=$r(`MuiDivider`,[`root`,`absolute`,`fullWidth`,`inset`,`middle`,`flexItem`,`light`,`vertical`,`withChildren`,`withChildrenVertical`,`textAlignRight`,`textAlignLeft`,`wrapper`,`wrapperVertical`]),lJ=$r(`MuiListItemIcon`,[`root`,`alignItemsFlexStart`]);function uJ(e){return Qr(`MuiTypography`,e)}$r(`MuiTypography`,[`root`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`subtitle1`,`subtitle2`,`body1`,`body2`,`inherit`,`button`,`caption`,`overline`,`alignLeft`,`alignRight`,`alignCenter`,`alignJustify`,`noWrap`,`gutterBottom`,`paragraph`]),M();var dJ={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},fJ=gg(),pJ=e=>{let{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:a,classes:o}=e;return ba({root:[`root`,a,e.align!==`inherit`&&`align${P_(t)}`,n&&`gutterBottom`,r&&`noWrap`,i&&`paragraph`]},uJ,o)},mJ=J(`span`,{name:`MuiTypography`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!==`inherit`&&t[`align${P_(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(y_(({theme:e})=>({margin:0,variants:[{props:{variant:`inherit`},style:{font:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},...Object.entries(e.typography).filter(([e,t])=>e!==`inherit`&&t&&typeof t==`object`).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>typeof e==`string`).map(([t])=>({props:{color:`text${P_(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>e.align!==`inherit`,style:{textAlign:`var(--Typography-textAlign)`}},{props:({ownerState:e})=>e.noWrap,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:`0.35em`}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}))),hJ={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,subtitle1:`h6`,subtitle2:`h6`,body1:`p`,body2:`p`,inherit:`p`},gJ=W.forwardRef(function(e,t){let{color:n,...r}=_g({props:e,name:`MuiTypography`}),i=!dJ[n],a=fJ({...r,...i&&{color:n}}),{align:o=`inherit`,className:s,component:c,gutterBottom:l=!1,noWrap:u=!1,paragraph:d=!1,variant:f=`body1`,variantMapping:p=hJ,...m}=a,h={...a,align:o,color:n,className:s,component:c,gutterBottom:l,noWrap:u,paragraph:d,variant:f,variantMapping:p};return(0,G.jsx)(mJ,{as:c||(d?`p`:p[f]||hJ[f])||`span`,ref:t,className:K(pJ(h).root,s),...m,ownerState:h,style:{...o!==`inherit`&&{"--Typography-textAlign":o},...m.style}})}),_J=$r(`MuiListItemText`,[`root`,`multiline`,`dense`,`inset`,`primary`,`secondary`]);function vJ(e){return Qr(`MuiMenuItem`,e)}var yJ=$r(`MuiMenuItem`,[`root`,`focusVisible`,`dense`,`disabled`,`divider`,`gutters`,`selected`]);function bJ(e){return Qr(`MuiNativeSelect`,e)}var xJ=$r(`MuiNativeSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]);M();var SJ=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return ba({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${P_(n)}`,a&&`iconOpen`,r&&`disabled`]},bJ,t)},CJ=J(`select`,{name:`MuiNativeSelect`})(({theme:e})=>({MozAppearance:`none`,WebkitAppearance:`none`,userSelect:`none`,borderRadius:0,cursor:`pointer`,"&:focus":{borderRadius:0},[`&.${xJ.disabled}`]:{cursor:`default`},"&[multiple]":{height:`auto`},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!==`filled`&&e.variant!==`outlined`,style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:`filled`},style:{"&&&":{paddingRight:32}}},{props:{variant:`outlined`},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),wJ=J(CJ,{name:`MuiNativeSelect`,slot:`Select`,shouldForwardProp:Fo,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${xJ.multiple}`]:t.multiple}]}})({}),TJ=J(`svg`,{name:`MuiNativeSelect`})(({theme:e})=>({position:`absolute`,right:0,top:`calc(50% - .5em)`,pointerEvents:`none`,color:(e.vars||e).palette.action.active,[`&.${xJ.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:`rotate(180deg)`}},{props:{variant:`filled`},style:{right:7}},{props:{variant:`outlined`},style:{right:7}}]})),EJ=J(TJ,{name:`MuiNativeSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${P_(n.variant)}`],n.open&&t.iconOpen]}})({}),DJ=W.forwardRef(function(e,t){let{className:n,disabled:r,error:i,IconComponent:a,inputRef:o,variant:s=`standard`,...c}=e,l={...e,disabled:r,variant:s,error:i},u=SJ(l);return(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(wJ,{ownerState:l,className:K(u.select,n),disabled:r,ref:o||t,...c}),e.multiple?null:(0,G.jsx)(EJ,{as:a,ownerState:l,className:u.icon})]})});function OJ(e){return Qr(`MuiSelect`,e)}var kJ=$r(`MuiSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`focused`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]);function AJ(e){return e?e.type===`mousedown`||e.type===`pointerdown`||e.type===`touchstart`?`pointer`:e.type===`keydown`||e.type===`click`&&e.detail===0?`keyboard`:null:null}function jJ(e){return e==null||typeof e==`string`&&!e.trim()}function MJ(e,t){return typeof t==`object`&&t?e===t:String(e)===String(t)}var NJ=W.createContext(null);function PJ(){return W.useContext(NJ)}var FJ=NJ.Provider;M();var IJ,LJ=J(CJ,{name:`MuiSelect`,slot:`Select`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`&.${kJ.select}`]:t.select},{[`&.${kJ.select}`]:t[n.variant]},{[`&.${kJ.error}`]:t.error},{[`&.${kJ.multiple}`]:t.multiple}]}})({[`&.${kJ.select}`]:{height:`auto`,minHeight:`1.4375em`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`}}),RJ=J(TJ,{name:`MuiSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${P_(n.variant)}`],n.open&&t.iconOpen]}})({}),zJ=J(`input`,{shouldForwardProp:e=>Po(e)&&e!==`classes`,name:`MuiSelect`,slot:`NativeInput`})({bottom:0,left:0,position:`absolute`,opacity:0,pointerEvents:`none`,width:`100%`,boxSizing:`border-box`}),BJ=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return ba({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${P_(n)}`,a&&`iconOpen`,r&&`disabled`],nativeInput:[`nativeInput`]},OJ,t)},VJ=W.forwardRef(function(e,t){let{"aria-describedby":n,"aria-label":r,autoFocus:i,autoWidth:a,children:o,className:s,defaultOpen:c,defaultValue:l,disabled:u,displayEmpty:d,error:f=!1,IconComponent:p,inputRef:m,labelId:h,MenuProps:g={},multiple:_,name:v,onBlur:y,onChange:b,onClose:x,onFocus:S,onKeyDown:C,onMouseDown:w,onOpen:T,open:E,readOnly:D,renderValue:O,required:k,SelectDisplayProps:A={},tabIndex:j,type:M,value:P,variant:F=`standard`,...ee}=e,[te,I]=H_({controlled:P,default:l,name:`Select`}),[ne,re]=H_({controlled:E,default:c,name:`Select`}),ie=W.useRef(null),L=W.useRef(null),[R,ae]=W.useState(null),{current:z}=W.useRef(E!=null),[B,oe]=W.useState(),[se,ce]=W.useState(null),V=o_(t,m),le=W.useCallback(e=>{L.current=e,e&&ae(e)},[]),ue=R?.parentNode;W.useImperativeHandle(V,()=>({focus:()=>{L.current.focus()},node:ie.current,value:te}),[te]);let de=R!==null&&ne;W.useEffect(()=>{if(!de||!ue||a||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{oe(ue.clientWidth)});return e.observe(ue),()=>{e.disconnect()}},[de,ue,a]),W.useEffect(()=>{c&&ne&&R&&!z&&(oe(a?null:ue.clientWidth),L.current.focus())},[R,a]),W.useEffect(()=>{i&&L.current.focus()},[i]),W.useEffect(()=>{if(!h)return;let e=xg(L.current).getElementById(h);if(e){let t=()=>{getSelection().isCollapsed&&L.current.focus()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}},[h]);let H=(e,t)=>{e?(ce(AJ(t)),T&&T(t)):(ce(null),x&&x(t)),z||(oe(a?null:ue.clientWidth),re(e))},fe=e=>{w?.(e),e.button===0&&(e.preventDefault(),L.current.focus(),H(!0,e))},pe=e=>{H(!1,e)},me=W.Children.toArray(o),he=e=>{let t=me.find(t=>t.props.value===e.target.value);t!==void 0&&(I(t.props.value),b&&b(e,t))},ge=e=>t=>{let n;if(t.currentTarget.hasAttribute(`tabindex`)){if(_){n=Array.isArray(te)?te.slice():[];let t=te.indexOf(e.props.value);t===-1?n.push(e.props.value):n.splice(t,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),te!==n&&(I(n),b)){let r=t.nativeEvent||t,i=new r.constructor(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:n,name:v}}),b(i,e)}_||H(!1,t)}},U=e=>{D||([` `,`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),H(!0,e)),C?.(e))},_e=e=>{!de&&y&&(Object.defineProperty(e,`target`,{writable:!0,value:{value:te,name:v}}),y(e))};delete ee[`aria-invalid`];let ve,ye,be=[],xe=!1;(vb({value:te})||d)&&(O?ve=O(te):xe=!0);let Se=me.map(e=>{if(!W.isValidElement(e))return null;let t;if(_){if(!Array.isArray(te))throw Error(N(2));t=te.some(t=>MJ(t,e.props.value)),t&&xe&&be.push(e.props.children)}else t=MJ(te,e.props.value),t&&xe&&(ye=e.props.children);return W.cloneElement(e,{"aria-selected":t?`true`:`false`,onClick:ge(e),onKeyUp:t=>{t.key===` `&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:`option`,selected:t,value:void 0,"data-value":e.props.value})});xe&&(ve=_?be.length===0?null:be.reduce((e,t,n)=>(e.push(t),n<be.length-1&&e.push(`, `),e),[]):ye);let Ce=B;!a&&z&&R&&(Ce=ue.clientWidth);let we;we=j===void 0?u?null:0:j;let Te=A.id||(v?`mui-component-select-${v}`:void 0),Ee={...e,variant:F,value:te,open:de,error:f},De=BJ(Ee),Oe={...g.PaperProps,...typeof g.slotProps?.paper==`function`?g.slotProps.paper(Ee):g.slotProps?.paper},ke={...g.MenuListProps,...typeof g.slotProps?.list==`function`?g.slotProps.list(Ee):g.slotProps?.list},Ae=qi();return(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(LJ,{as:`div`,ref:le,tabIndex:we,role:`combobox`,"aria-controls":de?Ae:void 0,"aria-disabled":u?`true`:void 0,"aria-expanded":de?`true`:`false`,"aria-haspopup":`listbox`,"aria-label":r,"aria-labelledby":[h,Te].filter(Boolean).join(` `)||void 0,"aria-describedby":n,"aria-required":k?`true`:void 0,"aria-invalid":f?`true`:void 0,onKeyDown:U,onMouseDown:u||D?null:fe,onBlur:_e,onFocus:S,...A,ownerState:Ee,className:K(A.className,De.select,s),id:Te,children:jJ(ve)?IJ||=(0,G.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):ve}),(0,G.jsx)(zJ,{"aria-invalid":f,value:Array.isArray(te)?te.join(`,`):te,name:v,ref:ie,"aria-hidden":!0,onChange:he,tabIndex:-1,disabled:u,className:De.nativeInput,autoFocus:i,required:k,...ee,ownerState:Ee}),(0,G.jsx)(RJ,{as:p,className:De.icon,ownerState:Ee}),(0,G.jsx)(FJ,{value:se,children:(0,G.jsx)(rx,{id:`menu-${v||``}`,anchorEl:ue,open:de,onClose:pe,anchorOrigin:{vertical:`bottom`,horizontal:`center`},transformOrigin:{vertical:`top`,horizontal:`center`},...g,slotProps:{...g.slotProps,list:{"aria-labelledby":h,role:`listbox`,"aria-multiselectable":_?`true`:void 0,disableListWrap:!0,id:Ae,...ke},paper:{...Oe,style:{minWidth:Ce,...Oe==null?null:Oe.style}}},children:Se})})]})}),HJ=L_((0,G.jsx)(`path`,{d:`M7 10l5 5 5-5z`}),`ArrowDropDown`);M();function UJ(e){return parseInt(e,10)||0}var WJ={shadow:{visibility:`hidden`,position:`absolute`,overflow:`hidden`,height:0,top:0,left:0,transform:`translateZ(0)`}};function GJ(e){for(let t in e)return!1;return!0}function KJ(e){return GJ(e)||e.outerHeightStyle===0&&!e.overflowing}var qJ=W.forwardRef(function(e,t){let{onChange:n,maxRows:r,minRows:i=1,style:a,value:o,...s}=e,{current:c}=W.useRef(o!=null),l=W.useRef(null),u=a_(t,l),d=W.useRef(null),f=W.useRef(null),p=W.useCallback(()=>{let t=l.current,n=f.current;if(!t||!n)return;let a=Sg(t).getComputedStyle(t);if(a.width===`0px`)return{outerHeightStyle:0,overflowing:!1};n.style.width=a.width,n.value=t.value||e.placeholder||`x`,n.value.slice(-1)===`
315
- `&&(n.value+=` `);let o=a.boxSizing,s=UJ(a.paddingBottom)+UJ(a.paddingTop),c=UJ(a.borderBottomWidth)+UJ(a.borderTopWidth),u=n.scrollHeight;n.value=`x`;let d=n.scrollHeight,p=u;return i&&(p=Math.max(Number(i)*d,p)),r&&(p=Math.min(Number(r)*d,p)),p=Math.max(p,d),{outerHeightStyle:p+(o===`border-box`?s+c:0),overflowing:Math.abs(p-u)<=1}},[r,i,e.placeholder]),m=O_(()=>{let e=l.current,t=p();if(!e||!t||KJ(t))return!1;let n=t.outerHeightStyle;return d.current!=null&&d.current!==n}),h=W.useCallback(()=>{let e=l.current,t=p();if(!e||!t||KJ(t))return;let n=t.outerHeightStyle;d.current!==n&&(d.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?`hidden`:``},[p]),g=W.useRef(-1);return pi(()=>{let e=vg(h),t=l?.current;if(!t)return;let n=Sg(t);n.addEventListener(`resize`,e);let r;return typeof ResizeObserver<`u`&&(r=new ResizeObserver(()=>{m()&&(r.unobserve(t),cancelAnimationFrame(g.current),h(),g.current=requestAnimationFrame(()=>{r.observe(t)}))}),r.observe(t)),()=>{e.clear(),cancelAnimationFrame(g.current),n.removeEventListener(`resize`,e),r&&r.disconnect()}},[p,h,m]),pi(()=>{h()}),(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(`textarea`,{value:o,onChange:e=>{c||h();let t=e.target,r=t.value.length,i=t.value.endsWith(`
316
- `),a=t.selectionStart===r;i&&a&&t.setSelectionRange(r,r),n&&n(e)},ref:u,rows:i,style:a,...s}),(0,G.jsx)(`textarea`,{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:{...WJ.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function JJ(e){return Qr(`MuiInputBase`,e)}var YJ=$r(`MuiInputBase`,[`root`,`formControl`,`focused`,`disabled`,`adornedStart`,`adornedEnd`,`error`,`sizeSmall`,`multiline`,`colorSecondary`,`fullWidth`,`hiddenLabel`,`readOnly`,`input`,`inputSizeSmall`,`inputMultiline`,`inputTypeSearch`,`inputAdornedStart`,`inputAdornedEnd`,`inputHiddenLabel`]);M();var XJ,ZJ=`mui-auto-fill`,QJ=`mui-auto-fill-cancel`,$J=(e,t)=>{let{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size===`small`&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${P_(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},eY=(e,t)=>{let{ownerState:n}=e;return[t.input,n.size===`small`&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type===`search`&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},tY=e=>{let{classes:t,color:n,disabled:r,error:i,endAdornment:a,focused:o,formControl:s,fullWidth:c,hiddenLabel:l,multiline:u,readOnly:d,size:f,startAdornment:p,type:m}=e;return ba({root:[`root`,`color${P_(n)}`,r&&`disabled`,i&&`error`,c&&`fullWidth`,o&&`focused`,s&&`formControl`,f&&f!==`medium`&&`size${P_(f)}`,u&&`multiline`,p&&`adornedStart`,a&&`adornedEnd`,l&&`hiddenLabel`,d&&`readOnly`],input:[`input`,r&&`disabled`,m===`search`&&`inputTypeSearch`,u&&`inputMultiline`,f===`small`&&`inputSizeSmall`,l&&`inputHiddenLabel`,p&&`inputAdornedStart`,a&&`inputAdornedEnd`,d&&`readOnly`]},JJ,t)},nY=J(`div`,{name:`MuiInputBase`,slot:`Root`,overridesResolver:$J})(y_(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:`1.4375em`,boxSizing:`border-box`,position:`relative`,cursor:`text`,display:`inline-flex`,alignItems:`center`,[`&.${YJ.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:`default`},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:`4px 0 5px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:`100%`}}]}))),rY=J(`input`,{name:`MuiInputBase`,slot:`Input`,overridesResolver:eY})(y_(({theme:e})=>{let t=e.palette.mode===`light`,n={color:`currentColor`,...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create(`opacity`,{duration:e.transitions.duration.shorter})},r={opacity:`0 !important`},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:`inherit`,letterSpacing:`inherit`,color:`currentColor`,padding:`4px 0 5px`,border:0,boxSizing:`content-box`,background:`none`,height:`1.4375em`,margin:0,WebkitTapHighlightColor:`transparent`,display:`block`,minWidth:0,width:`100%`,"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:`none`},"&::-webkit-search-decoration":{WebkitAppearance:`none`},[`label[data-shrink=false] + .${YJ.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${YJ.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:QJ,animationDuration:`10ms`,"&:-webkit-autofill":{animationDuration:`5000s`,animationName:ZJ}}},{props:{size:`small`},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:`auto`,resize:`none`,padding:0,paddingTop:0}},{props:{type:`search`},style:{MozAppearance:`textfield`}}]}})),iY=hg({[`@keyframes ${ZJ}`]:{from:{animationName:ZJ}},[`@keyframes ${QJ}`]:{from:{animationName:QJ}}}),aY=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiInputBase`}),{"aria-describedby":r,autoComplete:i,autoFocus:a,className:o,color:s,components:c={},componentsProps:l={},defaultValue:u,disabled:d,disableInjectingGlobalStyles:f,endAdornment:p,error:m,fullWidth:h=!1,id:g,inputComponent:_=`input`,inputProps:v={},inputRef:y,margin:b,maxRows:x,minRows:S,multiline:C=!1,name:w,onBlur:T,onChange:E,onClick:D,onFocus:O,onKeyDown:k,onKeyUp:A,placeholder:j,readOnly:M,renderSuffix:P,rows:F,size:ee,slotProps:te={},slots:I={},startAdornment:ne,type:re=`text`,value:ie,...L}=n,R=v.value==null?ie:v.value,{current:ae}=W.useRef(R!=null),z=W.useRef(),B=W.useCallback(e=>{},[]),oe=o_(z,y,v.ref,B),[se,ce]=W.useState(!1),V=ob(),le=ib({props:n,muiFormControl:V,states:[`color`,`disabled`,`error`,`hiddenLabel`,`size`,`required`,`filled`]});le.focused=V?V.focused:se,W.useEffect(()=>{!V&&d&&se&&(ce(!1),T&&T())},[V,d,se,T]);let ue=V&&V.onFilled,de=V&&V.onEmpty,H=W.useCallback(e=>{vb(e)?ue&&ue():de&&de()},[ue,de]);z_(()=>{ae&&H({value:R})},[R,H,ae]),z_(()=>{if(!a)return;let e=z.current;if(!e)return;let t=xg(e),n=h_(t),r=n==null||n===t.body||n===t.documentElement;e===n?V&&V.onFocus?V.onFocus():ce(!0):r&&e.focus()},[a]);let fe=e=>{O&&O(e),v.onFocus&&v.onFocus(e),V&&V.onFocus?V.onFocus(e):ce(!0)},pe=e=>{T&&T(e),v.onBlur&&v.onBlur(e),V&&V.onBlur?V.onBlur(e):ce(!1)},me=(e,...t)=>{if(!ae){let t=e.target||z.current;if(t==null)throw Error(N(1));H({value:t.value})}v.onChange&&v.onChange(e,...t),E&&E(e,...t)};W.useEffect(()=>{H(z.current)},[]);let he=e=>{z.current&&e.currentTarget===e.target&&z.current.focus(),D&&D(e)},ge=_,U=v;C&&ge===`input`&&(U=F?{type:void 0,minRows:F,maxRows:F,...U}:{type:void 0,maxRows:x,minRows:S,...U},ge=qJ);let _e=e=>{H(e.animationName===QJ?z.current:{value:`x`})};W.useEffect(()=>{V&&V.setAdornedStart(!!ne)},[V,ne]);let ve={...n,color:le.color||`primary`,disabled:le.disabled,endAdornment:p,error:le.error,focused:le.focused,formControl:V,fullWidth:h,hiddenLabel:le.hiddenLabel,multiline:C,size:le.size,startAdornment:ne,type:re},ye=tY(ve),be=I.root||c.Root||nY,xe=te.root||l.root||{},Se=I.input||c.Input||rY;return U={...U,...te.input??l.input},(0,G.jsxs)(W.Fragment,{children:[!f&&typeof iY==`function`&&(XJ||=(0,G.jsx)(iY,{})),(0,G.jsxs)(be,{...xe,ref:t,onClick:he,...L,...!pg(be)&&{ownerState:{...ve,...xe.ownerState}},className:K(ye.root,xe.className,o,M&&`MuiInputBase-readOnly`),children:[ne,(0,G.jsx)(ab.Provider,{value:null,children:(0,G.jsx)(Se,{"aria-invalid":le.error,"aria-describedby":r,autoComplete:i,autoFocus:a,defaultValue:u,disabled:le.disabled,id:g,onAnimationStart:_e,name:w,placeholder:j,readOnly:M,required:le.required,rows:F,value:R,onKeyDown:k,onKeyUp:A,type:re,...U,...!pg(Se)&&{as:ge,ownerState:{...ve,...U.ownerState}},ref:oe,className:K(ye.input,U.className,M&&`MuiInputBase-readOnly`),onBlur:pe,onChange:me,onFocus:fe})}),p,P?P({...le,startAdornment:ne}):null]})]})});function oY(e){return Qr(`MuiInput`,e)}var sY={...YJ,...$r(`MuiInput`,[`root`,`underline`,`input`])};M();var cY=e=>{let{classes:t,disableUnderline:n}=e,r=ba({root:[`root`,!n&&`underline`],input:[`input`]},oY,t);return{...t,...r}},lY=J(nY,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...$J(e,t),!n.disableUnderline&&t.underline]}})(y_(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`;return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:`relative`,variants:[{props:({ownerState:e})=>e.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},[`&.${sY.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${sY.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},[`&:hover:not(.${sY.disabled}, .${sY.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${sY.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}}))]}})),uY=J(rY,{name:`MuiInput`,slot:`Input`,overridesResolver:eY})({}),dY=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiInput`}),{disableUnderline:r=!1,components:i={},componentsProps:a,fullWidth:o=!1,inputComponent:s=`input`,multiline:c=!1,slotProps:l,slots:u={},type:d=`text`,...f}=n,p=cY(n),m={root:{ownerState:{disableUnderline:r}}},h=l??a?Cn(l??a,m):m;return(0,G.jsx)(aY,{slots:{root:u.root??i.Root??lY,input:u.input??i.Input??uY},slotProps:h,fullWidth:o,inputComponent:s,multiline:c,ref:t,type:d,...f,classes:p})});dY.muiName=`Input`;function fY(e){return Qr(`MuiFilledInput`,e)}var pY={...YJ,...$r(`MuiFilledInput`,[`root`,`underline`,`input`,`adornedStart`,`adornedEnd`,`sizeSmall`,`multiline`,`hiddenLabel`])};M();var mY=e=>{let{classes:t,disableUnderline:n,startAdornment:r,endAdornment:i,size:a,hiddenLabel:o,multiline:s}=e,c=ba({root:[`root`,!n&&`underline`,r&&`adornedStart`,i&&`adornedEnd`,a===`small`&&`size${P_(a)}`,o&&`hiddenLabel`,s&&`multiline`],input:[`input`]},fY,t);return{...t,...c}},hY=J(nY,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiFilledInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...$J(e,t),!n.disableUnderline&&t.underline]}})(y_(({theme:e})=>{let t=e.palette.mode===`light`,n=t?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`,r=t?`rgba(0, 0, 0, 0.06)`:`rgba(255, 255, 255, 0.09)`,i=t?`rgba(0, 0, 0, 0.09)`:`rgba(255, 255, 255, 0.13)`,a=t?`rgba(0, 0, 0, 0.12)`:`rgba(255, 255, 255, 0.12)`;return{position:`relative`,backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${pY.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${pY.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},[`&.${pY.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${pY.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},[`&:hover:not(.${pY.disabled}, .${pY.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${pY.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(by()).map(([t])=>({props:{disableUnderline:!1,color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:12}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:12}},{props:({ownerState:e})=>e.multiline,style:{padding:`25px 12px 8px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel&&e.size===`small`,style:{paddingTop:8,paddingBottom:9}}]}})),gY=J(rY,{name:`MuiFilledInput`,slot:`Input`,overridesResolver:eY})(y_(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode===`light`?null:`0 0 0 100px #266798 inset`,WebkitTextFillColor:e.palette.mode===`light`?null:`#fff`,caretColor:e.palette.mode===`light`?null:`#fff`,borderTopLeftRadius:`inherit`,borderTopRightRadius:`inherit`}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:`inherit`,borderTopRightRadius:`inherit`},[e.getColorSchemeSelector(`dark`)]:{"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 100px #266798 inset`,WebkitTextFillColor:`#fff`,caretColor:`#fff`}}},variants:[{props:{size:`small`},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size===`small`,style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),_Y=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiFilledInput`}),{disableUnderline:r=!1,components:i={},componentsProps:a,fullWidth:o=!1,hiddenLabel:s,inputComponent:c=`input`,multiline:l=!1,slotProps:u,slots:d={},type:f=`text`,...p}=n,m={...n,disableUnderline:r,fullWidth:o,inputComponent:c,multiline:l,type:f},h=mY(n),g={root:{ownerState:m},input:{ownerState:m}},_=u??a?Cn(g,u??a):g;return(0,G.jsx)(aY,{slots:{root:d.root??i.Root??hY,input:d.input??i.Input??gY},slotProps:_,fullWidth:o,inputComponent:c,multiline:l,ref:t,type:f,...p,classes:h})});_Y.muiName=`Input`,M();var vY,yY=J(`fieldset`,{name:`MuiNotchedOutlined`,shouldForwardProp:Fo})({textAlign:`left`,position:`absolute`,bottom:0,right:0,top:-5,left:0,margin:0,padding:`0 8px`,pointerEvents:`none`,borderRadius:`inherit`,borderStyle:`solid`,borderWidth:1,overflow:`hidden`,minWidth:`0%`}),bY=J(`legend`,{name:`MuiNotchedOutlined`,shouldForwardProp:Fo})(y_(({theme:e})=>({float:`unset`,width:`auto`,overflow:`hidden`,variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:`11px`,transition:e.transitions.create(`width`,{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:`block`,padding:0,height:11,fontSize:`0.75em`,visibility:`hidden`,maxWidth:.01,transition:e.transitions.create(`max-width`,{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:`nowrap`,"& > span":{paddingLeft:5,paddingRight:5,display:`inline-block`,opacity:0,visibility:`visible`}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:`100%`,transition:e.transitions.create(`max-width`,{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function xY(e){let{children:t,classes:n,className:r,label:i,notched:a,...o}=e,s=i!=null&&i!==``,c={...e,notched:a,withLabel:s};return(0,G.jsx)(yY,{"aria-hidden":!0,className:r,ownerState:c,...o,children:(0,G.jsx)(bY,{ownerState:c,children:s?(0,G.jsx)(`span`,{children:i}):vY||=(0,G.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`})})})}function SY(e){return Qr(`MuiOutlinedInput`,e)}var CY={...YJ,...$r(`MuiOutlinedInput`,[`root`,`notchedOutline`,`input`])};M();var wY=e=>{let{classes:t}=e,n=ba({root:[`root`],notchedOutline:[`notchedOutline`],input:[`input`]},SY,t);return{...t,...n}},TY=J(nY,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiOutlinedInput`,slot:`Root`,overridesResolver:$J})(y_(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`;return{position:`relative`,borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${CY.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${CY.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${CY.focused} .${CY.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{[`&.${CY.focused} .${CY.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${CY.error} .${CY.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${CY.disabled} .${CY.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:14}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:14}},{props:({ownerState:e})=>e.multiline,style:{padding:`16.5px 14px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{padding:`8.5px 14px`}}]}})),EY=J(xY,{name:`MuiOutlinedInput`,slot:`NotchedOutline`})(y_(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`;return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),DY=J(rY,{name:`MuiOutlinedInput`,slot:`Input`,overridesResolver:eY})(y_(({theme:e})=>({padding:`16.5px 14px`,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode===`light`?null:`0 0 0 100px #266798 inset`,WebkitTextFillColor:e.palette.mode===`light`?null:`#fff`,caretColor:e.palette.mode===`light`?null:`#fff`,borderRadius:`inherit`}},...e.vars&&{"&:-webkit-autofill":{borderRadius:`inherit`},[e.getColorSchemeSelector(`dark`)]:{"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 100px #266798 inset`,WebkitTextFillColor:`#fff`,caretColor:`#fff`}}},variants:[{props:{size:`small`},style:{padding:`8.5px 14px`}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),OY=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiOutlinedInput`}),{components:r={},fullWidth:i=!1,inputComponent:a=`input`,label:o,multiline:s=!1,notched:c,slots:l={},slotProps:u={},type:d=`text`,...f}=n,p=wY(n),m=ob(),h=ib({props:n,muiFormControl:m,states:[`color`,`disabled`,`error`,`focused`,`hiddenLabel`,`size`,`required`]}),g={...n,color:h.color||`primary`,disabled:h.disabled,error:h.error,focused:h.focused,formControl:m,fullWidth:i,hiddenLabel:h.hiddenLabel,multiline:s,size:h.size,type:d},_=l.root??r.Root??TY,v=l.input??r.Input??DY,[y,b]=T_(`notchedOutline`,{elementType:EY,className:p.notchedOutline,shouldForwardComponentProp:!0,ownerState:g,externalForwardedProps:{slots:l,slotProps:u},additionalProps:{label:o!=null&&o!==``&&h.required?(0,G.jsxs)(W.Fragment,{children:[o,` `,`*`]}):o}});return(0,G.jsx)(aY,{slots:{root:_,input:v},slotProps:u,renderSuffix:e=>(0,G.jsx)(y,{...b,notched:c===void 0?!!(e.startAdornment||e.filled||e.focused):c}),fullWidth:i,inputComponent:a,multiline:s,ref:t,type:d,...f,classes:{...p,notchedOutline:null}})});OY.muiName=`Input`,M();var kY=e=>{let{classes:t}=e,n=ba({root:[`root`]},OJ,t);return{...t,...n}},AY={name:`MuiSelect`,slot:`Root`,shouldForwardProp:e=>Fo(e)&&e!==`variant`},jY=J(dY,AY)(``),MY=J(OY,AY)(``),NY=J(_Y,AY)(``),PY=W.forwardRef(function(e,t){let n=_g({name:`MuiSelect`,props:e}),{autoWidth:r=!1,children:i,classes:a={},className:o,defaultOpen:s=!1,displayEmpty:c=!1,IconComponent:l=HJ,id:u,input:d,inputProps:f,label:p,labelId:m,MenuProps:h,multiple:g=!1,native:_=!1,onClose:v,onOpen:y,open:b,renderValue:x,SelectDisplayProps:S,variant:C=`outlined`,...w}=n,T=_?DJ:VJ,E=ib({props:n,muiFormControl:ob(),states:[`variant`,`error`]}),D=E.variant||C,O={...n,variant:D,classes:a},k=kY(O),{root:A,...j}=k,M=d||{standard:(0,G.jsx)(jY,{ownerState:O}),outlined:(0,G.jsx)(MY,{label:p,ownerState:O}),filled:(0,G.jsx)(NY,{ownerState:O})}[D],N=o_(t,Ag(M));return(0,G.jsx)(W.Fragment,{children:W.cloneElement(M,{inputComponent:T,inputProps:{children:i,error:E.error,IconComponent:l,variant:D,type:void 0,multiple:g,..._?{id:u}:{autoWidth:r,defaultOpen:s,displayEmpty:c,labelId:m,MenuProps:h,onClose:v,onOpen:y,open:b,renderValue:x,SelectDisplayProps:{id:u,...S}},...f,classes:f?Cn(j,f.classes):j,...d?d.props.inputProps:{}},...(g&&_||c)&&D===`outlined`?{notched:!0}:{},ref:N,className:K(M.props.className,o,k.root),...!d&&{variant:D},...w})})});PY.muiName=`Select`,M();function FY(e,t){if(t==null){e.focus();return}try{e.focus({focusVisible:t===`keyboard`})}catch{e.focus()}}var IY=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},LY=e=>{let{disabled:t,dense:n,divider:r,disableGutters:i,selected:a,classes:o}=e,s=ba({root:[`root`,n&&`dense`,t&&`disabled`,!i&&`gutters`,r&&`divider`,a&&`selected`]},vJ,o);return{...o,...s}},RY=J(gy,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiMenuItem`,slot:`Root`,overridesResolver:IY})(y_(({theme:e})=>({...e.typography.body1,display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:`border-box`,whiteSpace:`nowrap`,"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${yJ.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${yJ.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${yJ.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${yJ.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${yJ.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${cJ.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${cJ.inset}`]:{marginLeft:52},[`& .${_J.root}`]:{marginTop:0,marginBottom:0},[`& .${_J.inset}`]:{paddingLeft:36},[`& .${lJ.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up(`sm`)]:{minHeight:`auto`}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${lJ.root} svg`]:{fontSize:`1.25rem`}}}]}))),zY=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiMenuItem`}),{autoFocus:r=!1,component:i=`li`,dense:a=!1,divider:o=!1,disableGutters:s=!1,focusVisibleClassName:c,role:l=`menuitem`,tabIndex:u,className:d,...f}=n,p=PJ(),m=W.useContext(Vb),h=W.useMemo(()=>({dense:a||m.dense||!1,disableGutters:s}),[m.dense,a,s]),g=W.useRef(null);z_(()=>{r&&g.current&&FY(g.current,p)},[r]);let _={...n,dense:h.dense,divider:o,disableGutters:s},v=LY(n),y=o_(g,t),{root:b,...x}=v,S;return n.disabled||(S=u===void 0?-1:u),(0,G.jsx)(Vb.Provider,{value:h,children:(0,G.jsx)(RY,{ref:y,role:l,tabIndex:S,component:i,focusVisibleClassName:K(v.focusVisible,c),className:K(v.root,d),...f,ownerState:_,classes:x})})}),BY=()=>{document.querySelectorAll(`.mq-supsub.mq-sup-only`).forEach(e=>{let t=e.previousElementSibling;t&&t.classList.contains(`mq-non-leaf`)&&t.querySelector(`.mq-fraction`)?e.classList.add(`mq-after-fraction-group`):e.classList.remove(`mq-after-fraction-group`)})};M();var{commonMqFontStyles:VY,commonMqKeyboardStyles:HY,longdivStyles:UY,supsubStyles:WY}=aq,GY=ey(`@pie-lib:math-toolbar:editor-and-pad`),KY=/\.|,/g,qY=J(`div`)(({theme:e})=>({zIndex:9,position:`relative`,textAlign:`center`,width:`auto`,"& > .mq-math-mode":{border:`solid 1px lightgrey`},"& > .mq-focused":{outline:`none`,boxShadow:`none`,border:`dotted 1px ${e.palette.primary.main}`,borderRadius:`0px`},"& .mq-overarrow-inner":{border:`none !important`,paddingTop:`0 !important`},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-overarrow.mq-arrow-both":{top:`7.8px`,marginTop:`0px`,minWidth:`1.23em`},"& .mq-parallelogram":{lineHeight:.85}})),JY=J(`div`)(({theme:e,hide:t})=>({display:t?`none`:`flex`,alignItems:`center`,"& .mq-editable-field .mq-cursor":{top:`-4px`},"& .mq-math-mode .mq-selection, .mq-editable-field .mq-selection":{paddingTop:`18px`},"& .mq-math-mode .mq-overarrow":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& .mq-math-mode .mq-overline .mq-overline-inner":{paddingTop:`0.4em !important`},"& .mq-overarrow.mq-arrow-both":{minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.45em`,left:`-1px`},"&:after":{position:`absolute !important`,top:`0px !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& *":{...VY,...WY,...UY,"& .mq-math-mode .mq-sqrt-prefix":{verticalAlign:`baseline !important`,top:`1px !important`,left:`-0.1em !important`},"& .mq-math-mode .mq-overarc ":{paddingTop:`0.45em !important`},"& .mq-math-mode .mq-empty":{padding:`9px 1px !important`},"& .mq-math-mode .mq-root-block":{paddingTop:`10px`},"& .mq-scaled .mq-sqrt-prefix":{top:`0 !important`},"& .mq-math-mode .mq-longdiv .mq-longdiv-inner":{marginLeft:`4px !important`,paddingTop:`6px !important`,paddingLeft:`6px !important`},"& .mq-math-mode .mq-paren":{verticalAlign:`top !important`,padding:`1px 0.1em !important`},"& .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-math-mode .mq-denominator":{marginTop:`-5px !important`,padding:`0.5em 0.1em 0.1em !important`},"& .mq-math-mode .mq-numerator, .mq-math-mode .mq-over":{padding:`0 0.1em !important`,paddingBottom:`0 !important`,marginBottom:`-2px`}},'& span[data-prime="true"]':{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}})),YY=J(Cb)({flex:`initial`,width:`25%`,minWidth:`100px`,marginLeft:`15px`,marginTop:`5px`,marginBottom:`5px`,marginRight:`5px`,"& label":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& div":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}),XY=J(gb)(()=>({backgroundColor:`transparent`})),ZY=J(`div`)(({theme:e,error:t})=>({minWidth:`500px`,maxWidth:`900px`,minHeight:`30px`,width:`100%`,display:`flex`,marginTop:e.spacing(1),marginBottom:e.spacing(1),...t&&{border:`2px solid red`},"& .mq-sqrt-prefix .mq-scaled":{verticalAlign:`middle !important`}})),QY=J(Rq)(({controlledKeypadMode:e})=>({maxWidth:e?`400px`:`500px`,color:iv(),backgroundColor:Tv(),padding:`2px`})),$Y=J(Wy)({position:`absolute`,right:`12px`,border:`1px solid lightgrey`,color:iv()}),eX=J(`hr`)(({theme:e})=>({padding:0,margin:0,height:`1px`,border:`none`,borderBottom:`solid 1px ${e.palette.primary.main}`})),tX=J(Dq)(({mode:e})=>({...HY,...e===`language`&&{"& *":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}})),nX=e=>{if(!e)return;let{type:t,value:n}=e;return t===`command`||t===`cursor`?e:t===`answer`?{type:`answer`,...e}:n===`clear`?{type:`clear`}:{type:`write`,value:n}},rX=class extends W.Component{static propTypes={classNames:j.object,keypadMode:j.oneOfType([j.string,j.number]),autoFocus:j.bool,allowAnswerBlock:j.bool,showKeypad:j.bool,controlledKeypad:j.bool,controlledKeypadMode:j.bool,error:j.string,noDecimal:j.bool,hideInput:j.bool,noLatexHandling:j.bool,layoutForKeyPad:j.object,maxResponseAreas:j.number,additionalKeys:j.array,latex:j.string.isRequired,onAnswerBlockAdd:j.func,onFocus:j.func,onBlur:j.func,onChange:j.func.isRequired,setKeypadInteraction:j.func};constructor(e){super(e),this.state={equationEditor:`item-authoring`,addDisabled:!1}}componentDidMount(){this.input&&this.props.autoFocus&&this.input.focus()}onClick=e=>{let{noDecimal:t,noLatexHandling:n,onChange:r}=this.props,i=nX(e);if(GY(`mathChange: `,i),n){r(i.value);return}t&&(i.value===`.`||i.value===`,`)||i&&(i.type===`clear`?(GY(`call clear...`),this.input.clear()):i.type===`command`?this.input.command(i.value):i.type===`cursor`?this.input.keystroke(i.value):i.type===`answer`?this.input.write(`%response%`):this.input.write(i.value))};updateDisable=e=>{let{maxResponseAreas:t}=this.props;if(t){let n=this.checkResponseAreasNumber(t,e);this.setState({addDisabled:n})}};onAnswerBlockClick=()=>{this.props.onAnswerBlockAdd(),this.onClick({type:`answer`}),this.updateDisable(!0)};onEditorChange=e=>{let{onChange:t,noDecimal:n}=this.props;if(VK(),BY(),this.updateDisable(!0),n&&(e.indexOf(`.`)!==-1||e.indexOf(`,`)!==-1)&&this.input){this.input.clear(),this.input.write(e.replace(KY,``));return}let r=e.match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);if(this.input&&r&&r?.length){try{this.input.mathField.__controller.cursor.insLeftOf(this.input.mathField.__controller.cursor.parent[-1].parent),this.input.mathField.el().dispatchEvent(new KeyboardEvent(`keydown`,{keyCode:8}))}catch(e){console.error(e.toString())}return}t(e)};shouldComponentUpdate(e,t){let n=this.input.mathField.latex()!==e.latex;return GY(`[shouldComponentUpdate] `,`inputIsDifferent: `,n),!mp(this.props.error,e.error)||!n&&this.props.keypadMode!==e.keypadMode||!n&&this.props.noDecimal!==e.noDecimal||!n&&this.state.equationEditor!==t.equationEditor?!0:!n&&this.props.controlledKeypad?this.props.showKeypad!==e.showKeypad:n}onEditorTypeChange=e=>{this.setState({equationEditor:e.target.value})};checkResponseAreasNumber=(e,t)=>{let{latex:n}=this.input&&this.input.props||{};if(n){let r=(n.match(/answerBlock/g)||[]).length;return t?r===e-1:r===e}return!1};render(){let{classNames:e,keypadMode:t,allowAnswerBlock:n,additionalKeys:r,controlledKeypad:i,controlledKeypadMode:a,showKeypad:o,setKeypadInteraction:s,noDecimal:c,hideInput:l,layoutForKeyPad:u,latex:d,onFocus:f,onBlur:p,error:m}=this.props,h=!i||i&&o,{addDisabled:g}=this.state;return GY(`[render]`,d),(0,G.jsxs)(qY,{className:e.mathToolbar,children:[(0,G.jsxs)(JY,{hide:l,children:[a&&(0,G.jsxs)(YY,{variant:`standard`,children:[(0,G.jsx)(XY,{id:`equation-editor-label`,children:`Equation Editor`}),(0,G.jsxs)(PY,{labelId:`equation-editor-label`,id:`equation-editor-select`,name:`equationEditor`,label:`Equation Editor`,onChange:this.onEditorTypeChange,value:this.state.equationEditor,MenuProps:{transitionDuration:{enter:225,exit:195}},children:[(0,G.jsx)(zY,{value:`non-negative-integers`,children:`Numeric - Non-Negative Integers`}),(0,G.jsx)(zY,{value:`integers`,children:`Numeric - Integers`}),(0,G.jsx)(zY,{value:`decimals`,children:`Numeric - Decimals`}),(0,G.jsx)(zY,{value:`fractions`,children:`Numeric - Fractions`}),(0,G.jsx)(zY,{value:1,children:`Grade 1 - 2`}),(0,G.jsx)(zY,{value:3,children:`Grade 3 - 5`}),(0,G.jsx)(zY,{value:6,children:`Grade 6 - 7`}),(0,G.jsx)(zY,{value:8,children:`Grade 8 - HS`}),(0,G.jsx)(zY,{value:`geometry`,children:`Geometry`}),(0,G.jsx)(zY,{value:`advanced-algebra`,children:`Advanced Algebra`}),(0,G.jsx)(zY,{value:`statistics`,children:`Statistics`}),(0,G.jsx)(zY,{value:`item-authoring`,children:`Item Authoring`})]})]}),(0,G.jsx)(ZY,{error:m,children:(0,G.jsx)(QY,{onFocus:()=>{f&&f(),this.updateDisable(!1)},onBlur:e=>{this.updateDisable(!1),p&&p(e)},className:e&&e.editor||``,controlledKeypadMode:a,ref:e=>this.input=e,latex:d,onChange:this.onEditorChange})})]}),n&&(0,G.jsx)($Y,{type:`primary`,style:{bottom:h?`320px`:`20px`},onClick:this.onAnswerBlockClick,disabled:g,children:`+ Response Area`}),(0,G.jsx)(eX,{}),h&&(0,G.jsx)(tX,{mode:a?this.state.equationEditor:t,controlledKeypadMode:a,layoutForKeyPad:u,additionalKeys:r,onClick:this.onClick,noDecimal:c,setKeypadInteraction:s})]})}};M();var iX=J(mV)(({theme:e,hideBackground:t})=>({verticalAlign:`top`,width:`28px`,height:`28px`,color:`#00bb00`,...t&&{backgroundColor:e.palette.common.white,"&:hover":{backgroundColor:e.palette.grey[200]}},"& .MuiIconButton-label":{position:`absolute`,top:`2px`}})),aX=({onClick:e,hideBackground:t})=>(0,G.jsx)(iX,{"aria-label":`Done`,onClick:e,hideBackground:t,size:`large`,children:(0,G.jsx)(_V,{})});aX.propTypes={onClick:j.func,hideBackground:j.bool};var oX=aX;M();var{commonMqFontStyles:sX,longdivStyles:cX,supsubStyles:lX}=aq,uX=ey(`@pie-lib:math-toolbar:math-preview`),dX=J(`div`)(({theme:e,isSelected:t})=>({display:`inline-flex`,alignItems:`center`,position:`relative`,"& *":sX,...lX,...cX,"& > .mq-math-mode":{border:t?`solid 0px lightgrey`:`solid 1px lightgrey`},"& > .mq-focused":{outline:`none`,boxShadow:`none`,border:`solid 1px black`,borderRadius:`0px`},"& > .mq-math-mode .mq-root-block":{paddingTop:`7px !important`},"& > .mq-math-mode .mq-overarc ":{paddingTop:`0.45em !important`},"& > .mq-math-mode .mq-sqrt-prefix":{verticalAlign:`baseline !important`,top:`1px !important`,left:`-0.1em !important`},"& > .mq-math-mode .mq-denominator":{marginTop:`-5px !important`,padding:`0.5em 0.1em 0.1em !important`},"& > .mq-math-mode .mq-numerator, .mq-math-mode .mq-over":{padding:`0 0.1em !important`,paddingBottom:`0 !important`,marginBottom:`-2px`},"& > .mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty":{paddingTop:`6px !important`,paddingLeft:`4px !important`},"& > .mq-math-mode .mq-longdiv .mq-longdiv-inner":{marginLeft:`0 !important`},"& > .mq-math-mode .mq-overarrow":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},"& > .mq-math-mode .mq-paren":{verticalAlign:`top !important`,padding:`1px 0.1em !important`},"& > .mq-math-mode .mq-sqrt-stem":{borderTop:`0.07em solid`,marginLeft:`-1.5px`,marginTop:`-2px !important`,paddingTop:`5px !important`},"& .mq-overarrow-inner":{paddingTop:`0 !important`,border:`none !important`},"& .mq-editable-field .mq-cursor":{marginTop:`-15px !important`},"& .mq-overarrow.mq-arrow-both":{top:`7.5px`,marginTop:`0px`,minWidth:`1.23em`,"& *":{lineHeight:`1 !important`},"&:before":{top:`-0.4em`,left:`-1px`},"&:after":{top:`0px !important`,position:`absolute !important`,right:`-2px`},"&.mq-empty:after":{top:`-0.45em`}},"& .mq-overarrow.mq-arrow-right":{"&:before":{top:`-0.4em`,right:`-1px`}},"& .mq-overarrow-inner-right":{display:`none !important`},"& .mq-overarrow-inner-left":{display:`none !important`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-parallelogram":{lineHeight:.85},'& span[data-prime="true"]':{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`},...t&&{border:`solid 1px ${e.palette.primary.main}`}})),fX=J(`span`)({position:`absolute`,bottom:0,left:0,right:0,top:0}),pX=class extends W.Component{static propTypes={latex:j.string,isSelected:j.bool,onFocus:j.func,onBlur:j.func};componentDidMount(){BY()}componentDidUpdate(e){this.props.latex!==e.latex&&BY()}render(){let{isSelected:e,onFocus:t,onBlur:n,latex:r}=this.props;return uX(`[render] latex: `,r),(0,G.jsxs)(dX,{isSelected:e,children:[` `,(0,G.jsx)(fX,{}),(0,G.jsx)(Gq,{latex:r,onFocus:t,onBlur:n})]})}};M();var mX=J(`div`)({display:`flex`,width:`100%`,zIndex:8,alignItems:`center`}),hX=class extends W.Component{static propTypes={autoFocus:j.bool,allowAnswerBlock:j.bool,controlledKeypad:j.bool,controlledKeypadMode:j.bool,keypadMode:j.oneOfType([j.string,j.number]),classNames:j.object,error:j.string,maxResponseAreas:j.number,showKeypad:j.bool,noDecimal:j.bool,additionalKeys:j.array,latex:j.string.isRequired,onAnswerBlockAdd:j.func,onChange:j.func,onDone:j.func.isRequired,onFocus:j.func,onBlur:j.func,hideDoneButton:j.bool,keyPadCharacterRef:j.func,setKeypadInteraction:j.func};static defaultProps={classNames:{},keypadMode:`item-authoring`,autoFocus:!1,allowAnswerBlock:!1,controlledKeypad:!1,controlledKeypadMode:!1,noDecimal:!1,showKeypad:!0,additionalKeys:[],onChange:()=>{},onAnswerBlockAdd:()=>{},onFocus:()=>{},hideDoneButton:!1};constructor(e){super(e),this.state={latex:e.latex}}done=()=>{this.props.onDone(this.state.latex)};UNSAFE_componentWillReceiveProps(e){this.setState({latex:e.latex})}onChange=e=>{this.setState({latex:e}),this.props.onChange(e)};render(){let{latex:e}=this.state,{classNames:t,autoFocus:n,allowAnswerBlock:r,onAnswerBlockAdd:i,controlledKeypad:a,controlledKeypadMode:o,keypadMode:s,noDecimal:c,additionalKeys:l,showKeypad:u,onFocus:d,onBlur:f,hideDoneButton:p,error:m,keyPadCharacterRef:h,setKeypadInteraction:g,maxResponseAreas:_}=this.props;return(0,G.jsx)(gX,{autoFocus:n,classNames:t,onAnswerBlockAdd:i,allowAnswerBlock:r,latex:e,additionalKeys:l,noDecimal:c,keypadMode:s,keyPadCharacterRef:h,setKeypadInteraction:g,onChange:this.onChange,onDone:this.done,onFocus:d,onBlur:f,showKeypad:u,controlledKeypad:a,controlledKeypadMode:o,hideDoneButton:p,error:m,maxResponseAreas:_})}},gX=class extends W.Component{static propTypes={classNames:j.object,latex:j.string.isRequired,keypadMode:j.oneOfType([j.string,j.number]),hideInput:j.bool,noLatexHandling:j.bool,layoutForKeyPad:j.object,onChange:j.func.isRequired,onDone:j.func.isRequired,onBlur:j.func,onAnswerBlockAdd:j.func,additionalKeys:j.array,onFocus:j.func,autoFocus:j.bool,noDecimal:j.bool,allowAnswerBlock:j.bool,controlledKeypad:j.bool,controlledKeypadMode:j.bool,showKeypad:j.bool,hideDoneButton:j.bool,hideDoneButtonBackground:j.bool,error:j.any,maxResponseAreas:j.number,keyPadCharacterRef:j.object,setKeypadInteraction:j.func};static defaultProps={classNames:{},hideDoneButtonBackground:!1};render(){let{classNames:e,autoFocus:t,allowAnswerBlock:n,onAnswerBlockAdd:r,controlledKeypad:i,controlledKeypadMode:a,additionalKeys:o,showKeypad:s,keypadMode:c,noDecimal:l,hideInput:u,noLatexHandling:d,layoutForKeyPad:f,keyPadCharacterRef:p,setKeypadInteraction:m,latex:h,onChange:g,onDone:_,onFocus:v,onBlur:y,hideDoneButton:b,hideDoneButtonBackground:x,error:S,maxResponseAreas:C}=this.props;return(0,G.jsxs)(mX,{className:e&&e.toolbar||``,ref:p,children:[(0,G.jsx)(`div`,{}),(0,G.jsx)(rX,{autoFocus:t,keypadMode:c,classNames:e||{},controlledKeypad:i,controlledKeypadMode:a,noDecimal:l,hideInput:u,noLatexHandling:d,layoutForKeyPad:f,showKeypad:s,additionalKeys:o,allowAnswerBlock:n,onAnswerBlockAdd:r,latex:h,onChange:g,onFocus:v,onBlur:y,error:S,maxResponseAreas:C,setKeypadInteraction:m}),(!i||i&&s)&&!b&&(0,G.jsx)(oX,{hideBackground:x,onClick:_})]})}},_X=new cw(`ensureTextAfterMath`),vX=(e=[])=>e.map(e=>({name:e,latex:e,write:e,label:e})),yX=e=>new aw({key:_X,appendTransaction:(t,n,r)=>{if(!t.some(e=>e.docChanged))return null;let i=r.tr,a=!1;return r.doc.descendants((t,n)=>{if(t.type.name===e){let e=n+t.nodeSize,o=r.doc.nodeAt(e);(!o||o.type.name!==`text`)&&(i.insert(e,r.schema.text(`​`)),a=!0)}}),a?i:null}}),bX=new aw({key:new cw(`zeroWidthSpaceHandling`),props:{handleKeyDown(e,t){let{state:n,dispatch:r}=e,{selection:i,doc:a}=n,{from:o,empty:s}=i;if(s&&t.key===`Backspace`&&o>0&&a.textBetween(o-1,o,``,``)===`​`)return r(n.tr.delete(o-2,o)),!0;if(s&&t.key===`ArrowLeft`&&o>0&&a.textBetween(o-1,o,``,``)===`​`){let e=o-1,t=n.doc.resolve(e-1),i=t.nodeAfter||t.nodeBefore;if(i){let t=e-i.nodeSize,a=n.doc.resolve(t);return r(n.tr.setSelection(UC.create(n.doc,a.pos))),!0}else return r(n.tr.setSelection(VC.create(n.doc,o-2))),!0}return!1}}}),xX=SM.create({name:`math`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{latex:{default:``},wrapper:{default:null},html:{default:null}}},addProseMirrorPlugins(){return[yX(this.name),bX]},parseHTML(){return[{tag:`span[data-latex]`,getAttrs:e=>({latex:e.getAttribute(`data-raw`)||e.textContent})},{tag:`span[data-type="mathml"]`,getAttrs:e=>({html:e.innerHTML})}]},addCommands(){return{insertMath:(e=``)=>({tr:t,editor:n,dispatch:r})=>{let{state:i}=n.view,a=i.schema.nodes.math.create({latex:e}),{selection:o}=i,s=o.$from.pos;if(t.insert(s,a),a?.type?.name===this.name){let e=UC.create(t.doc,o.$from.pos);t.setSelection(e)}return r(t),!0}}},renderHTML({HTMLAttributes:e}){return e.html?[`span`,{"data-type":`mathml`,dangerouslySetInnerHTML:{__html:e.html}}]:[`span`,{"data-latex":``,"data-raw":e.latex},O(e.latex,e.wrapper)]},addNodeView(){return eN(e=>(0,G.jsx)(SX,{...e,options:this.options}))}}),SX=e=>{let{node:t,updateAttributes:n,editor:r,selected:i,options:a}=e,[o,s]=(0,W.useState)(i),c=(0,W.useRef)(null),[l,u]=(0,W.useState)({top:0,left:0}),{math:d={}}=a||{},{keypadMode:f,controlledKeypadMode:p=!0,customKeys:m=[],keyPadCharacterRef:h,setKeypadInteraction:g}=d,_=t.attrs.latex||``;return(0,W.useEffect)(()=>{i&&s(!0)},[i]),(0,W.useEffect)(()=>{r._toolbarOpened=!!o},[o]),(0,W.useEffect)(()=>{let e=(r?._tiptapContainerEl||document.body).getBoundingClientRect(),{from:t}=r.state.selection,n=r.view.coordsAtPos(t);u({top:n.top+Math.abs(e.top)+40,left:n.left});let i=e=>{let t=e?.target,n=(document.querySelectorAll?.(`[id^="equation-editor-select"][id*="listbox"], [aria-labelledby="equation-editor-label"][role="listbox"]`)||[]).length>0,r=!!(t?.id&&t.id.includes(`equation-editor-select`))||!!t?.closest?.(`[id*="equation-editor-select"]`),i=!!t?.closest?.(`.math-node`);c.current&&!c.current.contains(t)&&!t?.closest?.(`[data-inline-node]`)&&!n&&!r&&!i&&s(!1)};return o?document.addEventListener(`click`,i):document.removeEventListener(`click`,i),()=>document.removeEventListener(`click`,i)},[r,o]),(0,G.jsxs)(KM,{className:`math-node`,style:{display:`inline-flex`,cursor:`pointer`,margin:`0 4px`},"data-selected":i,children:[(0,G.jsx)(`div`,{onClick:()=>s(!0),contentEditable:!1,children:(0,G.jsx)(pX,{latex:_})}),o&&Vg.createPortal((0,G.jsx)(`div`,{ref:c,"data-toolbar-for":r.instanceId,style:{position:`absolute`,top:`${l.top}px`,left:`${l.left}px`,zIndex:20,background:`var(--editable-html-toolbar-bg, #efefef)`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`},children:(0,G.jsx)(hX,{latex:_,autoFocus:!0,onChange:e=>{n({latex:e})},onDone:e=>{n({latex:e}),s(!1),r._toolbarOpened=!1;let{selection:t,tr:i,doc:a}=r.state,o=VC.create(a,t.from+1);i.setSelection(o),r.view.dispatch(i),r.commands.focus()},keypadMode:f,controlledKeypadMode:p,additionalKeys:vX(m),keyPadCharacterRef:h,setKeypadInteraction:g})}),r?._tiptapContainerEl||document.body)]})};function CX(e){return Qr(`MuiLinearProgress`,e)}$r(`MuiLinearProgress`,[`root`,`colorPrimary`,`colorSecondary`,`determinate`,`indeterminate`,`buffer`,`query`,`dashed`,`dashedColorPrimary`,`dashedColorSecondary`,`bar`,`bar1`,`bar2`,`barColorPrimary`,`barColorSecondary`,`bar1Indeterminate`,`bar1Determinate`,`bar1Buffer`,`bar2Indeterminate`,`bar2Buffer`]),M();var wX=4,TX=Kt`
317
- 0% {
318
- left: -35%;
319
- right: 100%;
320
- }
321
-
322
- 60% {
323
- left: 100%;
324
- right: -90%;
325
- }
326
-
327
- 100% {
328
- left: 100%;
329
- right: -90%;
330
- }
331
- `,EX=typeof TX==`string`?null:Gt`
332
- animation: ${TX} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
333
- `,DX=Kt`
334
- 0% {
335
- left: -200%;
336
- right: 100%;
337
- }
338
-
339
- 60% {
340
- left: 107%;
341
- right: -8%;
342
- }
343
-
344
- 100% {
345
- left: 107%;
346
- right: -8%;
347
- }
348
- `,OX=typeof DX==`string`?null:Gt`
349
- animation: ${DX} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
350
- `,kX=Kt`
351
- 0% {
352
- opacity: 1;
353
- background-position: 0 -23px;
354
- }
355
-
356
- 60% {
357
- opacity: 0;
358
- background-position: 0 -23px;
359
- }
360
-
361
- 100% {
362
- opacity: 1;
363
- background-position: -200px -23px;
364
- }
365
- `,AX=typeof kX==`string`?null:Gt`
366
- animation: ${kX} 3s infinite linear;
367
- `,jX=e=>{let{classes:t,variant:n,color:r}=e;return ba({root:[`root`,`color${P_(r)}`,n],dashed:[`dashed`,`dashedColor${P_(r)}`],bar1:[`bar`,`bar1`,`barColor${P_(r)}`,(n===`indeterminate`||n===`query`)&&`bar1Indeterminate`,n===`determinate`&&`bar1Determinate`,n===`buffer`&&`bar1Buffer`],bar2:[`bar`,`bar2`,n!==`buffer`&&`barColor${P_(r)}`,n===`buffer`&&`color${P_(r)}`,(n===`indeterminate`||n===`query`)&&`bar2Indeterminate`,n===`buffer`&&`bar2Buffer`]},CX,t)},MX=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),NX=J(`span`,{name:`MuiLinearProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${P_(n.color)}`],t[n.variant]]}})(y_(({theme:e})=>({position:`relative`,overflow:`hidden`,display:`block`,height:4,zIndex:0,"@media print":{colorAdjust:`exact`},variants:[...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{backgroundColor:MX(e,t)}})),{props:({ownerState:e})=>e.color===`inherit`&&e.variant!==`buffer`,style:{"&::before":{content:`""`,position:`absolute`,left:0,top:0,right:0,bottom:0,backgroundColor:`currentColor`,opacity:.3}}},{props:{variant:`buffer`},style:{backgroundColor:`transparent`}},{props:{variant:`query`},style:{transform:`rotate(180deg)`}}]}))),PX=J(`span`,{name:`MuiLinearProgress`,slot:`Dashed`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.dashed,t[`dashedColor${P_(n.color)}`]]}})(y_(({theme:e})=>({position:`absolute`,marginTop:0,height:`100%`,width:`100%`,backgroundSize:`10px 10px`,backgroundPosition:`0 -23px`,variants:[{props:{color:`inherit`},style:{opacity:.3,backgroundImage:`radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)`}},...Object.entries(e.palette).filter(by()).map(([t])=>{let n=MX(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),AX||{animation:`${kX} 3s infinite linear`}),FX=J(`span`,{name:`MuiLinearProgress`,slot:`Bar1`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${P_(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar1Indeterminate,n.variant===`determinate`&&t.bar1Determinate,n.variant===`buffer`&&t.bar1Buffer]}})(y_(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[{props:{color:`inherit`},style:{backgroundColor:`currentColor`}},...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:`determinate`},style:{transition:`transform .${wX}s linear`}},{props:{variant:`buffer`},style:{zIndex:1,transition:`transform .${wX}s linear`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:EX||{animation:`${TX} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),IX=J(`span`,{name:`MuiLinearProgress`,slot:`Bar2`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${P_(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar2Indeterminate,n.variant===`buffer`&&t.bar2Buffer]}})(y_(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:e})=>e.variant!==`buffer`&&e.color!==`inherit`,style:{backgroundColor:`var(--LinearProgressBar2-barColor, currentColor)`}},{props:({ownerState:e})=>e.variant!==`buffer`&&e.color===`inherit`,style:{backgroundColor:`currentColor`}},{props:{color:`inherit`},style:{opacity:.3}},...Object.entries(e.palette).filter(by()).map(([t])=>({props:{color:t,variant:`buffer`},style:{backgroundColor:MX(e,t),transition:`transform .${wX}s linear`}})),{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:OX||{animation:`${DX} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),LX=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiLinearProgress`}),{className:r,color:i=`primary`,value:a,valueBuffer:o,variant:s=`indeterminate`,...c}=n,l={...n,color:i,variant:s},u=jX(l),d=zi(),f={},p={bar1:{},bar2:{}};if((s===`determinate`||s===`buffer`)&&a!==void 0){f[`aria-valuenow`]=Math.round(a),f[`aria-valuemin`]=0,f[`aria-valuemax`]=100;let e=a-100;d&&(e=-e),p.bar1.transform=`translateX(${e}%)`}if(s===`buffer`&&o!==void 0){let e=(o||0)-100;d&&(e=-e),p.bar2.transform=`translateX(${e}%)`}return(0,G.jsxs)(NX,{className:K(u.root,r),ownerState:l,role:`progressbar`,...f,ref:t,...c,children:[s===`buffer`?(0,G.jsx)(PX,{className:u.dashed,ownerState:l}):null,(0,G.jsx)(FX,{className:u.bar1,ownerState:l,style:p.bar1}),s===`determinate`?null:(0,G.jsx)(IX,{className:u.bar2,ownerState:l,style:p.bar2})]})}),RX=ey(`@pie-lib:editable-html:image:insert-image-handler`),zX=class{constructor(e,t,n,r=!1){this.editor=e,this.nodeInfo=t,this.node=t[0],this.nodePos=t[1],this.onFinish=n,this.isPasted=r,this.chosenFile=null}cancel(){RX(`insert cancelled`);try{this.deleteNode(),this.onFinish(!1)}catch{}finally{this.editor._insertingImage=!1}}updateNode(e){let{state:t,view:n}=this.editor,{tr:r}=t,i=t.doc.nodeAt(this.nodePos);if(i){let t=r.setNodeMarkup(this.nodePos,void 0,{...i.attrs,...e});n.dispatch(t)}}deleteNode(){let{state:e,view:t}=this.editor,{tr:n}=e,r=n.delete(this.nodePos,this.nodePos+this.node.nodeSize);t.dispatch(r)}done(e,t){RX(`done: err:`,e),e?(console.log(e),this.onFinish(!1)):(this.updateNode({loaded:!0,src:t,percent:100}),this.onFinish(!0)),this.editor._insertingImage=!1}fileChosen(e){if(!e)return;this.chosenFile=e,this.editor._insertingImage=!1,RX(`[fileChosen] file: `,e);let t=new FileReader;t.onload=()=>{let e=t.result;this.updateNode({src:e})},t.readAsDataURL(e)}progress(e,t,n){RX(`progress: `,e,t,n),this.updateNode({percent:e})}getChosenFile(){return this.chosenFile}};function BX(e){return Qr(`MuiDialogContent`,e)}$r(`MuiDialogContent`,[`root`,`dividers`]);function VX(e){return Qr(`MuiDialogTitle`,e)}var HX=$r(`MuiDialogTitle`,[`root`]);M();var UX=e=>{let{classes:t,dividers:n}=e;return ba({root:[`root`,n&&`dividers`]},BX,t)},WX=J(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(y_(({theme:e})=>({flex:`1 1 auto`,WebkitOverflowScrolling:`touch`,overflowY:`auto`,padding:`20px 24px`,variants:[{props:({ownerState:e})=>e.dividers,style:{padding:`16px 24px`,borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${HX.root} + &`]:{paddingTop:0}}}]}))),GX=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...a}=n,o={...n,dividers:i};return(0,G.jsx)(WX,{className:K(UX(o).root,r),ownerState:o,ref:t,...a})}),KX=L_((0,G.jsx)(`path`,{d:`M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z`}),`ArrowBackIos`);function qX(e){return Qr(`MuiFormHelperText`,e)}var JX=$r(`MuiFormHelperText`,[`root`,`error`,`disabled`,`sizeSmall`,`sizeMedium`,`contained`,`focused`,`filled`,`required`]);M();var YX,XX=e=>{let{classes:t,contained:n,size:r,disabled:i,error:a,filled:o,focused:s,required:c}=e;return ba({root:[`root`,i&&`disabled`,a&&`error`,r&&`size${P_(r)}`,n&&`contained`,s&&`focused`,o&&`filled`,c&&`required`]},qX,t)},ZX=J(`p`,{name:`MuiFormHelperText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${P_(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(y_(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:`left`,marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${JX.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${JX.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:`small`},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),QX=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiFormHelperText`}),{children:r,className:i,component:a=`p`,disabled:o,error:s,filled:c,focused:l,margin:u,required:d,variant:f,...p}=n,m=ib({props:n,muiFormControl:ob(),states:[`variant`,`size`,`disabled`,`error`,`filled`,`focused`,`required`]}),h={...n,component:a,contained:m.variant===`filled`||m.variant===`outlined`,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};return delete h.ownerState,(0,G.jsx)(ZX,{as:a,className:K(XX(h).root,i),ref:t,...p,ownerState:h,children:r===` `?YX||=(0,G.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):r})});function $X(e){return Qr(`MuiTextField`,e)}$r(`MuiTextField`,[`root`]),M();var eZ={standard:dY,filled:_Y,outlined:OY},tZ=e=>{let{classes:t}=e;return ba({root:[`root`]},$X,t)},nZ=J(Cb,{name:`MuiTextField`,slot:`Root`})({}),rZ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiTextField`}),{autoComplete:r,autoFocus:i=!1,children:a,className:o,color:s=`primary`,defaultValue:c,disabled:l=!1,error:u=!1,FormHelperTextProps:d,fullWidth:f=!1,helperText:p,id:m,InputLabelProps:h,inputProps:g,InputProps:_,inputRef:v,label:y,maxRows:b,minRows:x,multiline:S=!1,name:C,onBlur:w,onChange:T,onFocus:E,placeholder:D,required:O=!1,rows:k,select:A=!1,SelectProps:j,slots:M={},slotProps:N={},type:P,value:F,variant:ee=`outlined`,...te}=n,I={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:f,multiline:S,required:O,select:A,variant:ee},ne=tZ(I),re=qi(m),ie=p&&re?`${re}-helper-text`:void 0,L=y&&re?`${re}-label`:void 0,R=eZ[ee],ae={slots:M,slotProps:{input:_,inputLabel:h,htmlInput:g,formHelperText:d,select:j,...N}},z={},B=ae.slotProps.inputLabel;ee===`outlined`&&(B&&B.shrink!==void 0&&(z.notched=B.shrink),z.label=y),A&&((!j||!j.native)&&(z.id=void 0),z[`aria-describedby`]=void 0);let[oe,se]=T_(`root`,{elementType:nZ,shouldForwardComponentProp:!0,externalForwardedProps:{...ae,...te},ownerState:I,className:K(ne.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:f,required:O,color:s,variant:ee}}),[ce,V]=T_(`input`,{elementType:R,externalForwardedProps:ae,additionalProps:z,ownerState:I}),[le,ue]=T_(`inputLabel`,{elementType:gb,externalForwardedProps:ae,ownerState:I}),[de,H]=T_(`htmlInput`,{elementType:`input`,externalForwardedProps:ae,ownerState:I}),[fe,pe]=T_(`formHelperText`,{elementType:QX,externalForwardedProps:ae,ownerState:I}),[me,he]=T_(`select`,{elementType:PY,externalForwardedProps:ae,ownerState:I}),ge=(0,G.jsx)(ce,{"aria-describedby":ie,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:f,multiline:S,name:C,rows:k,maxRows:b,minRows:x,type:P,value:F,id:re,inputRef:v,onBlur:w,onChange:T,onFocus:E,placeholder:D,inputProps:H,slots:{input:M.htmlInput?de:void 0},...V});return(0,G.jsxs)(oe,{...se,children:[y!=null&&y!==``&&(0,G.jsx)(le,{htmlFor:re,id:L,...ue,children:y}),A?(0,G.jsx)(me,{"aria-describedby":ie,id:re,labelId:L,value:F,input:ge,...he,children:a}):ge,p&&(0,G.jsx)(fe,{id:ie,...pe,children:p})]})});function iZ(e){return Qr(`MuiDialogActions`,e)}$r(`MuiDialogActions`,[`root`,`spacing`]),M();var aZ=e=>{let{classes:t,disableSpacing:n}=e;return ba({root:[`root`,!n&&`spacing`]},iZ,t)},oZ=J(`div`,{name:`MuiDialogActions`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:`flex`,alignItems:`center`,padding:8,justifyContent:`flex-end`,flex:`0 0 auto`,variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),sZ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...a}=n,o={...n,disableSpacing:i};return(0,G.jsx)(oZ,{className:K(aZ(o).root,r),ownerState:o,ref:t,...a})});function cZ(e){return Qr(`MuiDialog`,e)}var lZ=$r(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperScrollPaper`,`paperScrollBody`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]),uZ=W.createContext({});M();var dZ=J(D_,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),fZ=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:a}=e;return ba({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${P_(n)}`],paper:[`paper`,`paperScroll${P_(n)}`,`paperWidth${P_(String(r))}`,i&&`paperFullWidth`,a&&`paperFullScreen`]},cZ,t)},pZ=J(M_,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),mZ=J(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${P_(n.scroll)}`]]}})({height:`100%`,"@media print":{height:`auto`},outline:0,variants:[{props:{scroll:`paper`},style:{display:`flex`,justifyContent:`center`,alignItems:`center`}},{props:{scroll:`body`},style:{overflowY:`auto`,overflowX:`hidden`,textAlign:`center`,"&::after":{content:`""`,display:`inline-block`,verticalAlign:`middle`,height:`100%`,width:`0`}}}]}),hZ=J(N_,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${P_(n.scroll)}`],t[`paperWidth${P_(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(y_(({theme:e})=>({margin:32,position:`relative`,overflowY:`auto`,"@media print":{overflowY:`visible`,boxShadow:`none`},variants:[{props:{scroll:`paper`},style:{display:`flex`,flexDirection:`column`,maxHeight:`calc(100% - 64px)`}},{props:{scroll:`body`},style:{display:`inline-block`,verticalAlign:`middle`,textAlign:`initial`}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:`calc(100% - 64px)`}},{props:{maxWidth:`xs`},style:{maxWidth:e.breakpoints.unit===`px`?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${lZ.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:`calc(100% - 64px)`}}}},...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${lZ.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:`calc(100% - 64px)`}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:`calc(100% - 64px)`}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:`100%`,maxWidth:`100%`,height:`100%`,maxHeight:`none`,borderRadius:0,[`&.${lZ.paperScrollBody}`]:{margin:0,maxWidth:`100%`}}}]}))),gZ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiDialog`}),r=No(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":o,"aria-modal":s=!0,BackdropComponent:c,BackdropProps:l,children:u,className:d,disableEscapeKeyDown:f=!1,fullScreen:p=!1,fullWidth:m=!1,maxWidth:h=`sm`,onClick:g,onClose:_,open:v,PaperComponent:y=N_,PaperProps:b={},role:x=`dialog`,scroll:S=`paper`,slots:C={},slotProps:w={},TransitionComponent:T=E_,transitionDuration:E=i,TransitionProps:D,...O}=n,k={...n,disableEscapeKeyDown:f,fullScreen:p,fullWidth:m,maxWidth:h,scroll:S},A=fZ(k),j=W.useRef(),M=e=>{j.current=e.target===e.currentTarget},N=e=>{g&&g(e),j.current&&(j.current=null,_&&_(e,`backdropClick`))},P=qi(o),F=W.useMemo(()=>({titleId:P}),[P]),ee={slots:{transition:T,...C},slotProps:{transition:D,paper:b,backdrop:l,...w}},[te,I]=T_(`root`,{elementType:pZ,shouldForwardComponentProp:!0,externalForwardedProps:ee,ownerState:k,className:K(A.root,d),ref:t}),[ne,re]=T_(`backdrop`,{elementType:dZ,shouldForwardComponentProp:!0,externalForwardedProps:ee,ownerState:k,className:A.backdrop}),[ie,L]=T_(`paper`,{elementType:hZ,shouldForwardComponentProp:!0,externalForwardedProps:ee,ownerState:k,className:A.paper,additionalProps:{elevation:24,role:x,"aria-describedby":a,"aria-labelledby":P,"aria-modal":s,tabIndex:-1,[g_]:``}}),[R,ae]=T_(`container`,{elementType:mZ,externalForwardedProps:ee,ownerState:k,className:A.container}),[z,B]=T_(`transition`,{elementType:E_,externalForwardedProps:ee,ownerState:k,additionalProps:{appear:!0,in:v,timeout:E,role:`presentation`}});return(0,G.jsx)(te,{closeAfterTransition:!0,slots:{backdrop:ne},slotProps:{backdrop:{transitionDuration:E,as:c,...re}},disableEscapeKeyDown:f,onClose:_,open:v,onClick:N,...I,...O,children:(0,G.jsx)(z,{...B,children:(0,G.jsx)(R,{onMouseDown:M,...ae,children:(0,G.jsx)(ie,{as:y,...L,children:(0,G.jsx)(uZ.Provider,{value:F,children:u})})})})})});M();var _Z=class extends W.Component{static propTypes={onDone:j.func.isRequired,alt:j.string};constructor(e){super(e);let{alt:t}=e;this.state={value:t}}closeDialog=()=>{document.querySelectorAll(`#text-dialog`).forEach(function(e){return e.remove()})};onDone=()=>{let{onDone:e}=this.props,{value:t}=this.state;e(t),this.closeDialog()};handleOverflow=()=>{document.body.style.removeProperty(`overflow`)};render(){let{value:e}=this.state;return(0,G.jsxs)(gZ,{open:!0,disablePortal:!0,onClose:this.closeDialog,id:`text-dialog`,hideBackdrop:!0,disableScrollLock:!0,onEntered:this.handleOverflow,children:[(0,G.jsx)(GX,{children:(0,G.jsxs)(`div`,{style:{display:`flex`},children:[(0,G.jsx)(KX,{style:{paddingTop:`6px`}}),(0,G.jsx)(rZ,{multiline:!0,placeholder:`Enter an Alt Text description of this image`,helperText:`Users with visual limitations rely on Alt Text, since screen readers cannot otherwise describe the contents of an image.`,value:e,onChange:e=>this.setState({value:e.target.value}),FormHelperTextProps:{style:{fontSize:14}}})]})}),(0,G.jsx)(sZ,{children:(0,G.jsx)(Wy,{onClick:this.onDone,children:`Done`})})]})}};M();var vZ=J(`button`,{shouldForwardProp:e=>![`active`,`disabled`,`extraStyles`].includes(e)})(({theme:e,active:t,disabled:n})=>({color:t?`black`:`grey`,display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:n?`not-allowed`:`pointer`,"&:hover":{color:n?`grey`:`black`},"&:focus":{outline:`2px solid ${e.palette.grey[700]}`},...n&&{opacity:.7}})),yZ=ey(`pie-elements:editable-html:raw-button`);(class extends W.Component{static propTypes={onClick:j.func.isRequired,children:j.oneOfType([j.arrayOf(j.node),j.node]).isRequired,active:j.bool,disabled:j.bool,extraStyles:j.object};constructor(e){super(e)}onClick=e=>{yZ(`[onClick]`),e.preventDefault();let{onClick:t}=this.props;t(e)};onKeyDown=e=>{if(e.key===`Enter`||e.key===` `){yZ(`[onKeyDown]`),e.preventDefault();let{onClick:t}=this.props;t(e)}};render(){let{active:e,children:t,disabled:n,extraStyles:r,ariaLabel:i}=this.props;return(0,G.jsx)(vZ,{style:r,active:e,disabled:n,onMouseDown:this.onClick,onKeyDown:this.onKeyDown,"aria-label":i,"aria-pressed":e,tabIndex:0,children:t})}});var bZ=class extends W.Component{static propTypes={onToggle:j.func.isRequired,mark:j.string,label:j.string.isRequired,children:j.oneOfType([j.arrayOf(j.node),j.node]).isRequired,active:j.bool};constructor(e){super(e)}onToggle=e=>{e.preventDefault(),this.props.onToggle(this.props.mark)};onKeyDown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.props.onToggle(this.props.mark))};render(){let{children:e,active:t,label:n}=this.props;return(0,G.jsx)(vZ,{active:t,onMouseDown:this.onToggle,"aria-pressed":t,onKeyDown:this.onKeyDown,"aria-label":n,tabIndex:0,children:e})}};M();var xZ=ey(`@pie-lib:editable-html:plugins:image:image-toolbar`),SZ=J(`div`)(({theme:e})=>({paddingLeft:e.spacing.unit,display:`flex`,alignItems:`center`})),CZ=J(`span`,{shouldForwardProp:e=>![`disabled`,`hasAlignmentButtons`].includes(e)})(({disabled:e,hasAlignmentButtons:t})=>({...e&&{opacity:.5},...t&&{borderLeft:`1px solid grey`,paddingLeft:8,marginLeft:4}})),wZ=({alignment:e,active:t,onClick:n})=>(0,G.jsx)(bZ,{active:t,onToggle:()=>n(e),label:e,children:e});wZ.propTypes={alignment:j.string.isRequired,active:j.bool.isRequired,onClick:j.func.isRequired};var TZ=class extends W.Component{static propTypes={onChange:j.func.isRequired,alignment:j.string,alt:j.string,imageLoaded:j.bool,disableImageAlignmentButtons:j.bool};onAltTextDone=e=>{xZ(`[onAltTextDone]: alt:`,e),this.props.onChange({alt:e},!0)};onAlignmentClick=e=>{xZ(`[onAlignmentClick]: alignment:`,e),this.props.onChange({alignment:e})};renderDialog=()=>{let{alt:e}=this.props,t=document.createElement(`div`),n=(0,G.jsx)(_Z,{alt:e,onDone:this.onAltTextDone});Vg.render(n,t),document.body.appendChild(t)};render(){let{alignment:e,imageLoaded:t,disableImageAlignmentButtons:n}=this.props;return(0,G.jsxs)(SZ,{children:[!n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(wZ,{alignment:`left`,active:e===`left`,onClick:this.onAlignmentClick}),(0,G.jsx)(wZ,{alignment:`center`,active:e===`center`,onClick:this.onAlignmentClick}),(0,G.jsx)(wZ,{alignment:`right`,active:e===`right`,onClick:this.onAlignmentClick})]}),(0,G.jsx)(CZ,{disabled:!t,hasAlignmentButtons:!n,onMouseDown:e=>t&&this.renderDialog(e),children:`Alt text`})]})}};M();var EZ=J(LX,{shouldForwardProp:e=>e!==`hideProgress`})(({hideProgress:e})=>({position:`absolute`,left:`0`,width:`fit-content`,top:`0%`,transition:`opacity 200ms linear`,...e&&{opacity:0}})),DZ=J(`div`,{shouldForwardProp:e=>![`active`,`loading`,`pendingDelete`].includes(e)})(({loading:e,pendingDelete:t})=>({position:`relative`,display:`flex`,transition:`opacity 200ms linear`,...e&&{opacity:.3},...t&&{opacity:.3}})),OZ=J(`div`)(({theme:e})=>({position:`relative`,width:`fit-content`,display:`flex`,alignItems:`center`,"&&:hover > .resize":{display:`block`}})),kZ=J(`img`,{shouldForwardProp:e=>e!==`active`})(({theme:e,active:t})=>({border:t?`solid 1px ${e.palette.primary.main}`:`solid 1px transparent`})),AZ=J(`div`)(({theme:e})=>({backgroundColor:e.palette.primary.main,cursor:`col-resize`,height:`35px`,width:`5px`,borderRadius:8,marginLeft:`5px`,marginRight:`10px`,display:`none`})),jZ=e=>e?`${e}px`:`calc(20px)`;function MZ(e){let{node:t,editor:n,attributes:r,onFocus:i,getPos:a,selected:o,options:s,maxImageWidth:c=700,maxImageHeight:l=900}=e,{alt:u}=t.attrs,d=a(),f=n.state.selection.from,p=n.state.selection.to,m=(0,W.useMemo)(()=>f+t.nodeSize===p,[f,p,t.nodeSize]),[h,g]=(0,W.useState)(!1),_=(0,W.useRef)(t),v=(0,W.useRef)(null),y=(0,W.useRef)(null),b=(0,W.useRef)(null),x=(0,W.useCallback)(e=>{let t=e/v.current.naturalWidth*4;return parseInt(t.toFixed(0)*25,10)},[]),S=(0,W.useCallback)(()=>{let e=_.current.attrs.nodeKey,t=null;return n.state.doc.descendants((n,r)=>{if(t!==null)return!1;if(n.type.name===`imageUploadNode`&&n.attrs.nodeKey===e)return t=r,!1}),t},[n]),C=(0,W.useCallback)(e=>{let t=S();if(t===null)return;let r=n.state.doc.nodeAt(t);r&&n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...r.attrs,...e}))},[n,S]),w=(0,W.useCallback)(()=>{if(!t.attrs.width||!v.current)return;let e=x(t.attrs.width);t.attrs.resizePercent!==e&&C({resizePercent:e})},[t.attrs.width,t.attrs.resizePercent,x,C]);(0,W.useEffect)(()=>{_.current={...t,pos:d}},[t,d]),(0,W.useEffect)(()=>{o?m&&(!String(t.attrs?.src??``).trim()&&s.imageHandling?.insertImageRequested&&s.imageHandling.insertImageRequested(n,[t,d],e=>new zX(n,[t,d],e)),g(o)):g(o)},[m,o]),(0,W.useEffect)(()=>{w();let e=y.current;return e&&e.addEventListener(`mousedown`,A,!1),()=>{e&&e.removeEventListener(`mousedown`,A,!1)}},[]),(0,W.useEffect)(()=>{w()});let T=(0,W.useCallback)(()=>{let e=v.current;if(e&&(!e.style.width||e.style.width===`calc(20px)`)){let n=Math.min(e.naturalWidth,c),r=Math.min(e.naturalHeight,l);e.style.width=`${n}px`,e.style.height=`${r}px`;let i={width:n,height:r};mp(i,{width:t.attrs.width,height:t.attrs.height})||C(i)}},[t.attrs.width,t.attrs.height,c,l,C]),E=(e,t,n=!0,r)=>{if(n){let n=e.width/e.height;return r===`height`?{width:t.height*n,height:t.height}:{width:t.width,height:t.width/n}}return t},D=(0,W.useCallback)(e=>{let t=v.current;if(!t)return;let n=e.target.getBoundingClientRect(),r=E({width:t.naturalWidth,height:t.naturalHeight},{width:e.clientX-n.left,height:e.clientY-n.top});r.width>50&&r.height>50&&r.width<=700&&r.height<=900&&(t.style.width=`${r.width}px`,t.style.height=`${r.height}px`,C({width:r.width,height:r.height}))},[n,C]),O=(0,W.useCallback)(e=>{C(e)},[n,C]),k=(0,W.useCallback)(()=>{window.removeEventListener(`mousemove`,D),window.removeEventListener(`mouseup`,k)},[D]),A=(0,W.useCallback)(()=>{window.addEventListener(`mousemove`,D),window.addEventListener(`mouseup`,k)},[D,k]),j={width:jZ(t.attrs.width),height:jZ(t.attrs.height),objectFit:`contain`},M={left:`flex-start`,center:`center`,right:`flex-end`}[t.attrs.alignment]||`flex-start`;return(0,G.jsxs)(KM,{children:[(0,G.jsxs)(DZ,{onFocus:i,loading:!t.attrs.loaded,pendingDelete:t.attrs.deleteStatus===`pending`,style:{justifyContent:M},children:[(0,G.jsx)(EZ,{mode:`determinate`,value:t.attrs.percent||0,hideProgress:t.attrs.loaded}),(0,G.jsxs)(OZ,{onDragStart:e=>e.preventDefault(),children:[(0,G.jsx)(kZ,{...r,active:o&&t.attrs.loaded,draggable:!1,ref:v,src:t.attrs.src,style:j,onLoad:T,alt:t.attrs.alt}),(0,G.jsx)(AZ,{ref:y,className:`resize`})]})]}),h&&n._tiptapContainerEl&&Vg.createPortal((0,G.jsx)(`div`,{ref:b,style:{zIndex:20,background:`var(--editable-html-toolbar-bg, #efefef)`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,width:`100%`},children:(0,G.jsx)(wV,{showDone:!0,deletable:!0,toolbarOpts:s.toolbarOpts||{},onDelete:()=>{let e=S();e!==null&&(s.imageHandling?.onDelete?.(_.current),n.view.dispatch(n.state.tr.delete(e,e+n.state.doc.nodeAt(e).nodeSize)),g(!1),n.commands.focus())},onDone:()=>{g(!1),s.imageHandling?.onDone?.(n),n.commands.focus(`end`)},children:(0,G.jsx)(TZ,{disableImageAlignmentButtons:s.imageHandling?.disableImageAlignmentButtons,alt:t.attrs.alt,imageLoaded:t.attrs.loaded,alignment:t.attrs.alignment||`left`,onChange:O})})}),n._tiptapContainerEl)]})}MZ.propTypes={node:j.object.isRequired,editor:j.object.isRequired,attributes:j.object,onFocus:j.func,maxImageWidth:j.number,maxImageHeight:j.number};var NZ=SM.create({name:`imageUploadNode`,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{nodeKey:{default:null},loaded:{default:!1},deleteStatus:{default:null},alignment:{default:null},percent:{default:null},width:{default:null},height:{default:null},src:{default:null},alt:{default:null}}},parseHTML(){return[{tag:`img[data-type="image-upload-node"]`}]},renderHTML({HTMLAttributes:e}){return[`img`,Rk(e,{"data-type":`image-upload-node`})]},addNodeView(){return eN(e=>(0,G.jsx)(MZ,{...e,options:this.options}))},addCommands(){return{setImageUploadNode:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{nodeKey:`img-${Date.now()}-${Math.random().toString(36).slice(2)}`}})}},addProseMirrorPlugins(){let e=this.editor;return[new aw({props:{handlePaste(t,n){let r=Array.from(n.clipboardData?.items||[]).find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!r)return!1;let i=r.getAsFile();if(!i)return!1;let a=new FileReader;return a.onload=()=>{let t=a.result;typeof t==`string`&&e.commands.insertContent({type:`imageUploadNode`,attrs:{src:t,loaded:!0,nodeKey:`img-${Date.now()}-${Math.random().toString(36).slice(2)}`}})},a.readAsDataURL(i),!0}}})]}});function PZ(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function FZ(e,t,n,r={},i=()=>{}){let{ease:a=PZ,duration:o=300}=r,s=null,c=t[e],l=!1,u=()=>{l=!0},d=r=>{if(l){i(Error(`Animation cancelled`));return}s===null&&(s=r);let u=Math.min(1,(r-s)/o);if(t[e]=a(u)*(n-c)+c,u>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(d)};return c===n?(i(Error(`Element already at target position`)),u):(requestAnimationFrame(d),u)}M();var IZ={width:99,height:99,position:`absolute`,top:-9999,overflow:`scroll`};function LZ(e){let{onChange:t,...n}=e,r=W.useRef(),i=W.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return z_(()=>{let e=yg(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=Cg(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),W.useEffect(()=>{a(),t(r.current)},[t]),(0,G.jsx)(`div`,{style:IZ,...n,ref:i})}var RZ=L_((0,G.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),zZ=L_((0,G.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function BZ(e){return Qr(`MuiTabScrollButton`,e)}var VZ=$r(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]);M();var HZ=e=>{let{classes:t,orientation:n,disabled:r}=e;return ba({root:[`root`,n,r&&`disabled`]},BZ,t)},UZ=J(gy,{name:`MuiTabScrollButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${VZ.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),WZ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,u=zi(),d={isRtl:u,...n},f=HZ(d),p=i.StartScrollButtonIcon??RZ,m=i.EndScrollButtonIcon??zZ,h=Bb({elementType:p,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d}),g=Bb({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d});return(0,G.jsx)(UZ,{component:`div`,className:K(f.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...l,style:{...l.style,...s===`vertical`&&{"--TabScrollButton-svgRotate":`rotate(${u?-90:90}deg)`}},children:o===`left`?(0,G.jsx)(p,{...h}):(0,G.jsx)(m,{...g})})});function GZ(e){return Qr(`MuiTabs`,e)}var KZ=$r(`MuiTabs`,[`root`,`vertical`,`list`,`flexContainer`,`flexContainerVertical`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]);M();var qZ=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,JZ=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,YZ=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}let t=i.disabled||i.getAttribute(`aria-disabled`)===`true`;if(!i.hasAttribute(`tabindex`)||t)i=n(e,i);else{i.focus();return}}},XZ=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return ba({root:[`root`,t&&`vertical`],scroller:[`scroller`,n&&`fixed`,r&&`hideScrollbar`,i&&`scrollableX`,a&&`scrollableY`],list:[`list`,`flexContainer`,t&&`flexContainerVertical`,t&&`vertical`,o&&`centered`],indicator:[`indicator`],scrollButtons:[`scrollButtons`,s&&`scrollButtonsHideMobile`],scrollableX:[i&&`scrollableX`],hideScrollbar:[r&&`hideScrollbar`]},GZ,c)},ZZ=J(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${KZ.scrollButtons}`]:t.scrollButtons},{[`& .${KZ.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(y_(({theme:e})=>({overflow:`hidden`,minHeight:48,WebkitOverflowScrolling:`touch`,display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${KZ.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),QZ=J(`div`,{name:`MuiTabs`,slot:`Scroller`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:`relative`,display:`inline-block`,flex:`1 1 auto`,whiteSpace:`nowrap`,variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:`hidden`,width:`100%`}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:`auto`,overflowY:`hidden`}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:`auto`,overflowX:`hidden`}}]}),$Z=J(`div`,{name:`MuiTabs`,slot:`List`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.centered,style:{justifyContent:`center`}}]}),eQ=J(`span`,{name:`MuiTabs`,slot:`Indicator`})(y_(({theme:e})=>({position:`absolute`,height:2,bottom:0,width:`100%`,transition:e.transitions.create(),variants:[{props:{indicatorColor:`primary`},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:`secondary`},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:`100%`,width:2,right:0}}]}))),tQ=J(LZ)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),nQ={},rQ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiTabs`}),r=No(),i=zi(),{"aria-label":a,"aria-labelledby":o,action:s,centered:c=!1,children:l,className:u,component:d=`div`,allowScrollButtonsMobile:f=!1,indicatorColor:p=`primary`,onChange:m,orientation:h=`horizontal`,ScrollButtonComponent:g,scrollButtons:_=`auto`,selectionFollowsFocus:v,slots:y={},slotProps:b={},TabIndicatorProps:x={},TabScrollButtonProps:S={},textColor:C=`primary`,value:w,variant:T=`standard`,visibleScrollbar:E=!1,...D}=n,O=T===`scrollable`,k=h===`vertical`,A=k?`scrollTop`:`scrollLeft`,j=k?`top`:`left`,M=k?`bottom`:`right`,N=k?`clientHeight`:`clientWidth`,P=k?`height`:`width`,F={...n,component:d,allowScrollButtonsMobile:f,indicatorColor:p,orientation:h,vertical:k,scrollButtons:_,textColor:C,variant:T,visibleScrollbar:E,fixed:!O,hideScrollbar:O&&!E,scrollableX:O&&!k,scrollableY:O&&k,centered:c&&!O,scrollButtonsHideMobile:!f},ee=XZ(F),te=Bb({elementType:y.StartScrollButtonIcon,externalSlotProps:b.startScrollButtonIcon,ownerState:F}),I=Bb({elementType:y.EndScrollButtonIcon,externalSlotProps:b.endScrollButtonIcon,ownerState:F}),[ne,re]=W.useState(!1),[ie,L]=W.useState(nQ),[R,ae]=W.useState(!1),[z,B]=W.useState(!1),[oe,se]=W.useState(!1),[ce,V]=W.useState({overflow:`hidden`,scrollbarWidth:0}),le=new Map,ue=W.useRef(null),de=W.useRef(null),H={slots:y,slotProps:{indicator:x,scrollButtons:S,...b}},fe=()=>{let e=ue.current,t;if(e){let n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let n;if(e&&w!==!1){let e=de.current.children;if(e.length>0){let t=e[le.get(w)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},pe=U_(()=>{let{tabsMeta:e,tabMeta:t}=fe(),n=0,r;k?(r=`top`,t&&e&&(n=t.top-e.top+e.scrollTop)):(r=i?`right`:`left`,t&&e&&(n=(i?-1:1)*(t[r]-e[r]+e.scrollLeft)));let a={[r]:n,[P]:t?t[P]:0};if(typeof ie[r]!=`number`||typeof ie[P]!=`number`)L(a);else{let e=Math.abs(ie[r]-a[r]),t=Math.abs(ie[P]-a[P]);(e>=1||t>=1)&&L(a)}}),me=(e,{animation:t=!0}={})=>{t?FZ(A,ue.current,e,{duration:r.transitions.duration.standard}):ue.current[A]=e},he=e=>{let t=ue.current[A];k?t+=e:t+=e*(i?-1:1),me(t)},ge=()=>{let e=ue.current[N],t=0,n=Array.from(de.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[N]>e){r===0&&(t=e);break}t+=i[N]}return t},U=()=>{he(-1*ge())},_e=()=>{he(ge())},[ve,{onChange:ye,...be}]=T_(`scrollbar`,{className:K(ee.scrollableX,ee.hideScrollbar),elementType:tQ,shouldForwardComponentProp:!0,externalForwardedProps:H,ownerState:F}),xe=W.useCallback(e=>{ye?.(e),V({overflow:null,scrollbarWidth:e})},[ye]),[Se,Ce]=T_(`scrollButtons`,{className:K(ee.scrollButtons,S.className),elementType:WZ,externalForwardedProps:H,ownerState:F,additionalProps:{orientation:h,slots:{StartScrollButtonIcon:y.startScrollButtonIcon||y.StartScrollButtonIcon,EndScrollButtonIcon:y.endScrollButtonIcon||y.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:te,endScrollButtonIcon:I}}}),we=()=>{let e={};e.scrollbarSizeListener=O?(0,G.jsx)(ve,{...be,onChange:xe}):null;let t=O&&(_===`auto`&&(R||z)||_===!0);return e.scrollButtonStart=t?(0,G.jsx)(Se,{direction:i?`right`:`left`,onClick:U,disabled:!R,...Ce}):null,e.scrollButtonEnd=t?(0,G.jsx)(Se,{direction:i?`left`:`right`,onClick:_e,disabled:!z,...Ce}):null,e},Te=U_(e=>{let{tabsMeta:t,tabMeta:n}=fe();!n||!t||(n[j]<t[j]?me(t[A]+(n[j]-t[j]),{animation:e}):n[M]>t[M]&&me(t[A]+(n[M]-t[M]),{animation:e}))}),Ee=U_(()=>{O&&_!==!1&&se(!oe)});W.useEffect(()=>{let e=yg(()=>{ue.current&&pe()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Ee()},r=Cg(ue.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(de.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(de.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[pe,Ee]),W.useEffect(()=>{let e=Array.from(de.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&O&&_!==!1){let n=e[0],r=e[t-1],i={root:ue.current,threshold:.99},a=new IntersectionObserver(e=>{ae(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{B(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[O,_,oe,l?.length]),W.useEffect(()=>{re(!0)},[]),W.useEffect(()=>{pe()}),W.useEffect(()=>{Te(nQ!==ie)},[Te,ie]),W.useImperativeHandle(s,()=>({updateIndicator:pe,updateScrollButtons:Ee}),[pe,Ee]);let[De,Oe]=T_(`indicator`,{className:K(ee.indicator,x.className),elementType:eQ,externalForwardedProps:H,ownerState:F,additionalProps:{style:ie}}),ke=(0,G.jsx)(De,{...Oe}),Ae=0,je=W.Children.map(l,e=>{if(!W.isValidElement(e))return null;let t=e.props.value===void 0?Ae:e.props.value;le.set(t,Ae);let n=t===w;return Ae+=1,W.cloneElement(e,{fullWidth:T===`fullWidth`,indicator:n&&!ne&&ke,selected:n,selectionFollowsFocus:v,onChange:m,textColor:C,value:t,...Ae===1&&w===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),Me=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;let t=de.current,n=h_(xg(t));if(n?.getAttribute(`role`)!==`tab`)return;let r=h===`horizontal`?`ArrowLeft`:`ArrowUp`,a=h===`horizontal`?`ArrowRight`:`ArrowDown`;switch(h===`horizontal`&&i&&(r=`ArrowRight`,a=`ArrowLeft`),e.key){case r:e.preventDefault(),YZ(t,n,JZ);break;case a:e.preventDefault(),YZ(t,n,qZ);break;case`Home`:e.preventDefault(),YZ(t,null,qZ);break;case`End`:e.preventDefault(),YZ(t,null,JZ);break;default:break}},Ne=we(),[Pe,Fe]=T_(`root`,{ref:t,className:K(ee.root,u),elementType:ZZ,externalForwardedProps:{...H,...D,component:d},ownerState:F}),[Ie,Le]=T_(`scroller`,{ref:ue,className:ee.scroller,elementType:QZ,externalForwardedProps:H,ownerState:F,additionalProps:{style:{overflow:ce.overflow,[k?`margin${i?`Left`:`Right`}`:`marginBottom`]:E?void 0:-ce.scrollbarWidth}}}),[Re,ze]=T_(`list`,{ref:de,className:K(ee.list,ee.flexContainer),elementType:$Z,externalForwardedProps:H,ownerState:F,getSlotProps:e=>({...e,onKeyDown:t=>{Me(t),e.onKeyDown?.(t)}})});return(0,G.jsxs)(Pe,{...Fe,children:[Ne.scrollButtonStart,Ne.scrollbarSizeListener,(0,G.jsxs)(Ie,{...Le,children:[(0,G.jsx)(Re,{"aria-label":a,"aria-labelledby":o,"aria-orientation":h===`vertical`?`vertical`:null,role:`tablist`,...ze,children:je}),ne&&ke]}),Ne.scrollButtonEnd]})});function iQ(e){return Qr(`MuiTab`,e)}var aQ=$r(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`iconWrapper`,`icon`]);M();var oQ=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:s,disabled:c}=e;return ba({root:[`root`,a&&o&&`labelIcon`,`textColor${P_(n)}`,r&&`fullWidth`,i&&`wrapped`,s&&`selected`,c&&`disabled`],icon:[`iconWrapper`,`icon`]},iQ,t)},sQ=J(gy,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${P_(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${aQ.iconWrapper}`]:t.iconWrapper},{[`& .${aQ.icon}`]:t.icon}]}})(y_(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:`relative`,minHeight:48,flexShrink:0,padding:`12px 16px`,overflow:`hidden`,whiteSpace:`normal`,textAlign:`center`,lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition===`top`||e.iconPosition===`bottom`),style:{flexDirection:`column`}},{props:({ownerState:e})=>e.label&&e.iconPosition!==`top`&&e.iconPosition!==`bottom`,style:{flexDirection:`row`}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`top`,style:{[`& > .${aQ.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${aQ.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${aQ.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${aQ.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${aQ.selected}`]:{opacity:1},[`&.${aQ.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${aQ.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${aQ.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${aQ.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${aQ.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:`none`}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),cQ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiTab`}),{className:r,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:o,icon:s,iconPosition:c=`top`,indicator:l,label:u,onChange:d,onClick:f,onFocus:p,selected:m,selectionFollowsFocus:h,textColor:g=`inherit`,value:_,wrapped:v=!1,...y}=n,b={...n,disabled:i,disableFocusRipple:a,selected:m,icon:!!s,iconPosition:c,label:!!u,fullWidth:o,textColor:g,wrapped:v},x=oQ(b),S=s&&u&&W.isValidElement(s)?W.cloneElement(s,{className:K(x.icon,s.props.className)}):s;return(0,G.jsxs)(sQ,{focusRipple:!a,className:K(x.root,r),ref:t,role:`tab`,"aria-selected":m,disabled:i,onClick:e=>{!m&&d&&d(e,_),f&&f(e)},onFocus:e=>{h&&!m&&d&&d(e,_),p&&p(e)},ownerState:b,tabIndex:m?0:-1,...y,children:[c===`top`||c===`start`?(0,G.jsxs)(W.Fragment,{children:[S,u]}):(0,G.jsxs)(W.Fragment,{children:[u,S]}),l]})});M();var lQ=e=>{let{classes:t}=e;return ba({root:[`root`]},VX,t)},uQ=J(gJ,{name:`MuiDialogTitle`,slot:`Root`})({padding:`16px 24px`,flex:`0 0 auto`}),dQ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiDialogTitle`}),{className:r,id:i,...a}=n,o=n,s=lQ(o),{titleId:c=i}=W.useContext(uZ);return(0,G.jsx)(uQ,{component:`h2`,className:K(s.root,r),ownerState:o,ref:t,variant:`h6`,id:i??c,...a})});function fQ(e){return Qr(`MuiDialogContentText`,e)}$r(`MuiDialogContentText`,[`root`]),M();var pQ=e=>{let{classes:t}=e,n=ba({root:[`root`]},fQ,t);return{...t,...n}},mQ=J(gJ,{shouldForwardProp:e=>Fo(e)||e===`classes`,name:`MuiDialogContentText`,slot:`Root`})({}),hQ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiDialogContentText`}),{children:r,className:i,...a}=n,o=pQ(a);return(0,G.jsx)(mQ,{component:`p`,variant:`body1`,color:`textSecondary`,ref:t,ownerState:a,className:K(o.root,i),...n,classes:o})});M();var gQ=ey(`@pie-lib:editable-html:plugins:media:dialog`),_Q=e=>{if(!e)return!1;let t=/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;return e.match(t)?e.match(t)[1]:!1},vQ=e=>e&&/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/.test(e),yQ=e=>e&&/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/.test(e),bQ=e=>{if(!e)return!1;let t=/^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;return e.match(t)&&e.match(t)[2]},xQ=e=>new Promise(t=>{try{fetch(`https://soundcloud.com/oembed?format=json&url=${e}`).then(e=>e.json()).then(e=>{let n=document.createElement(`div`);n.innerHTML=e.html,t(n.querySelector(`iframe`).src)}).catch(e=>{t(``),gQ(e)})}catch{t(``)}}),SQ={video:`Video`,audio:`Audio`},CQ={uploadFile:`upload-file`,insertUrl:`insert-url`},wQ=J(gZ)(({theme:e})=>({"& .MuiDialog-paper":{minWidth:`500px`}})),TQ=J(GX)(({theme:e})=>({padding:0})),EQ=J(`div`)(({theme:e})=>({display:`flex`,flexDirection:`space-between`})),DQ=J(`div`)(({theme:e})=>({marginTop:e.spacing(1.5)})),OQ=J(`input`)(({theme:e})=>({})),kQ=J(gJ)(({theme:e})=>({marginTop:e.spacing(1.5),color:e.palette.error.main})),AQ=J(mV)(({theme:e})=>({marginLeft:e.spacing(1.5)})),jQ=class extends W.Component{static propTypes={open:j.bool,edit:j.bool,disablePortal:j.bool,handleClose:j.func,uploadSoundSupport:j.shape({add:j.func,delete:j.func}),type:j.string,src:j.string,url:j.string,urlToUse:j.string,starts:j.number,ends:j.number,height:j.number,width:j.number};constructor(e){super(e);let{ends:t,height:n,src:r,starts:i,type:a,uploadSoundSupport:o,url:s,urlToUse:c,width:l}=e,u=o?.add&&o?.delete&&a!==`video`&&!r;this.state={ends:t||0,url:s,urlToUse:c,formattedUrl:r,height:n||315,invalid:!1,starts:i||0,width:l||560,tabValue:u?CQ.uploadFile:CQ.insertUrl,fileUpload:{error:null,loading:!1,scheduled:!1,url:``,mimeType:``}}}componentDidMount(){this.props.url&&this.urlChange({target:{value:this.props.url}})}formatUrl=()=>{let{url:e,urlToUse:t,starts:n,ends:r}=this.state,i=_Q(e),a=vQ(e),o=t;if((i||a)&&t){let e=[],s,c;switch(!0){case a:s=`t`,c=`#`;break;case i:s=`start`,c=`?`;break;default:s=`start`,c=`?`}n&&e.push(`${s}=${n}`),r&&e.push(`end=${r}`),o=`${t}${e.length?c:``}${e.join(`&`)}`}this.setState({formattedUrl:null,updating:!0},()=>this.setState({formattedUrl:o,updating:!1}))};handleStateChange=e=>this.setState(e,this.formatUrl);checkAudio=e=>{bQ(e)&&xQ(e).then(t=>{this.handleStateChange({urlToUse:t,invalid:!t,url:e})}).catch(gQ)};checkVideo=e=>{if(_Q(e)){let t=`https://youtube.com/embed/${e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)[2]}`;gQ(`is youtube`),this.handleStateChange({urlToUse:t,url:e,invalid:!1})}if(vQ(e)){let t=`https://player.vimeo.com/video/${e.replace(/.*vimeo.com\/(.*)/g,`$1`)}`;gQ(`is vimeo`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}if(yQ(e)){let t=`https://drive.google.com/file/d/${e.replace(/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/,`$1`)}/preview`;gQ(`is google drive`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}};urlChange=e=>{let{value:t}=e.target||{},{type:n}=this.props;if(n&&n===`audio`){this.checkAudio(t);return}else if(n&&n===`video`){this.checkVideo(t);return}this.handleStateChange({urlToUse:null,url:null,invalid:!0})};changeHandler=e=>t=>this.handleStateChange({[e]:t.target.value});handleDone=e=>{let{handleClose:t}=this.props,{tabValue:n,fileUpload:r}=this.state,i=n===CQ.insertUrl;if(!e){r.url&&this.handleRemoveFile(),t(e);return}if(i){let{ends:n,height:r,url:i,urlToUse:a,formattedUrl:o,starts:s,width:c}=this.state;t(e,{tag:`iframe`,ends:n,height:r,starts:s,width:c,url:i,urlToUse:a,src:o});return}if(!r.loading){t(e,{tag:`audio`,src:r.url});return}this.setState({fileUpload:{...r,scheduled:!0}})};handleUploadFile=async e=>{e.preventDefault(),this.setState({fileUpload:{...this.state.fileUpload,error:null,loading:!0}});let t=e.target.files[0],n=new FileReader;n.onload=()=>{let e=n.result;this.setState({fileUpload:{...this.state.fileUpload,url:e,mimeType:t.type}})},n.readAsDataURL(t),this.props.uploadSoundSupport.add({fileChosen:t,done:(e,t)=>{if(gQ(`done: err:`,e),e){console.log(e),this.setState({fileUpload:{...this.state.fileUpload,scheduled:!1,loading:!1,error:e}});return}let{fileUpload:n}=this.state,r=n&&n.scheduled?this.handleDone.bind(this,!0):void 0;this.setState({fileUpload:{...n,scheduled:!1,loading:!1,url:t}},r)}})};handleRemoveFile=async()=>{this.props.uploadSoundSupport.delete(this.state.fileUpload.url,e=>{e&&(console.log(e),this.setState({fileUpload:{...this.state.fileUpload,error:e}}))}),this.setState({fileUpload:{...this.state.fileUpload,loading:!1,url:``,mimeType:``}})};render(){let{open:e,disablePortal:t,type:n,edit:r,uploadSoundSupport:i}=this.props,{ends:a,height:o,invalid:s,starts:c,width:l,url:u,mimeType:d,formattedUrl:f,updating:p,tabValue:m,fileUpload:h}=this.state,g=_Q(u),_=m===CQ.insertUrl,v=m===CQ.uploadFile,y=_?s||u==null:!h.url||h.scheduled,b=i?.add&&i?.delete&&n!==`video`;return(0,G.jsxs)(wQ,{disablePortal:t,open:e,onClose:()=>this.handleDone(!1),"aria-labelledby":`form-dialog-title`,children:[(0,G.jsxs)(dQ,{id:`form-dialog-title`,children:[`Insert `,SQ[n]]}),(0,G.jsx)(GX,{children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(EQ,{children:(0,G.jsxs)(rQ,{indicatorColor:`primary`,value:m,onChange:(e,t)=>{this.setState({tabValue:t})},children:[b?(0,G.jsx)(cQ,{value:CQ.uploadFile,label:`Upload file`}):null,(0,G.jsx)(cQ,{value:CQ.insertUrl,label:n===`video`?`Insert YouTube, Vimeo, or Google Drive URL`:`Insert SoundCloud URL`})]})}),_&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(rZ,{autoFocus:!0,error:s,helperText:s?`Invalid URL`:``,margin:`dense`,id:`name`,label:`URL`,placeholder:`Paste URL of ${n}...`,type:`text`,onChange:this.urlChange,value:u,fullWidth:!0}),n===`video`&&(0,G.jsxs)(TQ,{children:[(0,G.jsx)(hQ,{children:`Video Properties`}),(0,G.jsx)(rZ,{autoFocus:!0,margin:`dense`,id:`width`,label:`Width`,type:`number`,placeholder:`Width`,value:l,onChange:this.changeHandler(`width`)}),(0,G.jsx)(rZ,{autoFocus:!0,margin:`dense`,id:`height`,label:`Height`,type:`number`,placeholder:`Height`,value:o,onChange:this.changeHandler(`height`)})]}),f&&(0,G.jsx)(`iframe`,{width:l,height:o,src:f,frameBorder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0}),n===`video`&&(f||p)&&!s&&(0,G.jsx)(W.Fragment,{children:(0,G.jsxs)(TQ,{children:[(0,G.jsx)(rZ,{autoFocus:!0,margin:`dense`,id:`starts`,label:`Starts`,type:`number`,placeholder:`Starts`,value:c,onChange:this.changeHandler(`starts`)}),g&&(0,G.jsx)(rZ,{autoFocus:!0,margin:`dense`,id:`ends`,label:`Ends`,type:`number`,placeholder:`Ends`,value:a,onChange:this.changeHandler(`ends`)})]})})]}),v&&(0,G.jsx)(DQ,{children:(0,G.jsxs)(`div`,{children:[h.url?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(EQ,{children:[(0,G.jsx)(`audio`,{controls:`controls`,controlsList:`nodownload`,children:(0,G.jsx)(`source`,{type:d,src:h.url})}),(0,G.jsx)(AQ,{"aria-label":`delete`,onClick:this.handleRemoveFile,children:(0,G.jsx)(hV,{})})]}),!h.scheduled&&h.loading?(0,G.jsx)(gJ,{variant:`subheading`,children:`Loading...`}):null,h.scheduled?(0,G.jsx)(gJ,{variant:`subheading`,children:`Waiting for Upload to finish, then inserting item...`}):null]}):h.loading?null:(0,G.jsx)(OQ,{accept:`audio/*`,onChange:this.handleUploadFile,type:`file`}),!!h.error&&(0,G.jsx)(kQ,{variant:`caption`,children:h.error})]})})]})}),(0,G.jsxs)(sZ,{children:[(0,G.jsx)(Wy,{onClick:()=>this.handleDone(!1),color:`primary`,children:`Cancel`}),(0,G.jsx)(Wy,{disabled:y,onClick:()=>this.handleDone(!0),color:`primary`,children:r?`Update`:`Insert`})]})]})}};M();var MQ=J(`span`)(({theme:e})=>({position:`relative`,bottom:`5px`,left:0,width:`100%`,background:e.palette.common.white,display:`inline-flex`,padding:`5px`,boxShadow:`0px 4px 4px rgba(0, 0, 0, 0.25)`})),NQ=J(`span`)(({theme:e})=>({cursor:`pointer`,flex:3,border:`solid ${e.palette.common.black}`,textAlign:`right`,borderWidth:`0 2px 0 0`,marginRight:`5px`,paddingRight:`5px`})),PQ=J(`span`)({cursor:`pointer`}),FQ=class extends W.Component{static propTypes={onEdit:j.func,hideEdit:j.bool,onRemove:j.func};render(){let{hideEdit:e,onEdit:t,onRemove:n}=this.props;return(0,G.jsxs)(MQ,{children:[e?null:(0,G.jsx)(NQ,{onClick:t,children:`Edit Settings`}),(0,G.jsx)(PQ,{onClick:n,children:`Remove`})]})}},IQ=SM.create({name:`media`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{type:{default:`video`},src:{default:null},width:{default:null},height:{default:null},title:{default:null},starts:{default:null},ends:{default:null},editing:{default:!1},tag:{default:`iframe`},url:{default:null}}},parseHTML(){return[{tag:`iframe[data-type="video"]`,getAttrs:e=>({type:`video`,tag:`iframe`,src:e.getAttribute(`src`),width:e.getAttribute(`width`),height:e.getAttribute(`height`),title:e.dataset.title,starts:e.dataset.starts,ends:e.dataset.ends,url:e.dataset.url})},{tag:`audio`,getAttrs:e=>({type:`audio`,tag:`audio`,src:e.querySelector(`source`)?.getAttribute(`src`)})}]},renderHTML({HTMLAttributes:e}){let{tag:t,src:n,width:r,height:i}=e;return t===`audio`?[`audio`,{controls:`controls`,controlsList:`nodownload`},[`source`,{src:n,type:`audio/mp3`}]]:[`iframe`,Rk({"data-type":`video`,frameborder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowfullscreen:``,src:n},r?{width:r}:{},i?{height:i}:{})]},addCommands(){return{insertMedia:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateMedia:e=>({commands:t})=>t.updateAttributes(this.name,e)}},addNodeView(){return eN(e=>(0,G.jsx)(zQ,{...e,options:this.options}))}}),LQ=()=>{document.querySelectorAll(`.insert-media-dialog`).forEach(e=>e.remove())},RQ=e=>{let t=document.createElement(`div`),{type:n,callback:r,options:i,...a}=e,o=document.body.style.overflow;LQ(),t.className=`insert-media-dialog`,document.body.style.overflow=`hidden`;let s=(e,n)=>{r(e,n),t.remove(),document.body.style.overflow=o},c=(0,G.jsx)(jQ,{...a,uploadSoundSupport:i.uploadSoundSupport,type:n,disablePortal:!0,open:!0,handleClose:s});Vg.render(c,t),document.body.appendChild(t)};function zQ({editor:e,node:t,updateAttributes:n,deleteNode:r,options:i}){let{type:a,src:o,width:s,height:c,tag:l}=t.attrs;return(0,W.useEffect)(()=>{o||RQ({...t.attrs,options:i,edit:!0,callback:(t,i)=>{t?n(i):r(),e.chain().focus().run()}})},[]),(0,G.jsxs)(KM,{"data-type":a,style:{width:s,height:c},children:[l===`audio`?(0,G.jsx)(`audio`,{controls:!0,controlsList:`nodownload`,children:(0,G.jsx)(`source`,{type:`audio/mp3`,src:o})}):(0,G.jsx)(`iframe`,{src:o,allowFullScreen:!0,frameBorder:`0`,width:s,height:c}),(0,G.jsx)(FQ,{onEdit:()=>{RQ({...t.attrs,options:i,edit:!0,callback:(t,r)=>{t&&n(r),e.chain().focus().run()}})},onRemove:r})]})}function BQ(e){return Qr(`MuiListItem`,e)}$r(`MuiListItem`,[`root`,`container`,`dense`,`alignItemsFlexStart`,`divider`,`gutters`,`padding`,`secondaryAction`]);var VQ=$r(`MuiListItemButton`,[`root`,`focusVisible`,`dense`,`alignItemsFlexStart`,`disabled`,`divider`,`gutters`,`selected`]);function HQ(e){return Qr(`MuiListItemSecondaryAction`,e)}$r(`MuiListItemSecondaryAction`,[`root`,`disableGutters`]),M();var UQ=e=>{let{disableGutters:t,classes:n}=e;return ba({root:[`root`,t&&`disableGutters`]},HQ,n)},WQ=J(`div`,{name:`MuiListItemSecondaryAction`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),GQ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiListItemSecondaryAction`}),{className:r,...i}=n,a=W.useContext(Vb),o={...n,disableGutters:a.disableGutters};return(0,G.jsx)(WQ,{className:K(UQ(o).root,r),ownerState:o,ref:t,...i})});GQ.muiName=`ListItemSecondaryAction`,M();var KQ=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems===`flex-start`&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},qQ=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:a,divider:o,hasSecondaryAction:s}=e;return ba({root:[`root`,r&&`dense`,!i&&`gutters`,!a&&`padding`,o&&`divider`,t===`flex-start`&&`alignItemsFlexStart`,s&&`secondaryAction`],container:[`container`],secondaryAction:[`secondaryAction`]},BQ,n)},JQ=J(`div`,{name:`MuiListItem`,slot:`Root`,overridesResolver:KQ})(y_(({theme:e})=>({display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,width:`100%`,boxSizing:`border-box`,textAlign:`left`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${VQ.root}`]:{paddingRight:48}}},{props:{alignItems:`flex-start`},style:{alignItems:`flex-start`}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),YQ=J(`li`,{name:`MuiListItem`,slot:`Container`})({position:`relative`}),XQ=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiListItem`}),{alignItems:r=`center`,children:i,className:a,component:o,components:s={},componentsProps:c={},ContainerComponent:l=`li`,ContainerProps:{className:u,...d}={},dense:f=!1,disableGutters:p=!1,disablePadding:m=!1,divider:h=!1,secondaryAction:g,slotProps:_={},slots:v={},...y}=n,b=W.useContext(Vb),x=W.useMemo(()=>({dense:f||b.dense||!1,alignItems:r,disableGutters:p}),[r,b.dense,f,p]),S=W.useRef(null),C=W.Children.toArray(i),w=C.length&&R_(C[C.length-1],[`ListItemSecondaryAction`]),T={...n,alignItems:r,dense:x.dense,disableGutters:p,disablePadding:m,divider:h,hasSecondaryAction:w},E=qQ(T),D=o_(S,t),[O,k]=T_(`secondaryAction`,{elementType:GQ,externalForwardedProps:{slots:v,slotProps:_},ownerState:T,className:E.secondaryAction}),A=v.root||s.Root||JQ,j=_.root||c.root||{},M={className:K(E.root,j.className,a),...y},N=o||`li`;return w?(N=!M.component&&!o?`div`:N,l===`li`&&(N===`li`?N=`div`:M.component===`li`&&(M.component=`div`)),(0,G.jsx)(Vb.Provider,{value:x,children:(0,G.jsxs)(YQ,{as:l,className:K(E.container,u),ref:D,ownerState:T,...d,children:[(0,G.jsx)(A,{...j,...!pg(A)&&{as:N,ownerState:{...T,...j.ownerState}},...M,children:C}),C.pop()]})})):(0,G.jsx)(Vb.Provider,{value:x,children:(0,G.jsxs)(A,{...j,as:N,ref:D,...!pg(A)&&{ownerState:{...T,...j.ownerState}},...M,children:[C,g&&(0,G.jsx)(O,{...k,children:g})]})})}),ZQ=()=>{document.querySelectorAll(`.insert-css-dialog`).forEach(e=>e.remove())},QQ=({editor:e,callback:t,opts:n,selectedText:r,parentNode:i})=>{let a=e.options.element,o=document.createElement(`div`),{selection:s}=e.state;ZQ(),o.className=`insert-css-dialog`;let c=!1,l=e=>{if(c){let t=o.contains(e.target)||void 0,n=a.contains(e.target);t||n||u()}else c=!0},u=()=>{t(void 0,!0),o.remove(),document.body.removeEventListener(`click`,l)},d=e=>{t(e,!0),o.remove(),document.body.removeEventListener(`click`,l)},f=i?.attrs.class,p=e=>{let t=`<span class="${e}">${r}</span>`;if(i){let e=`span`;i?.object===`inline`&&(e=`span`),i?.object===`block`&&(e=`div`),t=`<${e} class="${f}">${i.text.slice(0,s.$anchor.textOffset)}${t}${i.text.slice(s.$head.textOffset)}</${e}>`}return t},m=(0,G.jsxs)(`div`,{style:{background:`white`,height:500,padding:20,overflow:`hidden`,display:`flex`,flexFlow:`column`},children:[(0,G.jsx)(`h2`,{children:`Please choose a css class`}),f&&(0,G.jsxs)(`div`,{children:[`The current parent has this class `,f]}),(0,G.jsx)(Gb,{component:`nav`,style:{overflow:`scroll`},children:n.names.map((e,t)=>(0,G.jsxs)(XQ,{button:!0,onClick:()=>d(e),children:[(0,G.jsx)(`div`,{style:{marginRight:20},children:e}),(0,G.jsx)(`div`,{dangerouslySetInnerHTML:{__html:p(e)}})]},`rule-${t}`))})]});Vg.render(m,o,()=>{let t=e.view.nodeDOM(e.state.selection.from)?.parentNode;if(t){let e=a.parentElement.parentElement.parentElement.getBoundingClientRect(),n=t.getBoundingClientRect();a.parentElement.parentElement.parentElement.appendChild(o),o.style.maxWidth=`500px`,o.style.position=`absolute`,o.style.top=0,o.style.zIndex=99999;let r=`${n.left+Math.abs(e.left)+t.offsetWidth+10}px`,i=`${n.x}px`;o.style.left=r;let s=o.offsetWidth;o.style.left=`unset`,o.style.right=i;let c=o.offsetWidth;o.style.left=`unset`,o.style.right=`unset`,s>=c?o.style.left=r:o.style.right=i,document.body.addEventListener(`click`,l)}})},$Q=FA.create({name:`cssmark`,addOptions(){return{classes:[]}},addAttributes(){return{class:{default:null,parseHTML:e=>e.getAttribute(`class`),renderHTML:e=>e.class?{class:e.class}:{}}}},parseHTML(){return[{tag:`span[class]`,getAttrs:e=>{let t=e.getAttribute(`class`)||``,n=this.options.classes.find(e=>t.includes(e));return n?{class:n}:!1}}]},renderHTML({HTMLAttributes:e}){return[`span`,Rk(e),0]},addCommands(){return{setCSSClass:e=>({commands:t})=>t.setMark(this.name,{class:e}),unsetCSSClass:()=>({commands:e})=>e.unsetMark(this.name),openCSSClassDialog:()=>({editor:e})=>{QQ({editor:e,selectedText:e.state.doc.textBetween(e.state.selection.from,e.state.selection.to),parentNode:e.state.selection.$from.nodeAfter,opts:this.options.extraCSSRules,callback:t=>{t&&e.chain().focus().setCSSClass(t).run()}})}}}}),e$=Object.defineProperty,t$=(e,t)=>{for(var n in t)e$(e,n,{get:t[n],enumerable:!0})},n$=`listItem`,r$=`textStyle`,i$=/^\s*([-+*])\s$/,a$=SM.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,Rk(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(n$,this.editor.getAttributes(r$)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=bM({find:i$,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=bM({find:i$,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(r$),editor:this.editor})),[e]}}),o$=SM.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Rk(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});t$({},{findListItemPos:()=>s$,getNextListDepth:()=>c$,handleBackspace:()=>f$,handleDelete:()=>h$,hasListBefore:()=>l$,hasListItemAfter:()=>g$,hasListItemBefore:()=>u$,listItemHasSubList:()=>d$,nextListIsDeeper:()=>p$,nextListIsHigher:()=>m$});var s$=(e,t)=>{let{$from:n}=t.selection,r=Qk(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},c$=(e,t)=>{let n=s$(e,t);if(!n)return!1;let[,r]=uA(t,e,n.$pos.pos+4);return r},l$=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},u$=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},d$=(e,t,n)=>{if(!n)return!1;let r=Qk(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},f$=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!hA(e.state,t)&&l$(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!hA(e.state,t)||!vA(e.state))return!1;let r=s$(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=d$(t,e.state,i);return u$(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},p$=(e,t)=>{let n=c$(e,t),r=s$(e,t);return!r||!n?!1:n>r.depth},m$=(e,t)=>{let n=c$(e,t),r=s$(e,t);return!r||!n?!1:n<r.depth},h$=(e,t)=>{if(!hA(e.state,t)||!_A(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:p$(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():m$(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},g$=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},_$=UA.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&h$(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&h$(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&f$(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&f$(e,n,r)&&(t=!0)}),t}}}}),v$=`listItem`,y$=`textStyle`,b$=/^(\d+)\.\s$/,x$=SM.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,Rk(this.options.HTMLAttributes,n),0]:[`ol`,Rk(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(v$,this.editor.getAttributes(y$)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=bM({find:b$,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=bM({find:b$,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(y$)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),S$=/^\s*(\[([( |x])?\])\s$/,C$=SM.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,Rk(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};return l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)}),{dom:i,contentDOM:c,update:e=>e.type===this.type?(i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e),!0):!1}}},addInputRules(){return[bM({find:S$,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),w$=SM.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,Rk(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});UA.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(a$.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(o$.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(_$.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(x$.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(C$.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(w$.configure(this.options.taskList)),e}});var T$=o$.extend({content:`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`}),E$=SM.create({name:`headingParagraph`,group:`block`,content:`inline*`,defining:!0,addAttributes(){return{"data-heading":{default:`heading1`,parseHTML:e=>e.getAttribute(`data-heading`),renderHTML:e=>({"data-heading":e[`data-heading`]})}}},parseHTML(){return[{tag:`p[data-heading]`}]},renderHTML({HTMLAttributes:e}){return[`p`,Rk(e),0]},addCommands(){return{toggleHeadingParagraph:()=>({commands:e,editor:t})=>t.isActive(`headingParagraph`)?e.setNode(`paragraph`):e.setNode(`headingParagraph`,{"data-heading":`heading1`})}}}),D$=e=>{if(!e)return;let t=/^calc\((.*)\)$/;if(typeof e==`string`){if(e.endsWith(`%`))return;if(e.endsWith(`px`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`ch`)||e.endsWith(`em`)||e.match(t))return e;let n=parseInt(e,10);return Number.isNaN(n)?n:`${n}px`}if(typeof e==`number`)return`${e}px`},O$=L_((0,G.jsx)(`path`,{d:`M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5`}),`FormatBold`),k$=L_((0,G.jsx)(`path`,{d:`M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z`}),`FormatItalic`),A$=L_((0,G.jsx)(`path`,{d:`M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z`}),`FormatStrikethrough`),j$=L_((0,G.jsx)(`path`,{d:`M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z`}),`Code`),M$=L_((0,G.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z`}),`GridOn`),N$=L_((0,G.jsx)(`path`,{d:`M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z`}),`FormatListBulleted`),P$=L_((0,G.jsx)(`path`,{d:`M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z`}),`FormatListNumbered`),F$=L_((0,G.jsx)(`path`,{d:`M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z`}),`FormatUnderlined`),I$=L_((0,G.jsx)(`path`,{d:`M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z`}),`Functions`),L$=L_((0,G.jsx)(`path`,{d:`M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z`}),`Image`),R$=L_((0,G.jsx)(`path`,{d:`M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z`}),`Redo`),z$=L_((0,G.jsx)(`path`,{d:`M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z`}),`FormatQuote`),B$=L_((0,G.jsx)(`path`,{d:`M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3zM8 17H6v-2h2zm0-4H6v-2h2zm0-4H6V7h2zm10 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V7h2z`}),`Theaters`),V$=L_((0,G.jsx)(`path`,{d:`M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77`}),`VolumeUp`),H$=L_((0,G.jsx)(`path`,{d:`M3 3v18h18V3zm8 16H5v-6h6zm0-8H5V5h6zm8 8h-6v-6h6zm0-8h-6V5h6z`}),`BorderAll`),U$=J(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans !important`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,top:`7px`,width:`110px`,height:`28px`,whiteSpace:`nowrap`})),W$=()=>(0,G.jsx)(U$,{children:`+ Response Area`}),G$={characters:[[`á`,`é`,`í`,`ó`,`ú`],[`Á`,`É`,`Í`,`Ó`,`Ú`],[`—`,`«`,`»`,`ñ`,`ü`],[`-`,`¿`,`¡`,`Ñ`,`Ü`]]},K$={hasPreview:!0,characters:[[{unicode:`U+00A2`,description:`CENT SIGN`,write:`¢`,label:`¢`},{unicode:`U+00BF`,description:`INVERTED QUESTION MARK`,write:`¿`,label:`¿`},{unicode:`U+00B4`,description:`ACUTE ACCENT`,write:`´`,label:`´`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E1`,description:`LATIN SMALL LETTER A WITH ACUTE`,write:`á`,label:`á`},{unicode:`U+00E9`,description:`LATIN SMALL LETTER E WITH ACUTE`,write:`é`,label:`é`},{unicode:`U+00ED`,description:`LATIN SMALL LETTER I WITH ACUTE`,write:`í`,label:`í`},{unicode:`U+00F3`,description:`LATIN SMALL LETTER O WITH ACUTE`,write:`ó`,label:`ó`},{unicode:`U+00FA`,description:`LATIN SMALL LETTER U WITH ACUTE`,write:`ú`,label:`ú`},{unicode:`U+00F1`,description:`LATIN SMALL LETTER N WITH TILDE`,write:`ñ`,label:`ñ`}],[{unicode:`U+20AC`,description:`EURO SIGN`,write:`€`,label:`€`},{unicode:`U+00A1`,description:`INVERTED EXCLAMATION MARK`,write:`¡`,label:`¡`},{unicode:`U+00C1`,description:`LATIN CAPITAL LETTER A WITH ACUTE`,write:`Á`,label:`Á`},{unicode:`U+00C9`,description:`LATIN CAPITAL LETTER E WITH ACUTE`,write:`É`,label:`É`},{unicode:`U+00CD`,description:`LATIN CAPITAL LETTER I WITH ACUTE`,write:`Í`,label:`Í`},{unicode:`U+00D3`,description:`LATIN CAPITAL LETTER O WITH ACUTE`,write:`Ó`,label:`Ó`},{unicode:`U+00DA`,description:`LATIN CAPITAL LETTER U WITH ACUTE`,write:`Ú`,label:`Ú`},{unicode:`U+00D1`,description:`LATIN CAPITAL LETTER N WITH TILDE`,write:`Ñ`,label:`Ñ`}],[{unicode:`U+00A3`,description:`POUND SIGN`,write:`£`,label:`£`},{unicode:`U+00AB`,description:`LEFT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`«`,label:`«`},{unicode:`U+005E`,description:`CIRCUMFLEX ACCENT`,write:`^`,label:`^`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E2`,description:`LATIN SMALL LETTER A WITH CIRCUMFLEX`,write:`â`,label:`â`},{unicode:`U+00EA`,description:`LATIN SMALL LETTER E WITH CIRCUMFLEX`,write:`ê`,label:`ê`},{unicode:`U+00EE`,description:`LATIN SMALL LETTER I WITH CIRCUMFLEX`,write:`î`,label:`î`},{unicode:`U+00F4`,description:`LATIN SMALL LETTER O WITH CIRCUMFLEX`,write:`ô`,label:`ô`},{unicode:`U+00FB`,description:`LATIN SMALL LETTER U WITH CIRCUMFLEX`,write:`û`,label:`û`},{unicode:`U+00E7`,description:`LATIN SMALL LETTER C WITH CEDILLA`,write:`ç`,label:`ç`}],[{unicode:`U+00A5`,description:`YEN SIGN`,write:`¥`,label:`¥`},{unicode:`U+00BB`,description:`RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`»`,label:`»`},{unicode:`U+00C2`,description:`LATIN CAPITAL LETTER A WITH CIRCUMFLEX`,write:`Â`,label:`Â`},{unicode:`U+00CA`,description:`LATIN CAPITAL LETTER E WITH CIRCUMFLEX`,write:`Ê`,label:`Ê`},{unicode:`U+00CE`,description:`LATIN CAPITAL LETTER I WITH CIRCUMFLEX`,write:`Î`,label:`Î`},{unicode:`U+00D4`,description:`LATIN CAPITAL LETTER O WITH CIRCUMFLEX`,write:`Ô`,label:`Ô`},{unicode:`U+00DB`,description:`LATIN CAPITAL LETTER U WITH CIRCUMFLEX`,write:`Û`,label:`Û`},{unicode:`U+00C7`,description:`LATIN CAPITAL LETTER C WITH CEDILLA`,write:`Ç`,label:`Ç`}],[{unicode:`U+200A`,description:`HAIR SPACE`,write:String.fromCodePoint(`0x200A`),label:`&hairsp;`},{unicode:`U+00A7`,description:`SECTION SIGN`,write:`§`,label:`§`},{unicode:`U+00A8`,description:`DIAERESIS`,write:`¨`,label:`¨`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E4`,description:`LATIN SMALL LETTER A WITH DIAERESIS`,write:`ä`,label:`ä`},{unicode:`U+00EB`,description:`LATIN SMALL LETTER E WITH DIAERESIS`,write:`ë`,label:`ë`},{unicode:`U+00EF`,description:`LATIN SMALL LETTER I WITH DIAERESIS`,write:`ï`,label:`ï`},{unicode:`U+00F6`,description:`LATIN SMALL LETTER O WITH DIAERESIS`,write:`ö`,label:`ö`},{unicode:`U+00FC`,description:`LATIN SMALL LETTER U WITH DIAERESIS`,write:`ü`,label:`ü`},{unicode:`U+00DF`,description:`LATIN SMALL LETTER SHARP S`,write:`ß`,label:`ß`}],[{unicode:`U+2009`,description:`THIN SPACE`,write:String.fromCodePoint(`0x2009`),label:`&thinsp;`},{unicode:`U+2026`,description:`HORIZONTAL ELLIPSIS`,write:`…`,label:`…`},{unicode:`U+00C4`,description:`LATIN CAPITAL LETTER A WITH DIAERESIS`,write:`Ä`,label:`Ä`},{unicode:`U+00CB`,description:`LATIN CAPITAL LETTER E WITH DIAERESIS`,write:`Ë`,label:`Ë`},{unicode:`U+00CF`,description:`LATIN CAPITAL LETTER I WITH DIAERESIS`,write:`Ï`,label:`Ï`},{unicode:`U+00D6`,description:`LATIN CAPITAL LETTER O WITH DIAERESIS`,write:`Ö`,label:`Ö`},{unicode:`U+00DC`,description:`LATIN CAPITAL LETTER U WITH DIAERESIS`,write:`Ü`,label:`Ü`},{unicode:`U+2212`,description:`MINUS SIGN`,write:`−`,label:`−`}],[{unicode:`U+00A0`,description:`NO-BREAK SPACE`,write:String.fromCodePoint(`0x00A0`),label:`&nbsp;`},{unicode:`U+2022`,description:`BULLET`,write:`•`,label:`•`},{unicode:`U+0060`,description:`GRAVE ACCENT`,write:"`",label:"`",extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E0`,description:`LATIN SMALL LETTER A WITH GRAVE`,write:`à`,label:`à`},{unicode:`U+00E8`,description:`LATIN SMALL LETTER E WITH GRAVE`,write:`è`,label:`è`},{unicode:`U+00EC`,description:`LATIN SMALL LETTER I WITH GRAVE`,write:`ì`,label:`ì`},{unicode:`U+00F2`,description:`LATIN SMALL LETTER O WITH GRAVE`,write:`ò`,label:`ò`},{unicode:`U+00F9`,description:`LATIN SMALL LETTER U WITH GRAVE`,write:`ù`,label:`ù`},{unicode:`U+2013`,description:`EN DASH`,write:`–`,label:`–`}],[{unicode:`U+2003`,description:`EM SPACE`,write:String.fromCodePoint(`0x2003`),label:`&emsp;`},{unicode:`U+25E6`,description:`WHITE BULLET`,write:`◦`,label:`◦`},{unicode:`U+00C0`,description:`LATIN CAPITAL LETTER A WITH GRAVE`,write:`À`,label:`À`},{unicode:`U+00C8`,description:`LATIN CAPITAL LETTER E WITH GRAVE`,write:`È`,label:`È`},{unicode:`U+00CC`,description:`LATIN CAPITAL LETTER I WITH GRAVE`,write:`Ì`,label:`Ì`},{unicode:`U+00D2`,description:`LATIN CAPITAL LETTER O WITH GRAVE`,write:`Ò`,label:`Ò`},{unicode:`U+00D9`,description:`LATIN CAPITAL LETTER U WITH GRAVE`,write:`Ù`,label:`Ù`},{unicode:`U+2014`,description:`EM DASH`,write:`—`,label:`—`}]]},q$=()=>(0,G.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),J$=()=>(0,G.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),Y$=()=>(0,G.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z`,fill:`currentColor`})}),X$=()=>(0,G.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),Z$=({editor:e,onChange:t})=>{let[n,r]=(0,W.useState)(!1),i;switch(!0){case e.isActive({textAlign:`right`}):i=(0,G.jsx)(J$,{});break;case e.isActive({textAlign:`center`}):i=(0,G.jsx)(Y$,{});break;case e.isActive({textAlign:`justify`}):i=(0,G.jsx)(X$,{});break;default:i=(0,G.jsx)(q$,{});break}let a=t=>{let n=t.currentTarget?.getAttribute(`value`);n&&e.commands.setTextAlign(n),r(!1)};return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},onClick:e=>{e.preventDefault(),e.stopPropagation(),r(!n)},children:[i,(0,G.jsx)(`span`,{style:{marginLeft:`5px`,fontSize:`8px`},children:`▼`})]}),(0,G.jsx)(uy,{in:n,timeout:`auto`,unmountOnExit:!0,style:{position:`absolute`},children:(0,G.jsxs)(Gb,{component:`div`,disablePadding:!0,style:{background:`#fff`,display:`flex`,flexDirection:`row`,padding:0},children:[(0,G.jsx)(XQ,{button:!0,type:`submit`,value:`left`,"aria-label":`Align text left`,onClick:a,children:(0,G.jsx)(q$,{})}),(0,G.jsx)(XQ,{button:!0,type:`submit`,value:`center`,"aria-label":`Align text center`,onClick:a,children:(0,G.jsx)(Y$,{})}),(0,G.jsx)(XQ,{button:!0,type:`submit`,value:`right`,"aria-label":`Align text right`,onClick:a,children:(0,G.jsx)(J$,{})}),(0,G.jsx)(XQ,{button:!0,type:`submit`,value:`justify`,"aria-label":`Justify text`,onClick:a,children:(0,G.jsx)(X$,{})})]})})]})},Q$=J(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans, Arial, sans-serif`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,whiteSpace:`nowrap`})),$$=()=>(0,G.jsx)(Q$,{children:`CSS`}),e1=J(`path`)({fill:`grey`,"&:hover":{fill:`black`}}),t1=e=>t=>(0,G.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,version:`1.1`,width:`24`,height:`24`,viewBox:`0 0 24 24`,children:(0,G.jsx)(e,{...t})}),n1=t1(e=>(0,G.jsx)(e1,{...e,d:`M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z`})),r1=t1(e=>(0,G.jsx)(e1,{...e,d:`M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z`})),i1=t1(e=>(0,G.jsx)(e1,{...e,d:`M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z`})),a1=t1(e=>(0,G.jsx)(e1,{...e,d:`M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z`})),o1=t1(e=>(0,G.jsx)(e1,{...e,d:`M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z`})),s1=`bottom`,c1=`right`,l1=`left`,u1=`auto`,d1=[`top`,s1,c1,l1],f1=`start`,p1=`clippingParents`,m1=`viewport`,h1=`popper`,g1=`reference`,_1=d1.reduce(function(e,t){return e.concat([t+`-`+f1,t+`-end`])},[]),v1=[].concat(d1,[u1]).reduce(function(e,t){return e.concat([t,t+`-`+f1,t+`-end`])},[]),y1=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function b1(e){return e?(e.nodeName||``).toLowerCase():null}function x1(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function S1(e){return e instanceof x1(e).Element||e instanceof Element}function C1(e){return e instanceof x1(e).HTMLElement||e instanceof HTMLElement}function w1(e){return typeof ShadowRoot>`u`?!1:e instanceof x1(e).ShadowRoot||e instanceof ShadowRoot}function T1(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!C1(i)||!b1(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function E1(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!C1(r)||!b1(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var D1={name:`applyStyles`,enabled:!0,phase:`write`,fn:T1,effect:E1,requires:[`computeStyles`]};function O1(e){return e.split(`-`)[0]}var k1=Math.max,A1=Math.min,j1=Math.round;function M1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function N1(){return!/^((?!chrome|android).)*safari/i.test(M1())}function P1(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&C1(e)&&(i=e.offsetWidth>0&&j1(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&j1(r.height)/e.offsetHeight||1);var o=(S1(e)?x1(e):window).visualViewport,s=!N1()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function F1(e){var t=P1(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function I1(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w1(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function L1(e){return x1(e).getComputedStyle(e)}function R1(e){return[`table`,`td`,`th`].indexOf(b1(e))>=0}function z1(e){return((S1(e)?e.ownerDocument:e.document)||window.document).documentElement}function B1(e){return b1(e)===`html`?e:e.assignedSlot||e.parentNode||(w1(e)?e.host:null)||z1(e)}function V1(e){return!C1(e)||L1(e).position===`fixed`?null:e.offsetParent}function H1(e){var t=/firefox/i.test(M1());if(/Trident/i.test(M1())&&C1(e)&&L1(e).position===`fixed`)return null;var n=B1(e);for(w1(n)&&(n=n.host);C1(n)&&[`html`,`body`].indexOf(b1(n))<0;){var r=L1(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function U1(e){for(var t=x1(e),n=V1(e);n&&R1(n)&&L1(n).position===`static`;)n=V1(n);return n&&(b1(n)===`html`||b1(n)===`body`&&L1(n).position===`static`)?t:n||H1(e)||t}function W1(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function G1(e,t,n){return k1(e,A1(t,n))}function K1(e,t,n){var r=G1(e,t,n);return r>n?n:r}function q1(){return{top:0,right:0,bottom:0,left:0}}function J1(e){return Object.assign({},q1(),e)}function Y1(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var X1=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,J1(typeof e==`number`?Y1(e,d1):e)};function Z1(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=O1(n.placement),c=W1(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=X1(i.padding,n),d=F1(a),f=c===`y`?`top`:l1,p=c===`y`?s1:c1,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=U1(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=G1(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function Q1(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||I1(t.elements.popper,r)&&(t.elements.arrow=r))}var $1={name:`arrow`,enabled:!0,phase:`main`,fn:Z1,effect:Q1,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function e0(e){return e.split(`-`)[1]}var t0={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function n0(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:j1(n*i)/i||0,y:j1(r*i)/i||0}}function r0(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=l1,b=`top`,x=window;if(l){var S=U1(n),C=`clientHeight`,w=`clientWidth`;if(S===x1(n)&&(S=z1(n),L1(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=s1;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=c1;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&t0),O=u===!0?n0({x:p,y:h},x1(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function i0(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,c=s===void 0?!0:s,l={placement:O1(t.placement),variation:e0(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,r0(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,r0(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var a0={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:i0,data:{}},o0={passive:!0};function s0(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,c=x1(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,o0)}),s&&c.addEventListener(`resize`,n.update,o0),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,o0)}),s&&c.removeEventListener(`resize`,n.update,o0)}}var c0={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:s0,data:{}},l0={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function u0(e){return e.replace(/left|right|bottom|top/g,function(e){return l0[e]})}var Fie={start:`end`,end:`start`};function d0(e){return e.replace(/start|end/g,function(e){return Fie[e]})}function f0(e){var t=x1(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function p0(e){return P1(z1(e)).left+f0(e).scrollLeft}function m0(e,t){var n=x1(e),r=z1(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=N1();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+p0(e),y:c}}function h0(e){var t=z1(e),n=f0(e),r=e.ownerDocument?.body,i=k1(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=k1(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+p0(e),s=-n.scrollTop;return L1(r||t).direction===`rtl`&&(o+=k1(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function g0(e){var t=L1(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function _0(e){return[`html`,`body`,`#document`].indexOf(b1(e))>=0?e.ownerDocument.body:C1(e)&&g0(e)?e:_0(B1(e))}function v0(e,t){t===void 0&&(t=[]);var n=_0(e),r=n===e.ownerDocument?.body,i=x1(n),a=r?[i].concat(i.visualViewport||[],g0(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(v0(B1(a)))}function y0(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function b0(e,t){var n=P1(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function x0(e,t,n){return t===`viewport`?y0(m0(e,n)):S1(t)?b0(t,n):y0(h0(z1(e)))}function S0(e){var t=v0(B1(e)),n=[`absolute`,`fixed`].indexOf(L1(e).position)>=0&&C1(e)?U1(e):e;return S1(n)?t.filter(function(e){return S1(e)&&I1(e,n)&&b1(e)!==`body`}):[]}function C0(e,t,n,r){var i=t===`clippingParents`?S0(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=x0(e,n,r);return t.top=k1(i.top,t.top),t.right=A1(i.right,t.right),t.bottom=A1(i.bottom,t.bottom),t.left=k1(i.left,t.left),t},x0(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function w0(e){var t=e.reference,n=e.element,r=e.placement,i=r?O1(r):null,a=r?e0(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case s1:c={x:o,y:t.y+t.height};break;case c1:c={x:t.x+t.width,y:s};break;case l1:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?W1(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case f1:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2);break;default:}}return c}function T0(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?p1:s,l=n.rootBoundary,u=l===void 0?m1:l,d=n.elementContext,f=d===void 0?h1:d,p=n.altBoundary,m=p===void 0?!1:p,h=n.padding,g=h===void 0?0:h,_=J1(typeof g==`number`?Y1(g,d1):g),v=f===`popper`?g1:h1,y=e.rects.popper,b=e.elements[m?v:f],x=C0(S1(b)?b:b.contextElement||z1(e.elements.popper),c,u,o),S=P1(e.elements.reference),C=w0({reference:S,element:y,strategy:`absolute`,placement:i}),w=y0(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function E0(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?v1:c,u=e0(r),d=u?s?_1:_1.filter(function(e){return e0(e)===u}):d1,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=T0(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[O1(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function D0(e){if(O1(e)===`auto`)return[];var t=u0(e);return[d0(e),t,d0(t)]}function O0(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,h=n.allowedAutoPlacements,g=t.options.placement,_=O1(g)===g,v=c||(_||!m?[u0(g)]:D0(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(O1(n)===`auto`?E0(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=O1(E),O=e0(E)===f1,k=[`top`,s1].indexOf(D)>=0,A=k?`width`:`height`,j=T0(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?c1:l1:O?s1:`top`;b[A]>x[A]&&(M=u0(M));var N=u0(M),P=[];if(a&&P.push(j[D]<=0),s&&P.push(j[M]<=0,j[N]<=0),P.every(function(e){return e})){w=E,C=!1;break}S.set(E,P)}if(C)for(var F=m?3:1,ee=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},te=F;te>0&&ee(te)!==`break`;te--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var k0={name:`flip`,enabled:!0,phase:`main`,fn:O0,requiresIfExists:[`offset`],data:{_skip:!1}};function A0(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function j0(e){return[`top`,c1,s1,l1].some(function(t){return e[t]>=0})}function M0(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=T0(t,{elementContext:`reference`}),s=T0(t,{altBoundary:!0}),c=A0(o,r),l=A0(s,i,a),u=j0(c),d=j0(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var N0={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:M0};function P0(e,t,n){var r=O1(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function F0(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=v1.reduce(function(e,n){return e[n]=P0(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var I0={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:F0};function L0(e){var t=e.state,n=e.name;t.modifiersData[n]=w0({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var R0={name:`popperOffsets`,enabled:!0,phase:`read`,fn:L0,data:{}};function z0(e){return e===`x`?`y`:`x`}function B0(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,m=n.tetherOffset,h=m===void 0?0:m,g=T0(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=O1(t.placement),v=e0(t.placement),y=!v,b=W1(_),x=z0(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:l1,A=b===`y`?s1:c1,j=b===`y`?`height`:`width`,M=S[b],N=M+g[k],P=M-g[A],F=p?-w[j]/2:0,ee=v===`start`?C[j]:w[j],te=v===`start`?-w[j]:-C[j],I=t.elements.arrow,ne=p&&I?F1(I):{width:0,height:0},re=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:q1(),ie=re[k],L=re[A],R=G1(0,C[j],ne[j]),ae=y?C[j]/2-F-R-ie-E.mainAxis:ee-R-ie-E.mainAxis,z=y?-C[j]/2+F+R+L+E.mainAxis:te+R+L+E.mainAxis,B=t.elements.arrow&&U1(t.elements.arrow),oe=B?b===`y`?B.clientTop||0:B.clientLeft||0:0,se=D?.[b]??0,ce=M+ae-se-oe,V=M+z-se,le=G1(p?A1(N,ce):N,M,p?k1(P,V):P);S[b]=le,O[b]=le-M}if(s){var ue=b===`x`?`top`:l1,de=b===`x`?s1:c1,H=S[x],fe=x===`y`?`height`:`width`,pe=H+g[ue],me=H-g[de],he=[`top`,l1].indexOf(_)!==-1,ge=D?.[x]??0,U=he?pe:H-C[fe]-w[fe]-ge+E.altAxis,_e=he?H+C[fe]+w[fe]-ge-E.altAxis:me,ve=p&&he?K1(U,H,_e):G1(p?U:pe,H,p?_e:me);S[x]=ve,O[x]=ve-H}t.modifiersData[r]=O}}var V0={name:`preventOverflow`,enabled:!0,phase:`main`,fn:B0,requiresIfExists:[`offset`]};function H0(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function U0(e){return e===x1(e)||!C1(e)?f0(e):H0(e)}function W0(e){var t=e.getBoundingClientRect(),n=j1(t.width)/e.offsetWidth||1,r=j1(t.height)/e.offsetHeight||1;return n!==1||r!==1}function G0(e,t,n){n===void 0&&(n=!1);var r=C1(t),i=C1(t)&&W0(t),a=z1(t),o=P1(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((b1(t)!==`body`||g0(a))&&(s=U0(t)),C1(t)?(c=P1(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=p0(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function K0(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function q0(e){var t=K0(e);return y1.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function J0(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function Y0(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var X0={placement:`bottom`,modifiers:[],strategy:`absolute`};function Z0(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function Q0(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?X0:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},X0,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:S1(e)?v0(e):e.contextElement?v0(e.contextElement):[],popper:v0(t)};var s=q0(Y0([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(Z0(t,n)){i.rects={reference:G0(t,U1(n),i.options.strategy===`fixed`),popper:F1(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:J0(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!Z0(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var $0=Q0({defaultModifiers:[c0,R0,a0,D1,I0,k0,V0,$1,N0]});function e2(e){return Qr(`MuiPopper`,e)}$r(`MuiPopper`,[`root`]),M();function t2(e,t){if(t===`ltr`)return e;switch(e){case`bottom-end`:return`bottom-start`;case`bottom-start`:return`bottom-end`;case`top-end`:return`top-start`;case`top-start`:return`top-end`;default:return e}}function n2(e){return typeof e==`function`?e():e}function r2(e){return e.nodeType!==void 0}var i2=e=>{let{classes:t}=e;return ba({root:[`root`]},e2,t)},a2={},o2=W.forwardRef(function(e,t){let{anchorEl:n,children:r,direction:i,disablePortal:a,modifiers:o,open:s,placement:c,popperOptions:l,popperRef:u,slotProps:d={},slots:f={},TransitionProps:p,ownerState:m,...h}=e,g=W.useRef(null),_=a_(g,t),v=W.useRef(null),y=a_(v,u),b=W.useRef(y);pi(()=>{b.current=y},[y]),W.useImperativeHandle(u,()=>v.current,[]);let x=t2(c,i),[S,C]=W.useState(x),[w,T]=W.useState(n2(n));W.useEffect(()=>{v.current&&v.current.forceUpdate()}),W.useEffect(()=>{n&&T(n2(n))},[n]),pi(()=>{if(!w||!s)return;let e=e=>{C(e.placement)},t=[{name:`preventOverflow`,options:{altBoundary:a}},{name:`flip`,options:{altBoundary:a}},{name:`onUpdate`,enabled:!0,phase:`afterWrite`,fn:({state:t})=>{e(t)}}];o!=null&&(t=t.concat(o)),l&&l.modifiers!=null&&(t=t.concat(l.modifiers));let n=$0(w,g.current,{placement:x,...l,modifiers:t});b.current(n);let r=g.current;return()=>{if(r){let{style:e}=r,t=e.position,i=e.top,a=e.left,o=e.transform;n.destroy(),e.position=t,e.top=i,e.left=a,e.transform=o}else n.destroy();b.current(null)}},[w,a,o,s,l,x]);let E={placement:S};p!==null&&(E.TransitionProps=p);let D=i2(e),O=f.root??`div`;return(0,G.jsx)(O,{...Bb({elementType:O,externalSlotProps:d.root,externalForwardedProps:h,additionalProps:{role:`tooltip`,ref:_},ownerState:e,className:D.root}),children:typeof r==`function`?r(E):r})}),s2=W.forwardRef(function(e,t){let{anchorEl:n,children:r,container:i,direction:a=`ltr`,disablePortal:o=!1,keepMounted:s=!1,modifiers:c,open:l,placement:u=`bottom`,popperOptions:d=a2,popperRef:f,style:p,transition:m=!1,slotProps:h={},slots:g={},..._}=e,[v,y]=W.useState(!0),b=()=>{y(!1)},x=()=>{y(!0)};if(!s&&!l&&(!m||v))return null;let S;if(i)S=i;else if(n){let e=n2(n);S=e&&r2(e)?bg(e).body:bg(null).body}let C=!l&&s&&(!m||v)?`none`:void 0,w=m?{in:l,onEnter:b,onExited:x}:void 0;return(0,G.jsx)(v_,{disablePortal:o,container:S,children:(0,G.jsx)(o2,{anchorEl:n,direction:a,disablePortal:o,modifiers:c,ref:t,open:m?!v:l,placement:u,popperOptions:d,popperRef:f,slotProps:h,slots:g,..._,style:{position:`fixed`,top:0,left:0,display:C,...p},TransitionProps:w,children:r})})});M();var c2=J(s2,{name:`MuiPopper`,slot:`Root`})({}),l2=J(W.forwardRef(function(e,t){let n=zi(),{anchorEl:r,component:i,components:a,componentsProps:o,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,slots:g,slotProps:_,...v}=_g({props:e,name:`MuiPopper`}),y=g?.root??a?.Root,b={anchorEl:r,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,...v};return(0,G.jsx)(c2,{as:i,direction:n?`rtl`:`ltr`,slots:{root:y},slotProps:_??o,...b,ref:t})}))({background:`#fff`,padding:`10px`,pointerEvents:`none`,zIndex:99999}),u2=J(gJ)({fontSize:50,textAlign:`center`}),d2=({children:e,...t})=>(0,G.jsx)(l2,{id:`mouse-over-popover`,open:!0,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableRestoreFocus:!0,disableAutoFocus:!0,...t,children:(0,G.jsx)(u2,{children:e})});M();var f2=({letter:e})=>(0,G.jsx)(`div`,{style:{fontSize:`24px`,lineHeight:`24px`},children:e});f2.propTypes={letter:j.string};function p2({editor:e,opts:t,onClose:n}){if(!t?.characters?.length)return null;let r=(0,W.useRef)(null),i=(0,W.useRef)(n),[a,o]=(0,W.useState)({top:0,left:0}),[s,c]=(0,W.useState)(null);i.current=n;let l=(0,W.useMemo)(()=>{if(!t)return G$;switch(!0){case t.language===`spanish`:return G$;case t.language===`special`:return K$;default:return t}},[t]),u=(0,W.useMemo)(()=>l.characters.reduce((e,t)=>(t.length>=e.columns&&(e.columns=t.length),e),{rows:l.characters.length,columns:0}),[l]),d=()=>c(null);(0,W.useEffect)(()=>()=>{d()},[]),(0,W.useEffect)(()=>{if(!e)return;let t=e.options.element.getBoundingClientRect(),n=document.body.getBoundingClientRect(),{from:a}=e.state.selection,s=e.view.coordsAtPos(a),c=t.top+Math.abs(n.top)+t.height+60;t.y>r.current.offsetHeight&&(c=c-(r.current.offsetHeight+t.height)-80),o({top:c,left:s.left});let l=e.view.dom,u=e=>{r.current&&!r.current.contains(e.target)&&!l.contains(e.target)&&i.current()},d=setTimeout(()=>{document.addEventListener(`click`,u)});return()=>{clearTimeout(d),document.removeEventListener(`click`,u)}},[e]);let f=(e,t)=>c({anchorEl:e.currentTarget,el:t});return(0,G.jsxs)(G.Fragment,{children:[Vg.createPortal((0,G.jsx)(`div`,{ref:r,className:`insert-character-dialog`,"data-toolbar-for":e.instanceId,style:{visibility:a.top===0&&a.left===0?`hidden`:`initial`,position:`absolute`,top:`${a.top}px`,left:`${a.left}px`,maxWidth:`500px`,zIndex:99},children:(0,G.jsx)(`div`,{children:(0,G.jsx)(gX,{keyPadCharacterRef:t.keyPadCharacterRef,setKeypadInteraction:t.setKeypadInteraction,autoFocus:!0,noDecimal:!0,hideInput:!0,noLatexHandling:!0,hideDoneButtonBackground:!0,layoutForKeyPad:u,additionalKeys:l.characters.reduce((e,t)=>(e=[...e,...t.map(e=>({name:Su(e,`name`)||e,write:Su(e,`write`)||e,label:Su(e,`label`)||e,category:`character`,extraClass:`character`,extraProps:{...e.extraProps||{},style:{...(e.extraProps||{}).style,border:`1px solid #000`}},...l.hasPreview?{actions:{onMouseEnter:t=>f(t,e),onMouseLeave:d}}:{}}))],e),[]),keypadMode:`language`,onChange:t=>{typeof t==`string`&&e.chain().focus().insertContent(t).run()},onDone:n})})}),document.body),s&&Vg.createPortal((0,G.jsxs)(d2,{onClose:d,anchorEl:s.anchorEl,children:[(0,G.jsx)(`div`,{children:s.el.label}),(0,G.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.description}),(0,G.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.unicode})]}),document.body)]})}p2.propTypes={editor:j.object,opts:j.object,onClose:j.func.isRequired};var m2=()=>(0,G.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,children:(0,G.jsx)(`path`,{d:`M22,7h-2v1h3v1h-4V7c0-0.55,0.45-1,1-1h2V5h-3V4h3c0.55,0,1,0.45,1,1v1C23,6.55,22.55,7,22,7z M5.88,20h2.66l3.4-5.42h0.12 l3.4,5.42h2.66l-4.65-7.27L17.81,6h-2.68l-3.07,4.99h-0.12L8.85,6H6.19l4.32,6.73L5.88,20z`,fill:`currentColor`})}),h2=()=>(0,G.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,children:(0,G.jsx)(`path`,{d:`M22,18h-2v1h3v1h-4v-2c0-0.55,0.45-1,1-1h2v-1h-3v-1h3c0.55,0,1,0.45,1,1v1C23,17.55,22.55,18,22,18z M5.88,18h2.66 l3.4-5.42h0.12l3.4,5.42h2.66l-4.65-7.27L17.81,4h-2.68l-3.07,4.99h-0.12L8.85,4H6.19l4.32,6.73L5.88,18z`,fill:`currentColor`})}),g2=()=>(0,G.jsx)(`svg`,{width:`30`,height:`28`,viewBox:`0 0 30 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{width:`20px`,height:`18px`},children:(0,G.jsx)(`path`,{d:`M27 4V24H29C29.5 24 30 24.5 30 25V27C30 27.5625 29.5 28 29 28H19C18.4375 28 18 27.5625 18 27V25C18 24.5 18.4375 24 19 24H21V16H9V24H11C11.5 24 12 24.5 12 25V27C12 27.5625 11.5 28 11 28H1C0.4375 28 0 27.5625 0 27V25C0 24.5 0.4375 24 1 24H3V4H1C0.4375 4 0 3.5625 0 3V1C0 0.5 0.4375 0 1 0H11C11.5 0 12 0.5 12 1V3C12 3.5625 11.5 4 11 4H9V12H21V4H19C18.4375 4 18 3.5625 18 3V1C18 0.5 18.4375 0 19 0H29C29.5 0 30 0.5 30 1V3C30 3.5625 29.5 4 29 4H27Z`,fill:`currentColor`})});function _2({editor:e,classes:t,activePlugins:n,toolbarOpts:r,responseAreaProps:i,onChange:a,autoWidthToolbar:o}){let[s,c]=(0,W.useState)(!1),l=r??{},u=RM({editor:e,selector:e=>{let{selection:t}=e.editor?.state||{},n;t instanceof UC&&(n=t.node);let r=e.editor?.isActive(`math`)||e.editor?.isActive(`explicit_constructed_response`)||e.editor?.isActive(`imageUploadNode`)||e.editor?.isActive(`drag_in_the_blank`),i=t&&t.empty===!1&&e.editor.isActive(`table`);return{currentNode:n,hideDefaultToolbar:r,hasTextSelectionInTable:i,isFocused:e.editor?.isFocused,isBold:e.editor.isActive(`bold`)??!1,canBold:e.editor.can().chain().toggleBold().run()??!1,isTable:e.editor.isActive(`table`)??!1,tableHasBorder:e.editor.getAttributes(`table`)?.border===`1`,canTable:e.editor.can().chain().insertTable().run()??!1,isItalic:e.editor.isActive(`italic`)??!1,canItalic:e.editor.can().chain().toggleItalic().run()??!1,isStrike:e.editor.isActive(`strike`)??!1,canStrike:e.editor.can().chain().toggleStrike().run()??!1,isCode:e.editor.isActive(`code`)??!1,canCode:e.editor.can().chain().toggleCode().run()??!1,canClearMarks:e.editor.can().chain().unsetAllMarks().run()??!1,isUnderline:e.editor.isActive(`underline`)??!1,isSubScript:e.editor.isActive(`subscript`)??!1,isSuperScript:e.editor.isActive(`superscript`)??!1,isParagraph:e.editor.isActive(`paragraph`)??!1,isHeading1:e.editor.isActive(`heading`,{level:1})??!1,isHeading2:e.editor.isActive(`heading`,{level:2})??!1,isHeading3:e.editor.isActive(`heading`,{level:3})??!1,isHeadingParagraph:e.editor.isActive(`headingParagraph`)??!1,isHeading4:e.editor.isActive(`heading`,{level:4})??!1,isHeading5:e.editor.isActive(`heading`,{level:5})??!1,isHeading6:e.editor.isActive(`heading`,{level:6})??!1,isBulletList:e.editor.isActive(`bulletList`)??!1,isOrderedList:e.editor.isActive(`orderedList`)??!1,isCodeBlock:e.editor.isActive(`codeBlock`)??!1,isBlockquote:e.editor.isActive(`blockquote`)??!1,canUndo:e.editor.can().chain().undo().run()??!1,canRedo:e.editor.can().chain().redo().run()??!1}}}),d=!!o,f=(0,yW.default)(t.toolbar,gV,{[t.toolbarWithNoDone]:!0,[t.toolbarTop]:l.position===`top`,[t.toolbarRight]:l.alignment===`right`,[t.focused]:l.alwaysVisible||u.isFocused&&!e._toolbarOpened&&!u.hideDefaultToolbar,[t.autoWidth]:d,[t.fullWidth]:!d,[t.hidden]:l.isHidden===!0}),p=l.minWidth===void 0?{}:{minWidth:l.minWidth},m=e=>{e.preventDefault()},h=(0,W.useMemo)(()=>[{icon:(0,G.jsx)(M$,{}),onClick:e=>e.chain().focus().insertTable({rows:2,cols:2,withHeaderRow:!1}).run(),hidden:e=>!n?.includes(`table`)||e.isTable,isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,G.jsx)(n1,{}),onClick:e=>e.chain().focus().addRowAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,G.jsx)(r1,{}),onClick:e=>e.chain().focus().deleteRow().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,G.jsx)(i1,{}),onClick:e=>e.chain().focus().addColumnAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,G.jsx)(a1,{}),onClick:e=>e.chain().focus().deleteColumn().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,G.jsx)(o1,{}),onClick:e=>e.chain().focus().deleteTable().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,G.jsx)(H$,{}),onClick:e=>{let t=e.getAttributes(`table`),n={...t,border:t.border===`0`?`1`:`0`};e.commands.updateAttributes(`table`,n)},hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.tableHasBorder,isDisabled:e=>!e.canTable},{icon:(0,G.jsx)(O$,{}),onClick:e=>e.chain().focus().toggleBold().run(),hidden:()=>!n?.includes(`bold`),isActive:e=>e.isBold,isDisabled:e=>!e.canBold},{icon:(0,G.jsx)(k$,{}),onClick:e=>e.chain().focus().toggleItalic().run(),hidden:()=>!n?.includes(`italic`),isActive:e=>e.isItalic,isDisabled:e=>!e.canItalic},{icon:(0,G.jsx)(A$,{}),onClick:e=>e.chain().focus().toggleStrike().run(),hidden:()=>!n?.includes(`strikethrough`),isActive:e=>e.isStrike,isDisabled:e=>!e.canStrike},{icon:(0,G.jsx)(j$,{}),onClick:e=>e.chain().focus().toggleCode().run(),hidden:()=>!n?.includes(`code`),isActive:e=>e.isCode,isDisabled:e=>!e.canCode},{icon:(0,G.jsx)(F$,{}),onClick:e=>e.chain().focus().toggleUnderline().run(),hidden:()=>!n?.includes(`underline`),isActive:e=>e.isUnderline},{icon:(0,G.jsx)(h2,{}),onClick:e=>e.chain().focus().toggleSubscript().run(),hidden:()=>!n?.includes(`subscript`),isActive:e=>e.isSubScript},{icon:(0,G.jsx)(m2,{}),onClick:e=>e.chain().focus().toggleSuperscript().run(),hidden:()=>!n?.includes(`superscript`),isActive:e=>e.isSuperScript},{icon:(0,G.jsx)(L$,{}),hidden:()=>!n?.includes(`image`),onClick:e=>e.chain().focus().setImageUploadNode().run()},{icon:(0,G.jsx)(B$,{}),hidden:()=>!n?.includes(`video`),onClick:e=>e.chain().focus().insertMedia({type:`video`}).run()},{icon:(0,G.jsx)(V$,{}),hidden:()=>!n?.includes(`audio`),onClick:e=>e.chain().focus().insertMedia({type:`audio`,tag:`audio`}).run()},{icon:(0,G.jsx)($$,{}),hidden:()=>!n?.includes(`css`),onClick:e=>e.commands.openCSSClassDialog()},{icon:(0,G.jsx)(z$,{}),hidden:()=>!n?.includes(`blockquote`),onClick:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isBlockquote},{icon:(0,G.jsx)(g2,{}),hidden:()=>!n?.includes(`h3`),onClick:e=>e.chain().focus().toggleHeadingParagraph().run(),isActive:e=>e.isHeadingParagraph},{icon:(0,G.jsx)(I$,{}),hidden:()=>!n?.includes(`math`),onClick:e=>e.chain().focus().insertMath(``).run()},{icon:(0,G.jsx)(f2,{letter:`ñ`}),hidden:()=>!n?.includes(`languageCharacters`),onClick:()=>c(G$)},{icon:(0,G.jsx)(f2,{letter:`€`}),hidden:()=>n?.filter(e=>e===`languageCharacters`).length!==2,onClick:()=>c(K$)},{icon:(0,G.jsx)(Z$,{editor:e}),hidden:()=>!n?.includes(`text-align`),onClick:()=>{}},{icon:(0,G.jsx)(N$,{}),hidden:()=>!n?.includes(`bulleted-list`),onClick:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isBulletList},{icon:(0,G.jsx)(P$,{}),hidden:()=>!n?.includes(`numbered-list`),onClick:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isOrderedList},{icon:(0,G.jsx)(Ky,{}),hidden:()=>!n?.includes(`undo`),onClick:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.canUndo},{icon:(0,G.jsx)(R$,{}),hidden:()=>!n?.includes(`redo`),onClick:e=>e.chain().focus().redo().run(),isDisabled:e=>!e.canRedo}],[n,e]),g=u.hideDefaultToolbar&&u.currentNode?.type?.name===`drag_in_the_blank`;return(0,G.jsxs)(`div`,{className:f,style:{...p},onMouseDown:m,children:[g&&(0,G.jsx)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:(0,G.jsx)(`div`,{className:t.buttonsContainer,children:(0,G.jsx)(`button`,{type:`button`,className:t.button,onClick:t=>{t.preventDefault(),e.chain().focus().deleteSelection().run(),a?.(e.getHTML())},"aria-label":`Delete response area`,children:(0,G.jsx)(hV,{})})})}),!u.hideDefaultToolbar&&(0,G.jsxs)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:[(0,G.jsx)(`div`,{className:t.buttonsContainer,children:h.filter(e=>!e.hidden?.(u)).map((n,r)=>{let i=n.isDisabled?.(u),a=n.isActive?.(u);return(0,G.jsx)(`button`,{disabled:i,onClick:t=>{t.preventDefault(),n.onClick(e)},className:(0,yW.default)(t.button,{[t.active]:a}),children:n.icon},r)})}),n?.includes(`responseArea`)&&(0,G.jsx)(`button`,{onClick:()=>{e.chain().focus().insertResponseArea(i.type).run()},className:t.button,children:(0,G.jsx)(W$,{})}),l.showDone&&(0,G.jsx)(bV,{onClick:()=>{a?.(e.getHTML()),e.commands.blur()}})]}),s&&(0,G.jsx)(p2,{editor:e,opts:{...s,renderPopOver:(e,t)=>console.log(`Show popover`,t),closePopOver:()=>console.log(`Close popover`)},onClose:()=>c(!1)})]})}var v2=e=>{No();let t={defaultToolbar:`defaultToolbar`,buttonsContainer:`buttonsContainer`,button:`button`,active:`active`,disabled:`disabled`,isActive:`isActive`,toolbar:`toolbar`,toolbarWithNoDone:`toolbarWithNoDone`,toolbarTop:`toolbarTop`,toolbarRight:`toolbarRight`,fullWidth:`fullWidth`,hidden:`hidden`,autoWidth:`autoWidth`,focused:`focused`,iconRoot:`iconRoot`,label:`label`,shared:`shared`};return(0,G.jsx)(y2,{children:(0,G.jsx)(_2,{...e,classes:t})})},y2=J(`div`)(({theme:e})=>({"& .defaultToolbar":{display:`flex`,width:`100%`,justifyContent:`space-between`},"& .buttonsContainer":{alignItems:`center`,display:`flex`,width:`100%`},"& .button":{color:`grey`,display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:`pointer`,"&:hover":{color:`black`},"&:focus":{outline:`2px solid ${e.palette.grey[700]}`}},"& .active":{color:`black`},"& .disabled":{opacity:.7,cursor:`not-allowed`,"& :hover":{color:`grey`}},"& .isActive":{background:`var(--purple)`,color:`var(--white)`},"& .toolbar":{position:`absolute`,zIndex:20,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:`280px`,margin:`5px 0 0 0`,padding:`2px`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,boxSizing:`border-box`,display:`flex`,opacity:0,pointerEvents:`none`},"& .toolbarWithNoDone":{minWidth:`265px`},"& .toolbarTop":{top:`-45px`},"& .toolbarRight":{right:0},"& .fullWidth":{width:`100%`},"& .hidden":{visibility:`hidden`},"& .autoWidth":{width:`auto`},"& .focused":{opacity:1,pointerEvents:`auto`},"& .iconRoot":{width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`},"& .label":{color:`var(--editable-html-toolbar-check, #00bb00)`},"& .shared":{display:`flex`}})),b2=J(`div`,{shouldForwardProp:e=>![`noBorder`,`error`].includes(e)})(({theme:e,noBorder:t,error:n})=>({position:`relative`,padding:`0px`,border:t?`none`:`1px solid #ccc`,borderRadius:`4px`,cursor:`text`,'& [data-slate-editor="true"]':{wordBreak:`break-word`,overflow:`visible`,maxHeight:`500px`,padding:`5px`},"&:first-child":{marginTop:0},"& ul, & ol":{padding:`0 1rem`,margin:`1.25rem 1rem 1.25rem 0.4rem`},"& ul li p, & ol li p":{marginTop:`0.25em`,marginBottom:`0.25em`},"& h1, & h2, & h3, & h4, & h5, & h6":{lineHeight:1.1,marginTop:`2.5rem`,textWrap:`pretty`},"& h1, & h2":{marginTop:`3.5rem`,marginBottom:`1.5rem`},"& h1":{fontSize:`1.4rem`},"& h2":{fontSize:`1.2rem`},"& h3":{fontSize:`1.1rem`},"& h4, & h5, & h6":{fontSize:`1rem`},"& code":{backgroundColor:`var(--purple-light)`,borderRadius:`0.4rem`,color:`var(--black)`,fontSize:`0.85rem`,padding:`0.25em 0.3em`},"& pre":{background:`var(--black)`,borderRadius:`0.5rem`,color:`var(--white)`,fontFamily:`'JetBrainsMono', monospace`,margin:`1.5rem 0`,padding:`0.75rem 1rem`,"& code":{background:`none`,color:`inherit`,fontSize:`0.8rem`,padding:0}},"& blockquote":{background:`#f9f9f9`,borderLeft:`5px solid #ccc`,margin:`1.5em 10px`,padding:`.5em 10px`},"& p":{margin:`0`},"& table":{tableLayout:`fixed`,width:`100%`,borderCollapse:`collapse`,color:iv(),backgroundColor:Tv()},'& table:not([border="1"]) tr':{borderTop:`1px solid #dfe2e5`},"& td, th":{padding:`.6em 1em`,textAlign:`center`},'& table:not([border="1"]) td, th':{border:`1px solid #dfe2e5`},...n&&{border:`2px solid ${e.palette.error.main} !important`}})),x2=J(`div`,{shouldForwardProp:e=>![`disableScrollbar`,`highlightShape`].includes(e)})(({theme:e,disableScrollbar:t,highlightShape:n})=>({position:`relative`,padding:`0px`,overflowY:`auto`,color:iv(),backgroundColor:n?e.palette.action.selected:Tv(),...t&&{"&::-webkit-scrollbar":{display:`none`},scrollbarWidth:`none`,"-ms-overflow-style":`none`}})),S2=J(`div`,{shouldForwardProp:e=>e!==`noPadding`})(({noPadding:e})=>({padding:e?0:`10px 8px`}));function C2(e){let[t,n]=(0,W.useState)(null),r=(0,W.useRef)(null),{editor:i,disabled:a,children:o,disableScrollbar:s,activePlugins:c,toolbarOpts:l,responseAreaProps:u,autoFocus:d,minWidth:f,width:p,maxWidth:m,minHeight:h,height:g,maxHeight:_,highlightShape:v,ref:y}=e;(0,W.useEffect)(()=>{i&&r.current&&(i._tiptapContainerEl=r.current)},[i,r.current]),(0,W.useEffect)(()=>{i&&d&&Promise.resolve().then(()=>{i.commands.focus(`end`)})},[i,d]),(0,W.useEffect)(()=>{if(e.adjustWidthForLimit){let t=document.createElement(`p`);t.style.visibility=`hidden`,t.style.position=`absolute`,t.textContent=`W`.repeat(e.charactersLimit),r.current.appendChild(t),n(`${t.offsetWidth+27}px`),t.remove()}},[e.adjustWidthForLimit,e.charactersLimit]);let b=(0,W.useMemo)(()=>({width:D$(t||p),minWidth:D$(f),maxWidth:D$(m),height:D$(g),minHeight:D$(h),maxHeight:D$(_)}),[t,f,p,m,h,g,_]);return(0,G.jsxs)(b2,{noBorder:l&&l.noBorder,error:l&&l.error,className:e.className,style:{width:b.width,minWidth:b.minWidth,maxWidth:b.maxWidth},ref:r,children:[(0,G.jsx)(x2,{disableScrollbar:s,highlightShape:v,children:(0,G.jsx)(S2,{noPadding:l&&l.noPadding,children:o})}),i&&(0,G.jsx)(v2,{editor:i,responseAreaProps:u,toolbarOpts:l,activePlugins:c,onChange:e.onChange,autoWidthToolbar:e.autoWidthToolbar})]})}var w2=ey(`@pie-lib:editable-html:plugins`),T2=[`bold`,`html`,`extraCSSRules`,`italic`,`underline`,`strikethrough`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`blockquote`,`h3`,`table`,`video`,`audio`,`responseArea`,`redo`,`undo`,`superscript`,`subscript`],E2={"text-align":`textAlign`,"bulleted-list":`ul_list`,"numbered-list":`ol_list`},D2=T2.filter(e=>![`responseArea`,`h3`,`blockquote`].includes(e)),O2=(e,t,n)=>{w2(`[buildPlugins] opts: `,n),e||=D2;let r=(t,n=!0)=>e.includes(t)&&n&&t,i=n.image&&n.image.delete,a=n.math,o=n.responseArea&&n.responseArea.type,s=!pp(n.extraCSSRules),c=n?.languageCharacters||[];return dee([r(`table`),r(`bold`),r(`italic`),r(`strikethrough`),r(`underline`),r(`superscript`),r(`subscript`),r(`image`,!!i),r(`video`),r(`audio`),r(`math`,!!a),...c.map(e=>r(`languageCharacters`,e)),r(`text-align`),r(`blockquote`),r(`h3`),r(`bulleted-list`),r(`numbered-list`),r(`undo`),r(`redo`),r(`responseArea`,!!o),r(`css`,!!s),r(`html`,!!n.html)])},k2={position:`bottom`,alignment:`left`,alwaysVisible:!1,showDone:!0,doneOn:`blur`},A2=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`table`,`video`,`audio`,`responseArea`,`superscript`,`subscript`,`css`,`h3`,`undo`,`redo`],j2={"--white":`#fff`,"--black":`#2e2b29`,"--black-contrast":`#110f0e`,"--gray-1":`rgba(61, 37, 20, .05)`,"--gray-2":`rgba(61, 37, 20, .08)`,"--gray-3":`rgba(61, 37, 20, .12)`,"--gray-4":`rgba(53, 38, 28, .3)`,"--gray-5":`rgba(28, 25, 23, .6)`,"--green":`#22c55e`,"--purple":`#6a00f5`,"--purple-contrast":`#5800cc`,"--purple-light":`rgba(88, 5, 255, .05)`,"--yellow-contrast":`#facc15`,"--yellow":`rgba(250, 204, 21, .4)`,"--yellow-light":`#fffae5`,"--red":`#ff5c33`,"--red-light":`#ffebe5`,"--shadow":`0px 12px 33px 0px rgba(0, 0, 0, .06),
368
- 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`},M2=e=>{let{showParagraphs:t,separateParagraphs:n}=e.pluginProps||{},[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!1),{toolbarOpts:s}=e,c=(0,W.useCallback)(e=>{i(t=>{let n=t.filter(t=>t.pos!==e);return n.length===0&&o(!1),n})},[i]),l={...k2,...s},u=(0,W.useMemo)(()=>{let{customPlugins:t,...n}=e.pluginProps||{};t||=[];let r=(e.activePlugins||A2)?.filter(e=>{let t=n[E2[e]||e]||{};return!t||!t.disabled});return O2(r,t,{math:{},textAlign:e.textAlign,html:{},extraCSSRules:e.extraCSSRules||{},image:{...e.imageSupport},toolbar:{},table:{},responseArea:{type:e.responseAreaProps?.type},languageCharacters:e.languageCharactersProps,keyPadCharacterRef:{},setKeypadInteraction:{},media:{}})},[e]),d=UM({extensions:[YR.configure({types:[`heading`,`paragraph`,`div`,`headingParagraph`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],alignments:[`left`,`right`,`center`,`justify`]}),VR,HR.configure({limit:e.charactersLimit||1e6}),NR.configure({trailingNode:{node:`paragraph`,notAfter:[`paragraph`,`div`]}}),T$,oV,E$,sV,cV,QR.configure({placeholder:e.placeholder,showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!0}),nV,UB,aV,iV,rJ.configure(e.responseAreaProps),iJ.configure(e.responseAreaProps),oJ.configure(e.responseAreaProps),sJ.configure(e.responseAreaProps),aJ.configure(e.responseAreaProps),xX.configure({toolbarOpts:l,math:e.pluginProps?.math||{}}),JR,qR,ZR,NZ.configure({toolbarOpts:l,imageHandling:{disableImageAlignmentButtons:e.disableImageAlignmentButtons,onDone:t=>e.onDone?.(t.getHTML()),onDelete:e.imageSupport&&e.imageSupport.delete&&(t=>{let{src:n}=t.attrs;e.imageSupport.delete(n,e=>{c(t.pos)})}),insertImageRequested:e.imageSupport&&((t,n,r)=>{let[o,s]=n,l=n=>{let r;a&&n&&(r=e.onChange),c(s),r?.(t.getHTML())};t._insertingImage=!0,i(e=>[...e,o]),(()=>{let n=r(l),i=ep(()=>{let e=()=>window.removeEventListener(`focus`,i);if(!t._insertingImage){e();return}c(s),t._insertingImage=!1,e()},500);window.addEventListener(`focus`,i),e.imageSupport.add(n)})()}),maxImageWidth:e.maxImageWidth,maxImageHeight:e.maxImageHeight},limit:3}),IQ.configure({uploadSoundSupport:e.uploadSoundSupport}),$Q.configure({extraCSSRules:e.extraCSSRules})],immediatelyRender:!1,editorProps:{handleKeyDown(t,n){return e.onKeyDown?e.onKeyDown(n):!1}},editable:!e.disabled,content:tz(e.markup),onUpdate:({editor:t,transaction:n})=>{(n.isDone||e.markup!==t.getHTML())&&e.onChange?.(t.getHTML())},onBlur:ep(({editor:t})=>{if(t._insertingImage||t._toolbarOpened||t.isActive(`inline_dropdown`)||t.isActive(`explicit_constructed_response`)||!t.schema)return;let n=t.getHTML();e.markup!==n&&e.onChange?.(n),l.doneOn===`blur`&&e.onDone?.(n)},200)},[e.charactersLimit]);(0,W.useEffect)(()=>{e.editorRef&&e.editorRef(d)},[e.editorRef,d]),(0,W.useEffect)(()=>{d?.setEditable(!e.disabled)},[e.disabled,d]),(0,W.useEffect)(()=>{if(!d)return;let t=tz(e.markup);t!==d.getHTML()&&d.commands.setContent(t,!1)},[e.markup,d]),(0,W.useEffect)(()=>{Object.entries(j2).forEach(([e,t])=>{document.documentElement.style.setProperty(e,t)})},[]);let f=RM({editor:d,selector:e=>({isFocused:e.editor?.isFocused})}),p=(0,W.useMemo)(()=>{let{minWidth:t,width:n,maxWidth:r,minHeight:i,height:a,maxHeight:o}=e;return{width:D$(n),minWidth:D$(t),maxWidth:D$(r),height:D$(a),minHeight:D$(i),maxHeight:D$(o)}},[e]);return(0,G.jsx)(C2,{...e,activePlugins:u,toolbarOpts:l,editorState:f,editor:d,children:d&&(0,G.jsx)(N2,{style:{minHeight:p.minHeight,height:p.height,maxHeight:p.maxHeight},showParagraph:t&&!t.disabled,separateParagraph:n&&!n.disabled,editor:d})})},N2=J(FM,{shouldForwardProp:e=>![`showParagraph`,`separateParagraph`].includes(e)})(({showParagraph:e,separateParagraph:t})=>({display:`flex`,outline:`none !important`,"& .ProseMirror":{flex:1,padding:`5px`,maxHeight:`500px`,outline:`none !important`,position:`initial`,"& > p, & > div":{margin:`0`},"& p.is-editor-empty, & div.is-editor-empty":{position:`relative`},"& p.is-editor-empty::before, & div.is-editor-empty::before":{content:`attr(data-placeholder)`,position:`absolute`,left:0,top:0,color:`#9CA3AF`,pointerEvents:`none`,whiteSpace:`pre-wrap`},...e&&{"& > p:has(+ p)::after, & > div:has(+ div)::after":{display:`block`,content:`"¶"`,fontSize:`1em`,color:`#146EB3`}},...t&&{"& > p:has(+ p)":{marginBottom:`1em`}}}})),P2=M2;M();var F2={min:j.number.isRequired,max:j.number.isRequired,step:j.number},I2=j.shape(F2),L2=j.shape(F2),R2=j.shape({width:j.number.isRequired,height:j.number.isRequired}),z2=j.shape({x:j.number.isRequired,y:j.number.isRequired}),B2=j.oneOfType([j.arrayOf(j.node),j.node]).isRequired,V2=j.shape({x:j.func.isRequired,y:j.func.isRequired}),H2=j.shape({x:j.func.isRequired,y:j.func.isRequired}),U2=j.shape({scale:V2.isRequired,snap:H2.isRequired,domain:I2.isRequired,range:L2.isRequired,size:R2.isRequired}),W2={graphProps:U2.isRequired,mark:j.object,onChange:j.func,onDelete:j.func,onClick:j.func};j.shape(W2);var G2=s(((e,t)=>{t.exports=function(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}}));function K2(e,t){this.x=e,this.y=t}K2.prototype={clone(){return new K2(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround(e,t){let n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),a=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:K2},K2.convert=function(e){if(e instanceof K2)return e;if(Array.isArray(e))return new K2(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new K2(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};var q2=u(G2(),1),J2=(e,t)=>({x:e,y:t}),Y2=(e,t,n)=>{let r=Ep(e,t,n);return r.splice(r.length,1,t),r};function X2(e,t,n,r){if(r>=t)return t;if(r<=e)return e;let i=Y2(e,t,n);return i=i.filter(e=>Math.abs(r-e)<=n),i.length&&i.reduce((e,t)=>Math.abs(t-r)<=Math.abs(e-r)?t:e)}var Z2=(e,t)=>({left:Math.min(e.x,t.x),top:Math.max(e.y,t.y),bottom:Math.min(e.y,t.y),right:Math.max(e.x,t.x)}),Q2=(e,t,n)=>({left:t.min-e.left,right:Math.abs(e.right-t.max),top:Math.abs(e.top-n.max),bottom:n.min-e.bottom}),$2=e=>new K2(e.x,e.y),e4=(e,t)=>$2(t).sub($2(e)),t4=(e,t)=>mp(e.domain,t.domain)&&mp(e.range,t.range),n4=e=>(new DOMParser()?.parseFromString(e,`text/html`))?.body?.textContent||``,r4=e=>e&&Object.keys(e).length===0&&e.constructor===Object,i4=e=>typeof e==`string`&&e.trim()===``;M();function a4(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function o4(e,t){return!e||a4(e)?e:a4(e.default)?e.default:t&&a4(e[t])?e[t]:t&&a4(e[t]?.default)?e[t].default:e}var s4=o4(jb,`Readable`)||o4(u4.Readable,`Readable`),c4=ix,l4=c4.default,u4=l4&&typeof l4==`object`?l4:c4,d4={axisLabel:{fontSize:12,textAlign:`center`,margin:4,padding:`4px 0`},chartLabel:{fontSize:16,textAlign:`center`,margin:4,padding:`4px 0`},disabledLabel:{pointerEvents:`none`,width:`100%`},editLabel:{position:`absolute`,backgroundColor:`white`,borderRadius:4,boxShadow:`0px 5px 8px rgba(0,0,0,0.15)`,zIndex:10},rotateLeftLabel:{transform:`rotate(-90deg)`,transformOrigin:`0 0`,position:`absolute`},rotateRightLabel:{transform:`rotate(90deg)`,transformOrigin:`0 0`,position:`absolute`},customBottom:{position:`absolute`},displayNone:{display:`none`},centerPlaceholder:{"& .ProseMirror p.is-editor-empty::before, & .ProseMirror div.is-editor-empty::before":{left:0,right:0,width:`100%`,textAlign:`center`}}},f4=J(`div`)({...d4.centerPlaceholder}),p4=J(`div`)({...d4.disabledLabel,"& p":{margin:0}}),m4=e=>{let{disabledLabel:t,graphHeight:n,graphWidth:r,isChartBottomLabel:i,isDefineChartBottomLabel:a,isChartLeftLabel:o,isDefineChartLeftLabel:s,placeholder:c,text:l,side:u,onChange:d,mathMlOptions:f={},charactersLimit:p,titleHeight:m,preventNewLines:h}=e,[g,_]=(0,W.useState)(!1),v=[`bold`,`italic`,`underline`,`strikethrough`,`math`],y=i||o||a||s,b=u===`left`&&s&&n-220,x={width:b||(u===`left`||u===`right`?n-8:r-8),top:b||o&&`${n-70}px`||u===`left`&&`${n-8}px`||i&&`${n-60+m}px`||u===`bottom`&&`${n-120+m}px`||0,left:u===`right`&&`${r-8}px`||(s||a)&&`40px`||i&&`-10px`||0},S={width:r-8,top:u===`right`?`${n-22}px`:0,left:0},C=()=>{!t&&(u===`left`||u===`right`)&&_(!0)},w=()=>{_(!1),requestAnimationFrame(()=>{document.activeElement?.blur?.()})},T=e=>!!(h&&e.key===`Enter`);return(0,G.jsx)(s4,{false:!0,children:(0,G.jsx)(f4,{onClick:C,style:{...g?S:x,...y?d4.chartLabel:d4.axisLabel,...u===`left`&&!g?d4.rotateLeftLabel:{},...u===`right`&&!g?d4.rotateRightLabel:{},...g?d4.editLabel:{},...i||a?d4.customBottom:{},...t&&!y&&i4(n4(l))&&d4.displayNone},children:t?(0,G.jsx)(p4,{dangerouslySetInnerHTML:{__html:l||``}}):(0,G.jsx)(P2,{markup:l||``,onChange:d,placeholder:!t&&c,toolbarOpts:{position:u===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},disableScrollbar:!0,activePlugins:v,onDone:w,onKeyDown:T,mathMlOptions:f,charactersLimit:p})})})};m4.propTypes={disabledLabel:j.bool,graphHeight:j.number,graphWidth:j.number,isChartBottomLabel:j.bool,isDefineChartBottomLabel:j.bool,isChartLeftLabel:j.bool,isDefineChartLeftLabel:j.bool,placeholder:j.string,text:j.string,side:j.string,onChange:j.func,mathMlOptions:j.object,charactersLimit:j.number,titleHeight:j.number},M();function h4(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function g4(e,t){return!e||h4(e)?e:h4(e.default)?e.default:t&&h4(e[t])?e[t]:t&&h4(e[t]?.default)?e[t].default:e}var _4=g4(jb,`Readable`)||g4(b4.Readable,`Readable`),v4=ix,y4=v4.default,b4=y4&&typeof y4==`object`?y4:v4,x4={"& .ProseMirror p.is-editor-empty::before, & .ProseMirror div.is-editor-empty::before":{left:0,right:0,width:`100%`,textAlign:`center`}},S4=J(`div`)(({theme:e})=>({border:`solid 1px ${_v()}`,color:X.TEXT,backgroundColor:e.palette.common.white,touchAction:`none`,position:`relative`,boxSizing:`unset`})),C4=J(`div`)({display:`flex`,position:`relative`}),w4=J(`svg`)({paddingLeft:`50px`,overflow:`visible`,boxSizing:`content-box`}),T4=J(`svg`)({overflow:`visible`,boxSizing:`content-box`}),E4=J(`g`)({cursor:`pointer`,userSelect:`none`}),D4=J(`div`)(({theme:e})=>({color:X.TEXT,fontSize:e.typography.fontSize+2,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:`center`,"&.disabled":{pointerEvents:`none`},"&.rightMargin":{marginRight:`74px`},"& p":{margin:0},...x4})),O4=J(`div`)(({theme:e})=>({color:X.TEXT,fontSize:e.typography.fontSize+4,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:`center`,"&.disabled":{pointerEvents:`none`},"&.rightMargin":{marginRight:`74px`},"& p":{margin:0},...x4})),k4=J(`div`)({display:`flex`,paddingTop:`6px`}),A4=J(`div`)({display:`flex`,flexDirection:`column`,alignItems:`center`,width:`100px`,pointerEvents:`none`,userSelect:`none`}),j4=J(`div`)({width:`70px`,display:`flex`,flexDirection:`column`,marginRight:`6px`}),M4=J(`div`)({textAlign:`right`,height:`20px`,pointerEvents:`none`,userSelect:`none`,"&:not(:last-child)":{marginBottom:`80px`}}),N4=class extends W.Component{constructor(e){super(e),this.state={titleHeight:0},this.resizeObserver=null}static propTypes={title:j.string,children:B2,defineChart:j.bool,disabledLabels:j.bool,disabledTitle:j.bool,graphProps:U2.isRequired,isChart:j.bool,labels:j.object,labelsPlaceholders:j.object,onChangeTitle:j.func,onMouseMove:j.func,showLabels:j.bool,showTitle:j.bool,showPixelGuides:j.bool,rootRef:j.func,onChangeLabels:j.func,titlePlaceholder:j.string,mathMlOptions:j.object,labelsCharactersLimit:j.number};mouseMove=(e,t)=>{let{graphProps:n,onMouseMove:r}=this.props;if(!r)return;let{scale:i,snap:a}=n,o=Bh(t,e.node()),s=i.x.invert(o[0]),c=i.y.invert(o[1]);r({x:a.x(s),y:a.y(c)})};componentDidMount(){let e=Rh(this.g);e.on(`mousemove`,this.mouseMove.bind(this,e)),this.measureTitleHeight(),this.setupVisibilityObserver()}componentWillUnmount(){Rh(this.g).on(`mousemove`,null),this.cleanupVisibilityObserver()}componentDidUpdate(e){e.title!==this.props.title&&this.measureTitleHeight()}onChangeLabel=(e,t)=>{let{labels:n,onChangeLabels:r,isChart:i}=this.props;if(r){if(i){r(t===`left`?`range`:`domain`,e);return}r({...n,[t]:e})}};measureTitleHeight=()=>{let e=this.titleRef;if(e){let t=e.clientHeight;this.setState({titleHeight:t,prevTitle:this.props.title}),!this.resizeObserver&&typeof ResizeObserver<`u`&&this.setupVisibilityObserver()}};handleKeyDown=()=>{setTimeout(()=>{this.measureTitleHeight()},0)};setupVisibilityObserver=()=>{typeof ResizeObserver<`u`&&this.titleRef&&(this.resizeObserver=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;if(e>0&&n>0){setTimeout(()=>{this.measureTitleHeight()},10);break}}}),this.resizeObserver.observe(this.titleRef))};cleanupVisibilityObserver=()=>{this.resizeObserver&&=(this.resizeObserver.disconnect(),null)};render(){let{disabledTitle:e,disabledLabels:t,labels:n,labelsPlaceholders:r,titlePlaceholder:i,graphProps:a,children:o,defineChart:s,onChangeTitle:c,isChart:l,showLabels:u,showPixelGuides:d,showTitle:f,title:p,rootRef:m,mathMlOptions:h={},labelsCharactersLimit:g}=this.props,{size:{width:_=500,height:v=500},domain:y,range:b}=a,x=i4(n4(n?.left))&&r4(r)?48:70,S=i4(n4(n?.right))&&r4(r)?48:70,C=_+x+S+(y.padding||0)*2,w=v+80+(b.padding||0)*2,T=[`bold`,`italic`,`underline`,`superscript`,`subscript`,`strikethrough`,`math`],E=s&&d?v-160:v,D=parseInt(_/100),O=parseInt(E/100),k=parseInt(E%100),{titleHeight:A}=this.state;return(0,G.jsxs)(S4,{children:[d&&(0,G.jsx)(k4,{style:{marginLeft:l?80:u?30:10},children:[...Array(D+1).keys()].map(e=>(0,G.jsx)(_4,{false:!0,children:(0,G.jsxs)(A4,{children:[(0,G.jsxs)(`div`,{children:[e*100,`px`]}),(0,G.jsx)(`div`,{children:`|`})]})},`top-guide-${e}`))}),f&&(e?(0,G.jsx)(`div`,{ref:e=>this.titleRef=e,style:{...l&&{width:C},...i4(n4(p))&&{display:`none`}},children:l?(0,G.jsx)(O4,{className:`disabled`,dangerouslySetInnerHTML:{__html:p||``}}):(0,G.jsx)(D4,{className:`disabled`,dangerouslySetInnerHTML:{__html:p||``}})}):(0,G.jsx)(`div`,{ref:e=>this.titleRef=e,children:l?(0,G.jsx)(O4,{className:d?`rightMargin`:``,children:(0,G.jsx)(P2,{...l&&{width:C},markup:p||``,onChange:c,placeholder:s&&i||!e&&`Click here to add a title for this graph`,toolbarOpts:{noPadding:!0,noBorder:!0},activePlugins:T,disableScrollbar:!0,onKeyDown:this.handleKeyDown})}):(0,G.jsx)(D4,{className:d?`rightMargin`:``,children:(0,G.jsx)(P2,{...l&&{width:C},markup:p||``,onChange:c,placeholder:s&&i||!e&&`Click here to add a title for this graph`,toolbarOpts:{noPadding:!0,noBorder:!0},activePlugins:T,disableScrollbar:!0,onKeyDown:this.handleKeyDown})})})),u&&!l&&(0,G.jsx)(m4,{side:`top`,text:n.top,disabledLabel:t,placeholder:r?.top,graphHeight:w,graphWidth:C,onChange:e=>this.onChangeLabel(e,`top`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),(0,G.jsxs)(C4,{children:[u&&(0,G.jsx)(m4,{side:`left`,text:n.left,disabledLabel:t,placeholder:r?.left,graphHeight:w,graphWidth:C,isChartLeftLabel:l&&!s,isDefineChartLeftLabel:l&&s,onChange:e=>this.onChangeLabel(e,`left`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),s?(0,G.jsx)(w4,{width:C,height:w,children:(0,G.jsx)(E4,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}):(0,G.jsx)(T4,{width:C,height:w,children:(0,G.jsx)(E4,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}),u&&!l&&(0,G.jsx)(m4,{side:`right`,text:n.right,disabledLabel:t,placeholder:r?.right,graphHeight:w,graphWidth:C,onChange:e=>this.onChangeLabel(e,`right`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),d&&(0,G.jsx)(j4,{style:{paddingTop:k,marginTop:31},children:[...Array(O+1).keys()].reverse().map(e=>(0,G.jsx)(_4,{false:!0,children:(0,G.jsxs)(M4,{children:[`━ `,e*100,`px`]})},`top-guide-${e}`))})]}),u&&(0,G.jsx)(m4,{side:`bottom`,text:n.bottom,disabledLabel:t,placeholder:r?.bottom,graphHeight:w,graphWidth:C,titleHeight:A,isChartBottomLabel:l&&!s,isDefineChartBottomLabel:l&&s,onChange:e=>this.onChangeLabel(e,`bottom`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g})]})}},P4=u(s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(_(),p()):typeof define==`function`&&define.amd?define([`react-dom`,`react`],r):n.ReactDraggable=r(n.ReactDOM,n.React)})(e,(function(e,t){"use strict";e=e&&e.hasOwnProperty(`default`)?e.default:e,t=t&&t.hasOwnProperty(`default`)?t.default:t;function n(e,t){return t={exports:{}},e(t,t.exports),t.exports}function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e};var a=i,o=function(e){};o=function(e){if(e===void 0)throw Error(`invariant requires an error message argument`)};function s(e,t,n,r,i,a,s,c){if(o(t),!e){var l;if(t===void 0)l=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var u=[n,r,i,a,s,c],d=0;l=Error(t.replace(/%s/g,function(){return u[d++]})),l.name=`Invariant Violation`}throw l.framesToPop=1,l}}var c=s,l=a,u=function(e){var t=[...arguments].slice(1),n=0,r=`Warning: `+e.replace(/%s/g,function(){return t[n++]});typeof console<`u`&&console.error(r);try{throw Error(r)}catch{}};l=function(e,t){if(t===void 0)throw Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.indexOf(`Failed Composite propType: `)!==0&&!e){var n=[...arguments].slice(2);u.apply(void 0,[t].concat(n))}};var d=l,f=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;function h(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function g(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}var _=g()?Object.assign:function(e,t){for(var n,r=h(e),i,a=1;a<arguments.length;a++){for(var o in n=Object(arguments[a]),n)p.call(n,o)&&(r[o]=n[o]);if(f){i=f(n);for(var s=0;s<i.length;s++)m.call(n,i[s])&&(r[i[s]]=n[i[s]])}}return r},v=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`,y=c,b=d,x=v,S={};function C(e,t,n,r,i){for(var a in e)if(e.hasOwnProperty(a)){var o;try{y(typeof e[a]==`function`,"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",r||`React class`,n,a,typeof e[a]),o=e[a](t,a,r,n,null,x)}catch(e){o=e}if(b(!o||o 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).",r||`React class`,n,a,typeof o),o instanceof Error&&!(o.message in S)){S[o.message]=!0;var s=i?i():``;b(!1,`Failed %s type: %s%s`,n,o.message,s??``)}}}var w=C,T=function(e,t){var n=typeof Symbol==`function`&&Symbol.iterator,r=`@@iterator`;function i(e){var t=e&&(n&&e[n]||e[r]);if(typeof t==`function`)return t}var o=`<<anonymous>>`,s={array:p(`array`),bool:p(`boolean`),func:p(`function`),number:p(`number`),object:p(`object`),string:p(`string`),symbol:p(`symbol`),any:m(),arrayOf:h,element:g(),instanceOf:y,node:C(),objectOf:x,oneOf:b,oneOfType:S,shape:T,exact:E};function l(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function u(e){this.message=e,this.stack=``}u.prototype=Error.prototype;function f(e){var n={},r=0;function i(i,a,s,l,f,p,m){if(l||=o,p||=s,m!==v){if(t)c(!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(typeof console<`u`){var h=l+`:`+s;!n[h]&&r<3&&(d(!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.",p,l),n[h]=!0,r++)}}return a[s]==null?i?a[s]===null?new u(`The `+f+" `"+p+"` is marked as required "+("in `"+l+"`, but its value is `null`.")):new u(`The `+f+" `"+p+"` is marked as required in "+("`"+l+"`, but its value is `undefined`.")):null:e(a,s,l,f,p)}var a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function p(e){function t(t,n,r,i,a,o){var s=t[n];if(k(s)!==e){var c=A(s);return new u(`Invalid `+i+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return f(t)}function m(){return f(a.thatReturnsNull)}function h(e){function t(t,n,r,i,a){if(typeof e!=`function`)return new u("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var o=t[n];if(!Array.isArray(o)){var s=k(o);return new u(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an array."))}for(var c=0;c<o.length;c++){var l=e(o,c,r,i,a+`[`+c+`]`,v);if(l instanceof Error)return l}return null}return f(t)}function g(){function t(t,n,r,i,a){var o=t[n];if(!e(o)){var s=k(o);return new u(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return f(t)}function y(e){function t(t,n,r,i,a){if(!(t[n]instanceof e)){var s=e.name||o,c=M(t[n]);return new u(`Invalid `+i+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("instance of `"+s+"`."))}return null}return f(t)}function b(e){if(!Array.isArray(e))return d(!1,`Invalid argument supplied to oneOf, expected an instance of array.`),a.thatReturnsNull;function t(t,n,r,i,a){for(var o=t[n],s=0;s<e.length;s++)if(l(o,e[s]))return null;var c=JSON.stringify(e);return new u(`Invalid `+i+" `"+a+"` of value `"+o+"` "+("supplied to `"+r+"`, expected one of "+c+`.`))}return f(t)}function x(e){function t(t,n,r,i,a){if(typeof e!=`function`)return new u("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var o=t[n],s=k(o);if(s!==`object`)return new u(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected an object."));for(var c in o)if(o.hasOwnProperty(c)){var l=e(o,c,r,i,a+`.`+c,v);if(l instanceof Error)return l}return null}return f(t)}function S(e){if(!Array.isArray(e))return d(!1,`Invalid argument supplied to oneOfType, expected an instance of array.`),a.thatReturnsNull;for(var t=0;t<e.length;t++){var n=e[t];if(typeof n!=`function`)return d(!1,`Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.`,j(n),t),a.thatReturnsNull}function r(t,n,r,i,a){for(var o=0;o<e.length;o++){var s=e[o];if(s(t,n,r,i,a,v)==null)return null}return new u(`Invalid `+i+" `"+a+"` supplied to "+("`"+r+"`."))}return f(r)}function C(){function e(e,t,n,r,i){return D(e[t])?null:new u(`Invalid `+r+" `"+i+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return f(e)}function T(e){function t(t,n,r,i,a){var o=t[n],s=k(o);if(s!==`object`)return new u(`Invalid `+i+" `"+a+"` of type `"+s+"` "+("supplied to `"+r+"`, expected `object`."));for(var c in e){var l=e[c];if(l){var d=l(o,c,r,i,a+`.`+c,v);if(d)return d}}return null}return f(t)}function E(e){function t(t,n,r,i,a){var o=t[n],s=k(o);if(s!==`object`)return new u(`Invalid `+i+" `"+a+"` of type `"+s+"` "+("supplied to `"+r+"`, expected `object`."));for(var c in _({},t[n],e)){var l=e[c];if(!l)return new u(`Invalid `+i+" `"+a+"` key `"+c+"` supplied to `"+r+`\`.
369
- Bad object: `+JSON.stringify(t[n],null,` `)+`
370
- Valid keys: `+JSON.stringify(Object.keys(e),null,` `));var d=l(o,c,r,i,a+`.`+c,v);if(d)return d}return null}return f(t)}function D(t){switch(typeof t){case`number`:case`string`:case`undefined`:return!0;case`boolean`:return!t;case`object`:if(Array.isArray(t))return t.every(D);if(t===null||e(t))return!0;var n=i(t);if(n){var r=n.call(t),a;if(n!==t.entries){for(;!(a=r.next()).done;)if(!D(a.value))return!1}else for(;!(a=r.next()).done;){var o=a.value;if(o&&!D(o[1]))return!1}}else return!1;return!0;default:return!1}}function O(e,t){return e===`symbol`||t[`@@toStringTag`]===`Symbol`||typeof Symbol==`function`&&t instanceof Symbol}function k(e){var t=typeof e;return Array.isArray(e)?`array`:e instanceof RegExp?`object`:O(t,e)?`symbol`:t}function A(e){if(e==null)return``+e;var t=k(e);if(t===`object`){if(e instanceof Date)return`date`;if(e instanceof RegExp)return`regexp`}return t}function j(e){var t=A(e);switch(t){case`array`:case`object`:return`an `+t;case`boolean`:case`date`:case`regexp`:return`a `+t;default:return t}}function M(e){return!e.constructor||!e.constructor.name?o:e.constructor.name}return s.checkPropTypes=w,s.PropTypes=s,s},E=n(function(e){var t=typeof Symbol==`function`&&Symbol.for&&Symbol.for(`react.element`)||60103;e.exports=T(function(e){return typeof e==`object`&&!!e&&e.$$typeof===t},!0)}),D=n(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var a=typeof i;if(a===`string`||a===`number`)e.push(i);else if(Array.isArray(i))e.push(n.apply(null,i));else if(a===`object`)for(var o in i)t.call(i,o)&&i[o]&&e.push(o)}}return e.join(` `)}e.exports?e.exports=n:window.classNames=n})()});function O(e,t){for(var n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function k(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function A(e){return typeof e==`number`&&!isNaN(e)}function j(e){return parseInt(e,10)}function M(e,t,n){if(e[t])return Error(`Invalid prop `+t+` passed to `+n+` - do not set this, set it on the child.`)}var N=[`Moz`,`Webkit`,`O`,`ms`];function P(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`transform`;if(typeof window>`u`||window.document===void 0)return``;var t=window.document.documentElement.style;if(e in t)return``;for(var n=0;n<N.length;n++)if(F(e,N[n])in t)return N[n];return``}function F(e,t){return t?``+t+ee(e):e}function ee(e){for(var t=``,n=!0,r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]===`-`?n=!0:t+=e[r];return t}var te=P(),I=function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)},ne=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),re=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L=function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},R=function(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e},ae=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),z=``;function B(e,t){return z||=O([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return k(e[t])}),k(e[z])?e[z](t):!1}function oe(e,t,n){var r=e;do{if(B(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function se(e,t,n){e&&(e.attachEvent?e.attachEvent(`on`+t,n):e.addEventListener?e.addEventListener(t,n,!0):e[`on`+t]=n)}function ce(e,t,n){e&&(e.detachEvent?e.detachEvent(`on`+t,n):e.removeEventListener?e.removeEventListener(t,n,!0):e[`on`+t]=null)}function V(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=j(n.borderTopWidth),t+=j(n.borderBottomWidth),t}function le(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=j(n.borderLeftWidth),t+=j(n.borderRightWidth),t}function ue(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=j(n.paddingTop),t-=j(n.paddingBottom),t}function de(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=j(n.paddingLeft),t-=j(n.paddingRight),t}function H(e,t){var n=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:e.clientX+t.scrollLeft-n.left,y:e.clientY+t.scrollTop-n.top}}function fe(e,t){var n=me(e,t,`px`);return re({},F(`transform`,te),n)}function pe(e,t){return me(e,t,``)}function me(e,t,n){var r=e.x,i=e.y,a=`translate(`+r+n+`,`+i+n+`)`;if(t){var o=``+(typeof t.x==`string`?t.x:t.x+n),s=``+(typeof t.y==`string`?t.y:t.y+n);a=`translate(`+o+`, `+s+`)`+a}return a}function he(e,t){return e.targetTouches&&O(e.targetTouches,function(e){return t===e.identifier})||e.changedTouches&&O(e.changedTouches,function(e){return t===e.identifier})}function ge(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function U(e){if(e){var t=e.getElementById(`react-draggable-style-el`);t||(t=e.createElement(`style`),t.type=`text/css`,t.id=`react-draggable-style-el`,t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
371
- `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
372
- `,e.getElementsByTagName(`head`)[0].appendChild(t)),e.body&&ye(e.body,`react-draggable-transparent-selection`)}}function _e(e){try{e&&e.body&&be(e.body,`react-draggable-transparent-selection`),e.selection?e.selection.empty():window.getSelection().removeAllRanges()}catch{}}function ve(){return ie({touchAction:`none`},arguments.length>0&&arguments[0]!==void 0?arguments[0]:{})}function ye(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)`+t+`(?!\\S)`))||(e.className+=` `+t)}function be(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)`+t+`(?!\\S)`,`g`),``)}function xe(e,t,n){if(!e.props.bounds)return[t,n];var r=e.props.bounds;r=typeof r==`string`?r:Oe(r);var i=ke(e);if(typeof r==`string`){var a=i.ownerDocument,o=a.defaultView,s=void 0;if(s=r===`parent`?i.parentNode:a.querySelector(r),!(s instanceof o.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);var c=o.getComputedStyle(i),l=o.getComputedStyle(s);r={left:-i.offsetLeft+j(l.paddingLeft)+j(c.marginLeft),top:-i.offsetTop+j(l.paddingTop)+j(c.marginTop),right:de(s)-le(i)-i.offsetLeft+j(l.paddingRight)-j(c.marginRight),bottom:ue(s)-V(i)-i.offsetTop+j(l.paddingBottom)-j(c.marginBottom)}}return A(r.right)&&(t=Math.min(t,r.right)),A(r.bottom)&&(n=Math.min(n,r.bottom)),A(r.left)&&(t=Math.max(t,r.left)),A(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Se(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ce(e){return e.props.axis===`both`||e.props.axis===`x`}function we(e){return e.props.axis===`both`||e.props.axis===`y`}function Te(e,t,n){var r=typeof t==`number`?he(e,t):null;if(typeof t==`number`&&!r)return null;var i=ke(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return H(r||e,a)}function Ee(e,t,n){var r=e.state,i=!A(r.lastX),a=ke(e);return i?{node:a,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:a,deltaX:t-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:t,y:n}}function De(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Oe(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ke(t){var n=e.findDOMNode(t);if(!n)throw Error(`<DraggableCore>: Unmounted during event!`);return n}var Ae={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},je=Ae.mouse,Me=function(n){L(r,n);function r(){var t,n,i,a;I(this,r);var o=[...arguments];return a=(n=(i=R(this,(t=r.__proto__||Object.getPrototypeOf(r)).call.apply(t,[this].concat(o))),i),i.state={dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null},i.handleDragStart=function(t){if(i.props.onMouseDown(t),!i.props.allowAnyClick&&typeof t.button==`number`&&t.button!==0)return!1;var n=e.findDOMNode(i);if(!n||!n.ownerDocument||!n.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);var r=n.ownerDocument;if(!(i.props.disabled||!(t.target instanceof r.defaultView.Node)||i.props.handle&&!oe(t.target,i.props.handle,n)||i.props.cancel&&oe(t.target,i.props.cancel,n))){var a=ge(t);i.setState({touchIdentifier:a});var o=Te(t,a,i);if(o!=null){var s=o.x,c=o.y,l=Ee(i,s,c);i.props.onStart,i.props.onStart(t,l)!==!1&&(i.props.enableUserSelectHack&&U(r),i.setState({dragging:!0,lastX:s,lastY:c}),se(r,je.move,i.handleDrag),se(r,je.stop,i.handleDragStop))}}},i.handleDrag=function(e){e.type===`touchmove`&&e.preventDefault();var t=Te(e,i.state.touchIdentifier,i);if(t!=null){var n=t.x,r=t.y;if(Array.isArray(i.props.grid)){var a=n-i.state.lastX,o=r-i.state.lastY,s=ae(Se(i.props.grid,a,o),2);if(a=s[0],o=s[1],!a&&!o)return;n=i.state.lastX+a,r=i.state.lastY+o}var c=Ee(i,n,r);if(i.props.onDrag(e,c)===!1){try{i.handleDragStop(new MouseEvent(`mouseup`))}catch{var l=document.createEvent(`MouseEvents`);l.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.handleDragStop(l)}return}i.setState({lastX:n,lastY:r})}},i.handleDragStop=function(t){if(i.state.dragging){var n=Te(t,i.state.touchIdentifier,i);if(n!=null){var r=n.x,a=n.y,o=Ee(i,r,a),s=e.findDOMNode(i);s&&i.props.enableUserSelectHack&&_e(s.ownerDocument),i.setState({dragging:!1,lastX:NaN,lastY:NaN}),i.props.onStop(t,o),s&&(ce(s.ownerDocument,je.move,i.handleDrag),ce(s.ownerDocument,je.stop,i.handleDragStop))}}},i.onMouseDown=function(e){return je=Ae.mouse,i.handleDragStart(e)},i.onMouseUp=function(e){return je=Ae.mouse,i.handleDragStop(e)},i.onTouchStart=function(e){return je=Ae.touch,i.handleDragStart(e)},i.onTouchEnd=function(e){return je=Ae.touch,i.handleDragStop(e)},n),R(i,a)}return ne(r,[{key:`componentWillUnmount`,value:function(){var t=e.findDOMNode(this);if(t){var n=t.ownerDocument;ce(n,Ae.mouse.move,this.handleDrag),ce(n,Ae.touch.move,this.handleDrag),ce(n,Ae.mouse.stop,this.handleDragStop),ce(n,Ae.touch.stop,this.handleDragStop),this.props.enableUserSelectHack&&_e(n)}}},{key:`render`,value:function(){return t.cloneElement(t.Children.only(this.props.children),{style:ve(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),r}(t.Component);Me.displayName=`DraggableCore`,Me.propTypes={allowAnyClick:E.bool,disabled:E.bool,enableUserSelectHack:E.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:E.arrayOf(E.number),scale:E.number,handle:E.string,cancel:E.string,onStart:E.func,onDrag:E.func,onStop:E.func,onMouseDown:E.func,className:M,style:M,transform:M},Me.defaultProps={allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){}};var Ne=function(n){L(r,n);function r(e){I(this,r);var t=R(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.onDragStart=function(e,n){if(t.props.onStart(e,De(t,n))===!1)return!1;t.setState({dragging:!0,dragged:!0})},t.onDrag=function(e,n){if(!t.state.dragging)return!1;var r=De(t,n),i={x:r.x,y:r.y};if(t.props.bounds){var a=i.x,o=i.y;i.x+=t.state.slackX,i.y+=t.state.slackY;var s=ae(xe(t,i.x,i.y),2),c=s[0],l=s[1];i.x=c,i.y=l,i.slackX=t.state.slackX+(a-i.x),i.slackY=t.state.slackY+(o-i.y),r.x=i.x,r.y=i.y,r.deltaX=i.x-t.state.x,r.deltaY=i.y-t.state.y}if(t.props.onDrag(e,r)===!1)return!1;t.setState(i)},t.onDragStop=function(e,n){if(!t.state.dragging||t.props.onStop(e,De(t,n))===!1)return!1;var r={dragging:!1,slackX:0,slackY:0};if(t.props.position){var i=t.props.position,a=i.x,o=i.y;r.x=a,r.y=o}t.setState(r)},t.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),t}return ne(r,[{key:`componentDidMount`,value:function(){window.SVGElement!==void 0&&e.findDOMNode(this)instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:`componentWillReceiveProps`,value:function(e){e.position&&(!this.props.position||e.position.x!==this.props.position.x||e.position.y!==this.props.position.y)&&this.setState({x:e.position.x,y:e.position.y})}},{key:`componentWillUnmount`,value:function(){this.setState({dragging:!1})}},{key:`render`,value:function(){var e,n={},r=null,i=!this.props.position||this.state.dragging,a=this.props.position||this.props.defaultPosition,o={x:Ce(this)&&i?this.state.x:a.x,y:we(this)&&i?this.state.y:a.y};this.state.isElementSVG?r=pe(o,this.props.positionOffset):n=fe(o,this.props.positionOffset);var s=this.props,c=s.defaultClassName,l=s.defaultClassNameDragging,u=s.defaultClassNameDragged,d=t.Children.only(this.props.children),f=D(d.props.className||``,c,(e={},re(e,l,this.state.dragging),re(e,u,this.state.dragged),e));return t.createElement(Me,ie({},this.props,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(d,{className:f,style:ie({},d.props.style,n),transform:r}))}}]),r}(t.Component);return Ne.displayName=`Draggable`,Ne.propTypes=ie({},Me.propTypes,{axis:E.oneOf([`both`,`x`,`y`,`none`]),bounds:E.oneOfType([E.shape({left:E.number,right:E.number,top:E.number,bottom:E.number}),E.string,E.oneOf([!1])]),defaultClassName:E.string,defaultClassNameDragging:E.string,defaultClassNameDragged:E.string,defaultPosition:E.shape({x:E.number,y:E.number}),positionOffset:E.shape({x:E.oneOfType([E.number,E.string]),y:E.oneOfType([E.number,E.string])}),position:E.shape({x:E.number,y:E.number}),className:M,style:M,transform:M}),Ne.defaultProps=ie({},Me.defaultProps,{axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},position:null,scale:1}),Ne.default=Ne,Ne.DraggableCore=Me,Ne}))}))(),1);M();var F4=ey(`pie-lib:plot:grid-draggable`),I4=(e,t,n)=>r=>{let i=r+e(0);return t(n+e.invert(i)).toFixed(4)*1e3/1e3},L4=e=>t=>((0,q2.default)(!!e&&Ps(e.fromDelta)&&Ps(e.bounds)&&Ps(e.anchorPoint),`You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }`),class extends W.Component{static propTypes={disabled:j.bool,onDragStart:j.func,onDrag:j.func,onDragStop:j.func,onClick:j.func,onMove:j.func,graphProps:U2.isRequired};constructor(e){super(e),this.state={startX:null,startY:null}}grid=()=>{let{graphProps:e}=this.props,{scale:t,domain:n,range:r}=e;return{x:t.x(n.step)-t.x(0),y:t.y(r.step)-t.y(0)}};onStart=e=>{let{onDragStart:t}=this.props;document.activeElement&&document.activeElement.blur(),this._didDrag=!1,this.setState({startX:e.clientX,startY:e.clientY});let n=e.target,r=e=>{n.removeEventListener(`click`,r,!0),this._didDrag&&(e.stopPropagation(),e.preventDefault())};n.addEventListener(`click`,r,!0),t&&t()};position=()=>{let{x:t,y:n}=e.anchorPoint(this.props),{graphProps:r}=this.props,{scale:i,snap:a}=r;return{anchorPoint:{x:t,y:n},x:I4(i.x,a.x,t),y:I4(i.y,a.y,n)}};tiny=(e,t)=>{let n=e.toUpperCase(),r=Math.abs(t[`client${n}`]-this.state[`start${n}`]),i=r<Math.abs(this.grid()[e])/10;return F4(`[tiny] key: `,e,`delta: `,r,`out: `,i),i};getScaledBounds=()=>{let t=e.bounds(this.props,this.props.graphProps);F4(`bounds: `,t);let n=this.grid(),r={left:t.left*n.x,right:t.right*n.x,top:t.top*n.y,bottom:t.bottom*n.y},i=Math.abs(n.y);return r={...r,top:Math.min(0,r.top)-i,bottom:Math.abs(r.bottom)+i},F4(`[getScaledBounds]: `,r),r};getClientPoint=(e,t)=>{if(!e||!t)return null;let n=e.ownerSVGElement||e;if(n&&n.createSVGPoint){let r=n.createSVGPoint();if(t.touches&&t.touches.length>0){let e=t.touches[0];r.x=e.clientX,r.y=e.clientY}else r.x=t.clientX,r.y=t.clientY;return e.getScreenCTM?(r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]):null}let r=e.getBoundingClientRect();return r?[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]:null};skipDragOutsideOfBounds=(e,t,n)=>{let r=n.getRootNode(),i=this.getClientPoint(r,t);if(i===null)return!0;let[a,o]=i,{scale:s,domain:c,range:l}=n,u=s.x.invert(a),d=s.y.invert(o),f=e.deltaX>0&&u<c.min||e.deltaX<0&&u>c.max,p=e.deltaY>0&&d>l.max||e.deltaY<0&&d<l.min;return f||p};onDrag=(e,t)=>{let{onDrag:n,graphProps:r,disabled:i}=this.props;if((Math.abs(t.deltaX)>1||Math.abs(t.deltaY)>1)&&(this._didDrag=!0),!n||i)return;let a=this.getScaledBounds();if(t.deltaX<0&&t.deltaX<a.left||t.deltaX>0&&t.deltaX>a.right||t.deltaY<0&&t.deltaY<a.top||t.deltaY>0&&t.deltaY>a.bottom||this.skipDragOutsideOfBounds(t,e,r))return;let o=this.applyDelta({x:t.deltaX,y:t.deltaY});(o!==void 0||o!==null)&&n(o)};getDelta=e=>{let t=this.position(),n={x:t.x(e.x),y:t.y(e.y)};return e4(t.anchorPoint,n)};applyDelta=t=>{let n=this.getDelta(t);return F4(`[applyDelta] delta:`,n),e.fromDelta(this.props,n)};onStop=(e,t)=>{F4(`[onStop] dd:`,t);let{onDragStop:n,onClick:r,disabled:i}=this.props;if(n&&!i&&n(),F4(`[onStop] lastX/Y: `,t.lastX,t.lastY),!this._didDrag){if(!i&&typeof e?.stopPropagation==`function`&&e.stopPropagation(),r){F4(`call onClick`),this.setState({startX:null,startY:null});let{graphProps:t}=this.props,{scale:n,snap:i}=t;try{let[t,a]=Bh(e,e.target),o=n.x.invert(t),s=n.y.invert(a);o=i.x(o),s=i.y(s),r({x:o,y:s})}catch{r({})}}return!1}return this.setState({startX:null,startY:null}),!1};render(){let{disabled:n,onClick:r,...i}=this.props,a=this.grid(),o=e=>e.nativeEvent.preventDefault(),s=this.state?!!this.state.startX:!1;return(0,G.jsx)(P4.DraggableCore,{onMouseDown:o,onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||`both`,grid:[a.x,a.y],children:(0,G.jsx)(t,{...i,disabled:n,isDragging:s,onClick:s?void 0:r})})}}),R4=ey(`pie-lib:plot:trig`),z4=e=>180/Math.PI*e,B4=e=>Math.PI/180*e,V4=(e,t)=>{let n=t.y-e.y,r=t.x-e.x;R4(e,t,`vd: `,n,`hd: `,r);let i=Math.atan2(n,r);return i<0?i+Math.PI*2:i},H4=Math.PI/2;Math.PI+H4;var U4=(e,t)=>Math.abs(e/Math.sin(t)),W4=(e,t)=>(n,r)=>[q4(J2(n.x<r.x?e.max:e.min,n.y<r.y?t.max:t.min),n,r),q4(J2(r.x<n.x?e.max:e.min,r.y<n.y?t.max:t.min),r,n)],G4=(e,t)=>(R4(`[getOpposingSide] hyp: `,e,`angle:`,t),Math.abs(e*Math.sin(t))),K4=(e,t)=>{if(Number.isFinite(e)&&Number.isFinite(t))return e===0&&t>0?`y`:t===0&&e>0||e<t?`x`:`y`;if(isNaN(e)&&!isNaN(t))return`y`;if(!isNaN(e)&&isNaN(t))return`x`;if(e===1/0)return`y`;if(t===1/0)return`x`;console.warn(`hypotenuse - which is shorter? x:`,e,`y:`,t)},q4=(e,t,n)=>{let r=R4.enabled?R4.bind(R4,`diffEdge: [${t.x},${t.y} -> ${n.x},${n.y}]`):()=>{},i=V4(t,n);r(`x angle`,z4(i));let a=Math.abs(i-B4(90));r(`y angle`,z4(a));let o=Math.abs(t.x-e.x),s=U4(o,a),c=Math.abs(t.y-e.y),l=U4(c,i);r(`x: side`,o,`h:`,s),r(`y: side`,c,`h:`,l);let u=K4(s,l);if(u!==`x`&&u!==`y`)throw Error(`Cant decide which hypotenuse to use`);let d=u===`x`?new K2(o,G4(s,i)):new K2(G4(l,a),c);r(`point:`,d);let f=new K2(n.x<t.x?-1:1,n.y<t.y?-1:1);r(`multiplier:`,f);let p=d.multByPoint(f);r(`out:`,p);let m=p.add(new K2(t.x,t.y));return r(`normalized:`,m),m};function J4(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Y4(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function X4(e){let t,n,r;e.length===2?(t=e===J4||e===Y4?e:Z4,n=e,r=e):(t=J4,n=(t,n)=>J4(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Z4(){return 0}function Q4(e){return e===null?NaN:+e}var $4=X4(J4),e3=$4.right;$4.left,X4(Q4).center;var t3=Math.sqrt(50),n3=Math.sqrt(10),r3=Math.sqrt(2);function i3(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=t3?10:a>=n3?5:a>=r3?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?i3(e,t,n*2):[s,c,l]}function a3(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?i3(t,e,n):i3(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function o3(e,t,n){return t=+t,e=+e,n=+n,i3(e,t,n)[2]}function s3(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?o3(t,e,n):o3(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function c3(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function l3(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function u3(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function d3(){}var f3=.7,p3=1/f3,m3=`\\s*([+-]?\\d+)\\s*`,h3=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,g3=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,_3=/^#([0-9a-f]{3,8})$/,v3=RegExp(`^rgb\\(${m3},${m3},${m3}\\)$`),y3=RegExp(`^rgb\\(${g3},${g3},${g3}\\)$`),b3=RegExp(`^rgba\\(${m3},${m3},${m3},${h3}\\)$`),x3=RegExp(`^rgba\\(${g3},${g3},${g3},${h3}\\)$`),S3=RegExp(`^hsl\\(${h3},${g3},${g3}\\)$`),C3=RegExp(`^hsla\\(${h3},${g3},${g3},${h3}\\)$`),w3={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};l3(d3,k3,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:T3,formatHex:T3,formatHex8:E3,formatHsl:D3,formatRgb:O3,toString:O3});function T3(){return this.rgb().formatHex()}function E3(){return this.rgb().formatHex8()}function D3(){return H3(this).formatHsl()}function O3(){return this.rgb().formatRgb()}function k3(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=_3.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?A3(t):n===3?new P3(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?j3(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?j3(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=v3.exec(e))?new P3(t[1],t[2],t[3],1):(t=y3.exec(e))?new P3(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=b3.exec(e))?j3(t[1],t[2],t[3],t[4]):(t=x3.exec(e))?j3(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=S3.exec(e))?V3(t[1],t[2]/100,t[3]/100,1):(t=C3.exec(e))?V3(t[1],t[2]/100,t[3]/100,t[4]):w3.hasOwnProperty(e)?A3(w3[e]):e===`transparent`?new P3(NaN,NaN,NaN,0):null}function A3(e){return new P3(e>>16&255,e>>8&255,e&255,1)}function j3(e,t,n,r){return r<=0&&(e=t=n=NaN),new P3(e,t,n,r)}function M3(e){return e instanceof d3||(e=k3(e)),e?(e=e.rgb(),new P3(e.r,e.g,e.b,e.opacity)):new P3}function N3(e,t,n,r){return arguments.length===1?M3(e):new P3(e,t,n,r??1)}function P3(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}l3(P3,N3,u3(d3,{brighter(e){return e=e==null?p3:p3**+e,new P3(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?f3:f3**+e,new P3(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new P3(z3(this.r),z3(this.g),z3(this.b),R3(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:F3,formatHex:F3,formatHex8:I3,formatRgb:L3,toString:L3}));function F3(){return`#${B3(this.r)}${B3(this.g)}${B3(this.b)}`}function I3(){return`#${B3(this.r)}${B3(this.g)}${B3(this.b)}${B3((isNaN(this.opacity)?1:this.opacity)*255)}`}function L3(){let e=R3(this.opacity);return`${e===1?`rgb(`:`rgba(`}${z3(this.r)}, ${z3(this.g)}, ${z3(this.b)}${e===1?`)`:`, ${e})`}`}function R3(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function z3(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function B3(e){return e=z3(e),(e<16?`0`:``)+e.toString(16)}function V3(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new W3(e,t,n,r)}function H3(e){if(e instanceof W3)return new W3(e.h,e.s,e.l,e.opacity);if(e instanceof d3||(e=k3(e)),!e)return new W3;if(e instanceof W3)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new W3(o,s,c,e.opacity)}function U3(e,t,n,r){return arguments.length===1?H3(e):new W3(e,t,n,r??1)}function W3(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}l3(W3,U3,u3(d3,{brighter(e){return e=e==null?p3:p3**+e,new W3(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?f3:f3**+e,new W3(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new P3(q3(e>=240?e-240:e+120,i,r),q3(e,i,r),q3(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new W3(G3(this.h),K3(this.s),K3(this.l),R3(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=R3(this.opacity);return`${e===1?`hsl(`:`hsla(`}${G3(this.h)}, ${K3(this.s)*100}%, ${K3(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function G3(e){return e=(e||0)%360,e<0?e+360:e}function K3(e){return Math.max(0,Math.min(1,e||0))}function q3(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var J3=e=>()=>e;function Y3(e,t){return function(n){return e+n*t}}function X3(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Z3(e){return(e=+e)==1?Q3:function(t,n){return n-t?X3(t,n,e):J3(isNaN(t)?n:t)}}function Q3(e,t){var n=t-e;return n?Y3(e,n):J3(isNaN(e)?t:e)}var $3=(function e(t){var n=Z3(t);function r(e,t){var r=n((e=N3(e)).r,(t=N3(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Q3(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function e6(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function t6(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function n6(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=d6(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function r6(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function i6(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function a6(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=d6(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var o6=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,s6=new RegExp(o6.source,`g`);function c6(e){return function(){return e}}function l6(e){return function(t){return e(t)+``}}function u6(e,t){var n=o6.lastIndex=s6.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=o6.exec(e))&&(i=s6.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:i6(r,i)})),n=s6.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?l6(c[0].x):c6(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function d6(e,t){var n=typeof t,r;return t==null||n===`boolean`?J3(t):(n===`number`?i6:n===`string`?(r=k3(t))?(t=r,$3):u6:t instanceof k3?$3:t instanceof Date?r6:t6(t)?e6:Array.isArray(t)?n6:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?a6:i6)(e,t)}function f6(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function p6(e){return function(){return e}}function m6(e){return+e}var h6=[0,1];function g6(e){return e}function _6(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:p6(isNaN(t)?NaN:.5)}function v6(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Iie(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=_6(i,r),a=n(o,a)):(r=_6(r,i),a=n(a,o)),function(e){return a(r(e))}}function Lie(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=_6(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=e3(e,t,1,r)-1;return a[n](i[n](t))}}function Rie(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function zie(){var e=h6,t=h6,n=d6,r,i,a,o=g6,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==g6&&(o=v6(e[0],e[n-1])),s=n>2?Lie:Iie,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),i6))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,m6),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=f6,u()},d.clamp=function(e){return arguments.length?(o=e?!0:g6,u()):o!==g6},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Bie(){return zie()(g6,g6)}function Vie(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function y6(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function b6(e){return e=y6(Math.abs(e)),e?e[1]:NaN}function Hie(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Uie(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Wie=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function x6(e){if(!(t=Wie.exec(e)))throw Error(`invalid format: `+e);var t;return new S6({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}x6.prototype=S6.prototype;function S6(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}S6.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Gie(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var C6;function Kie(e,t){var n=y6(e,t);if(!n)return C6=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(C6=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+y6(e,Math.max(0,t+a-1))[0]}function w6(e,t){var n=y6(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var T6={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Vie,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>w6(e*100,t),r:w6,s:Kie,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function E6(e){return e}var D6=Array.prototype.map,O6=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function qie(e){var t=e.grouping===void 0||e.thousands===void 0?E6:Hie(D6.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?E6:Uie(D6.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=x6(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):T6[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=T6[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Gie(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&C6!==void 0?O6[8+C6/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(b6(t)/3)))*3,r=10**-n,i=l((e=x6(e),e.type=`f`,e),{suffix:O6[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var k6,A6,j6;Jie({thousands:`,`,grouping:[3],currency:[`$`,``]});function Jie(e){return k6=qie(e),A6=k6.format,j6=k6.formatPrefix,k6}function Yie(e){return Math.max(0,-b6(Math.abs(e)))}function Xie(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(b6(t)/3)))*3-b6(Math.abs(e)))}function Zie(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,b6(t)-b6(e))+1}function Qie(e,t,n,r){var i=s3(e,t,n),a;switch(r=x6(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Xie(i,o))&&(r.precision=a),j6(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Zie(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Yie(i))&&(r.precision=a-(r.type===`%`)*2);break}return A6(r)}function $ie(e){var t=e.domain;return e.ticks=function(e){var n=t();return a3(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Qie(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=o3(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function M6(){var e=Bie();return e.copy=function(){return Rie(e,M6())},c3.apply(e,arguments),$ie(e)}var N6=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),eae=(e,t,n,r)=>{(0,q2.default)(e.min<e.max,`domain: min must be less than max`),(0,q2.default)(t.min<t.max,`range: min must be less than max`);let i=N6(e),a=N6(t);return{scale:{x:M6().domain([e.min,e.max]).range([0,n.width]),y:M6().domain([t.max,t.min]).range([0,n.height])},snap:{x:X2.bind(null,i.min,i.max,i.step),y:X2.bind(null,a.min,a.max,a.step)},domain:e,range:t,size:n,getRootNode:r}};M();var tae=[`top`,`left`,`transform`,`className`,`children`,`innerRef`];function P6(){return P6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P6.apply(this,arguments)}function nae(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function F6(e){var t=e.top,n=t===void 0?0:t,r=e.left,i=r===void 0?0:r,a=e.transform,o=e.className,s=e.children,c=e.innerRef,l=nae(e,tae);return W.createElement(`g`,P6({ref:c,className:(0,yW.default)(`visx-group`,o),transform:a||`translate(`+i+`, `+n+`)`},l),s)}F6.propTypes={top:j.number,left:j.number,transform:j.string,className:j.string,children:j.node,innerRef:j.oneOfType([j.string,j.func,j.object])};function I6(e){if((typeof e==`function`||typeof e==`object`&&e)&&`valueOf`in e){var t=e.valueOf();if(typeof t==`number`)return t}return e}function L6(e,t){var n=e;return`ticks`in n?n.ticks(t):n.domain().filter(function(e,n,r){return t==null||r.length<=t||n%Math.round((r.length-1)/t)===0})}function rae(e){return e?.toString()}function R6(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function z6(){return new R6}var B6,V6,H6,U6,iae=o((()=>{B6=Math.PI,V6=2*B6,H6=1e-6,U6=V6-H6,R6.prototype=z6.prototype={constructor:R6,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>H6)if(!(Math.abs(u*s-c*l)>H6)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((B6-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>H6&&(this._+=`L`+(e+y*l)+`,`+(t+y*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+b*s)+`,`+(this._y1=t+b*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>H6||Math.abs(this._y1-l)>H6)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%V6+V6),d>U6?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>H6&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=B6)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}}})),W6=o((()=>{iae()}));function G6(e){return function(){return e}}var K6=o((()=>{}));function q6(e){this._context=e}function aae(e){return new q6(e)}var J6=o((()=>{q6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}}}));function oae(e){return e[0]}function sae(e){return e[1]}var Y6=o((()=>{}));function cae(){var e=oae,t=sae,n=G6(!0),r=null,i=aae,a=null;function o(o){var s,c=o.length,l,u=!1,d;for(r??(a=i(d=z6())),s=0;s<=c;++s)!(s<c&&n(l=o[s],s,o))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(l,s,o),+t(l,s,o));if(d)return a=null,d+``||null}return o.x=function(t){return arguments.length?(e=typeof t==`function`?t:G6(+t),o):e},o.y=function(e){return arguments.length?(t=typeof e==`function`?e:G6(+e),o):t},o.defined=function(e){return arguments.length?(n=typeof e==`function`?e:G6(!!e),o):n},o.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),o):i},o.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),o):r},o}var lae=o((()=>{W6(),K6(),J6(),Y6()}));function X6(e){return e<0?-1:1}function Z6(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(X6(a)+X6(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Q6(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $6(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function e8(e){this._context=e}function uae(e){this._context=new t8(e)}function t8(e){this._context=e}function dae(e){return new e8(e)}var fae=o((()=>{e8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$6(this,this._t0,Q6(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,$6(this,Q6(this,n=Z6(this,e,t)),n);break;default:$6(this,this._t0,n=Z6(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(uae.prototype=Object.create(e8.prototype)).point=function(e,t){e8.prototype.point.call(this,t,e)},t8.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}}})),pae=o((()=>{W6(),K6(),J6(),lae(),Y6(),fae()}));function n8(e,t){e(t)}pae();function mae(e){var t=e===void 0?{}:e,n=t.x,r=t.y,i=t.defined,a=t.curve,o=cae();return n&&n8(o.x,n),r&&n8(o.y,r),i&&o.defined(i),a&&o.curve(a),o}var hae=[`from`,`to`,`fill`,`className`,`innerRef`];function r8(){return r8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r8.apply(this,arguments)}function gae(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function i8(e){var t=e.from,n=t===void 0?{x:0,y:0}:t,r=e.to,i=r===void 0?{x:1,y:1}:r,a=e.fill,o=a===void 0?`transparent`:a,s=e.className,c=e.innerRef,l=gae(e,hae),u=n.x===i.x||n.y===i.y;return W.createElement(`line`,r8({ref:c,className:(0,yW.default)(`visx-line`,s),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:o,shapeRendering:u?`crispEdges`:`auto`},l))}var _ae=[`children`,`data`,`x`,`y`,`fill`,`className`,`curve`,`innerRef`,`defined`];function a8(){return a8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a8.apply(this,arguments)}function vae(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function o8(e){var t=e.children,n=e.data,r=n===void 0?[]:n,i=e.x,a=e.y,o=e.fill,s=o===void 0?`transparent`:o,c=e.className,l=e.curve,u=e.innerRef,d=e.defined,f=d===void 0?function(){return!0}:d,p=vae(e,_ae),m=mae({x:i,y:a,defined:f,curve:l});return t?W.createElement(W.Fragment,null,t({path:m})):W.createElement(`path`,a8({ref:u,className:(0,yW.default)(`visx-linepath`,c),d:m(r)||``,fill:s,strokeLinecap:`round`},p))}var yae=s(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),bae=s(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),xae=s(((e,t)=>{var n=bae();t.exports=r;function r(e,t,n){var r=e;return i(e,t).reduce(function(e,i){return e.replace(i.functionIdentifier+`(`+i.matches.body+`)`,a(i.matches.body,i.functionIdentifier,n,r,t))},e)}function i(e,t){var r=[],i=typeof t==`string`?RegExp(`\\b(`+t+`)\\(`):t;do{var a=i.exec(e);if(!a)return r;if(a[1]===void 0)throw Error(`Missing the first couple of parenthesis to get the function identifier in `+t);var o=a[1],s=a.index,c=n(`(`,`)`,e.substring(s));if(!c||c.start!==a[0].length-1)throw SyntaxError(o+`(): missing closing ')' in the value '`+e+`'`);r.push({matches:c,functionIdentifier:o}),e=c.post}while(i.test(e));return r}function a(e,t,n,i,a){return n(r(e,a,n),t,i)}})),Sae=s(((e,t)=>{var n=function(e){this.value=e};n.math={isDegree:!0,acos:function(e){return n.math.isDegree?180/Math.PI*Math.acos(e):Math.acos(e)},add:function(e,t){return e+t},asin:function(e){return n.math.isDegree?180/Math.PI*Math.asin(e):Math.asin(e)},atan:function(e){return n.math.isDegree?180/Math.PI*Math.atan(e):Math.atan(e)},acosh:function(e){return Math.log(e+Math.sqrt(e*e-1))},asinh:function(e){return Math.log(e+Math.sqrt(e*e+1))},atanh:function(e){return Math.log((1+e)/(1-e))},C:function(e,t){var r=1,i=e-t,a=t;a<i&&(a=i,i=t);for(var o=a+1;o<=e;o++)r*=o;return r/n.math.fact(i)},changeSign:function(e){return-e},cos:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.cos(e)},cosh:function(e){return(Math.E**+e+Math.E**(-1*e))/2},div:function(e,t){return e/t},fact:function(e){if(e%1!=0)return`NaN`;for(var t=1,n=2;n<=e;n++)t*=n;return t},inverse:function(e){return 1/e},log:function(e){return Math.log(e)/Math.log(10)},mod:function(e,t){return e%t},mul:function(e,t){return e*t},P:function(e,t){for(var n=1,r=Math.floor(e)-Math.floor(t)+1;r<=Math.floor(e);r++)n*=r;return n},Pi:function(e,t,n){for(var r=1,i=e;i<=t;i++)r*=Number(n.postfixEval({n:i}));return r},pow10x:function(e){for(var t=1;e--;)t*=10;return t},sigma:function(e,t,n){for(var r=0,i=e;i<=t;i++)r+=Number(n.postfixEval({n:i}));return r},sin:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.sin(e)},sinh:function(e){return(Math.E**+e-Math.E**(-1*e))/2},sub:function(e,t){return e-t},tan:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.tan(e)},tanh:function(e){return n.sinha(e)/n.cosha(e)},toRadian:function(e){return e*Math.PI/180},and:function(e,t){return e&t}},n.Exception=function(e){this.message=e},t.exports=n})),Cae=s(((e,t)=>{var n=Sae();function r(e,t){for(var n=0;n<e.length;n++)e[n]+=t;return e}for(var i=[{token:`sin`,show:`sin`,type:0,value:n.math.sin},{token:`cos`,show:`cos`,type:0,value:n.math.cos},{token:`tan`,show:`tan`,type:0,value:n.math.tan},{token:`pi`,show:`&pi;`,type:3,value:`PI`},{token:`(`,show:`(`,type:4,value:`(`},{token:`)`,show:`)`,type:5,value:`)`},{token:`P`,show:`P`,type:10,value:n.math.P},{token:`C`,show:`C`,type:10,value:n.math.C},{token:` `,show:` `,type:14,value:` `.anchor},{token:`asin`,show:`asin`,type:0,value:n.math.asin},{token:`acos`,show:`acos`,type:0,value:n.math.acos},{token:`atan`,show:`atan`,type:0,value:n.math.atan},{token:`7`,show:`7`,type:1,value:`7`},{token:`8`,show:`8`,type:1,value:`8`},{token:`9`,show:`9`,type:1,value:`9`},{token:`int`,show:`Int`,type:0,value:Math.floor},{token:`cosh`,show:`cosh`,type:0,value:n.math.cosh},{token:`acosh`,show:`acosh`,type:0,value:n.math.acosh},{token:`ln`,show:` ln`,type:0,value:Math.log},{token:`^`,show:`^`,type:10,value:Math.pow},{token:`root`,show:`root`,type:0,value:Math.sqrt},{token:`4`,show:`4`,type:1,value:`4`},{token:`5`,show:`5`,type:1,value:`5`},{token:`6`,show:`6`,type:1,value:`6`},{token:`/`,show:`&divide;`,type:2,value:n.math.div},{token:`!`,show:`!`,type:7,value:n.math.fact},{token:`tanh`,show:`tanh`,type:0,value:n.math.tanh},{token:`atanh`,show:`atanh`,type:0,value:n.math.atanh},{token:`Mod`,show:` Mod `,type:2,value:n.math.mod},{token:`1`,show:`1`,type:1,value:`1`},{token:`2`,show:`2`,type:1,value:`2`},{token:`3`,show:`3`,type:1,value:`3`},{token:`*`,show:`&times;`,type:2,value:n.math.mul},{token:`sinh`,show:`sinh`,type:0,value:n.math.sinh},{token:`asinh`,show:`asinh`,type:0,value:n.math.asinh},{token:`e`,show:`e`,type:3,value:`E`},{token:`log`,show:` log`,type:0,value:n.math.log},{token:`0`,show:`0`,type:1,value:`0`},{token:`.`,show:`.`,type:6,value:`.`},{token:`+`,show:`+`,type:9,value:n.math.add},{token:`-`,show:`-`,type:9,value:n.math.sub},{token:`,`,show:`,`,type:11,value:`,`},{token:`Sigma`,show:`&Sigma;`,type:12,value:n.math.sigma},{token:`n`,show:`n`,type:13,value:`n`},{token:`Pi`,show:`&Pi;`,type:12,value:n.math.Pi},{token:`pow`,show:`pow`,type:8,value:Math.pow,numberOfArguments:2},{token:`&`,show:`&`,type:9,value:n.math.and}],a={0:11,1:0,2:3,3:0,4:0,5:0,6:0,7:11,8:11,9:1,10:10,11:0,12:11,13:0,14:-1,15:11},o=0;o<i.length;o++)i[o].precedence=a[i[o].type];var s={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,9:!0,12:!0,13:!0,14:!0,15:!0},c={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0,10:!0,11:!0,12:!0,13:!0,15:!0},l={0:!0,3:!0,4:!0,8:!0,12:!0,13:!0,15:!0},u={},d={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,12:!0,13:!0,15:!0},f={1:!0},p=[[],`123789456+-*/()^!PCe0.,n &`.split(``),[`pi`,`ln`,`Pi`],[`sin`,`cos`,`tan`,`Del`,`int`,`Mod`,`log`,`pow`],[`asin`,`acos`,`atan`,`cosh`,`root`,`tanh`,`sinh`],[`acosh`,`atanh`,`asinh`,`Sigma`]];function m(e,t,n,r){for(var i=0;i<r;i++)if(e[n+i]!==t[i])return!1;return!0}n.tokenTypes={FUNCTION_WITH_ONE_ARG:0,NUMBER:1,BINARY_OPERATOR_HIGH_PRECENDENCE:2,CONSTANT:3,OPENING_PARENTHESIS:4,CLOSING_PARENTHESIS:5,DECIMAL:6,POSTFIX_FUNCTION_WITH_ONE_ARG:7,FUNCTION_WITH_N_ARGS:8,BINARY_OPERATOR_LOW_PRECENDENCE:9,BINARY_OPERATOR_PERMUTATION:10,COMMA:11,EVALUATED_FUNCTION:12,EVALUATED_FUNCTION_PARAMETER:13,SPACE:14},n.addToken=function(e){for(var t=0;t<e.length;t++){var r=e[t].token.length,o=-1;e[t].type===n.tokenTypes.FUNCTION_WITH_N_ARGS&&e[t].numberOfArguments===void 0&&(e[t].numberOfArguments=2),p[r]=p[r]||[];for(var s=0;s<p[r].length;s++)if(e[t].token===p[r][s]){o=h(p[r][s],i);break}o===-1?(i.push(e[t]),e[t].precedence=a[e[t].type],p.length<=e[t].token.length&&(p[e[t].token.length]=[]),p[e[t].token.length].push(e[t].token)):(i[o]=e[t],e[t].precedence=a[e[t].type])}};function h(e,t){for(var n=0;n<t.length;n++)if(t[n].token===e)return n;return-1}function g(e){for(var t=[],r=e.length,a,o,s,c=0;c<r;c++)if(!(c<r-1&&e[c]===` `&&e[c+1]===` `)){for(a=``,o=e.length-c>p.length-2?p.length-1:e.length-c;o>0;o--)if(p[o]!==void 0)for(s=0;s<p[o].length;s++)m(e,p[o][s],c,o)&&(a=p[o][s],s=p[o].length,o=0);if(c+=a.length-1,a===``)throw new n.Exception(`Can't understand after `+e.slice(c));t.push(i[h(a,i)])}return t}var _={value:n.math.changeSign,type:0,pre:21,show:`-`},v={value:`)`,show:`)`,type:5,pre:0},y={value:`(`,type:4,pre:0,show:`(`};n.lex=function(e,t){"use strict";var i=[y],a=[],o=e,p=s,m=0,h=u,b=``,x;t!==void 0&&n.addToken(t);var S={},C=g(o);for(x=0;x<C.length;x++){var w=C[x];if(w.type===14){if(x>0&&x<C.length-1&&C[x+1].type===1&&(C[x-1].type===1||C[x-1].type===6))throw new n.Exception(`Unexpected Space`);continue}var T=w.token,E=w.type,D=w.value,O=w.precedence,k=w.show,A=i[i.length-1],j;for(j=a.length;j--&&a[j]===0;)if([0,2,3,4,5,9,11,12,13].indexOf(E)!==-1){if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);i.push(v),p=c,h=d,a.pop()}if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);if(h[E]===!0&&(E=2,D=n.math.mul,k=`&times;`,O=3,--x),S={value:D,type:E,pre:O,show:k,numberOfArguments:w.numberOfArguments},E===0)p=s,h=u,r(a,2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(2));else if(E===1)A.type===1?(A.value+=D,r(a,1)):i.push(S),p=c,h=l;else if(E===2)p=s,h=u,r(a,2),i.push(S);else if(E===3)i.push(S),p=c,h=d;else if(E===4)r(a,1),m++,p=s,h=u,i.push(S);else if(E===5){if(!m)throw new n.Exception(`Closing parenthesis are more than opening one, wait What!!!`);m--,p=c,h=d,i.push(S),r(a,1)}else if(E===6){if(A.hasDec)throw new n.Exception(`Two decimals are not allowed in one number`);A.type!==1&&(A={value:0,type:1,pre:0},i.push(A)),p=f,r(a,1),h=u,A.value+=D,A.hasDec=!0}else E===7&&(p=c,h=d,r(a,1),i.push(S));E===8?(p=s,h=u,r(a,w.numberOfArguments+2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(w.numberOfArguments+2))):E===9?(A.type===9?A.value===n.math.add?(A.value=D,A.show=k,r(a,1)):A.value===n.math.sub&&k===`-`&&(A.value=n.math.add,A.show=`+`,r(a,1)):A.type!==5&&A.type!==7&&A.type!==1&&A.type!==3&&A.type!==13?T===`-`&&(p=s,h=u,r(a,2).push(2),i.push(_),i.push(y)):(i.push(S),r(a,2)),p=s,h=u):E===10?(p=s,h=u,r(a,2),i.push(S)):E===11?(p=s,h=u,i.push(S)):E===12?(p=s,h=u,r(a,6),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(6))):E===13&&(p=c,h=d,i.push(S)),r(a,-1),b=T}for(j=a.length;j--;)i.push(v);if(p[5]!==!0)throw new n.Exception(`complete the expression`);for(;m--;)i.push(v);return i.push(v),new n(i)},t.exports=n})),wae=s(((e,t)=>{var n=Cae();n.prototype.toPostfix=function(){"use strict";for(var e=[],t,r,i,a,o,s=[{value:`(`,type:4,pre:0}],c=this.value,l=1;l<c.length;l++)if(c[l].type===1||c[l].type===3||c[l].type===13)c[l].type===1&&(c[l].value=Number(c[l].value)),e.push(c[l]);else if(c[l].type===4)s.push(c[l]);else if(c[l].type===5)for(;(r=s.pop()).type!==4;)e.push(r);else if(c[l].type===11){for(;(r=s.pop()).type!==4;)e.push(r);s.push(r)}else{t=c[l],a=t.pre,o=s[s.length-1],i=o.pre;var u=o.value==`Math.pow`&&t.value==`Math.pow`;if(a>i)s.push(t);else{for(;i>=a&&!u||u&&a<i;)r=s.pop(),o=s[s.length-1],e.push(r),i=o.pre,u=t.value==`Math.pow`&&o.value==`Math.pow`;s.push(t)}}return new n(e)},t.exports=n})),Tae=s(((e,t)=>{var n=wae();n.prototype.postfixEval=function(e){"use strict";e||={},e.PI=Math.PI,e.E=Math.E;for(var t=[],r,i,a,o=this.value,s=e.n!==void 0,c=0;c<o.length;c++)if(o[c].type===1)t.push({value:o[c].value,type:1});else if(o[c].type===3)t.push({value:e[o[c].value],type:1});else if(o[c].type===0)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===7)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===8){for(var l=[],u=0;u<o[c].numberOfArguments;u++)l.push(t.pop().value);t.push({type:1,value:o[c].value.apply(o[c],l.reverse())})}else o[c].type===10?(r=t.pop(),i=t.pop(),i.type===void 0?(i.value=i.concat(r),i.value.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===2||o[c].type===9?(r=t.pop(),i=t.pop(),i.type===void 0?(i=i.concat(r),i.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===12?(r=t.pop(),r.type!==void 0&&(r=[r]),i=t.pop(),a=t.pop(),t.push({type:1,value:o[c].value(a.value,i.value,new n(r))})):o[c].type===13&&(s?t.push({value:e[o[c].value],type:3}):t.push([o[c]]));if(t.length>1)throw new n.Exception(`Uncaught Syntax error`);return t[0].value>0x38d7ea4c68000?`Infinity`:parseFloat(t[0].value.toFixed(15))},n.eval=function(e,t,n){return t===void 0?this.lex(e).toPostfix().postfixEval():n===void 0?t.length===void 0?this.lex(e).toPostfix().postfixEval(t):this.lex(e,t).toPostfix().postfixEval():this.lex(e,t).toPostfix().postfixEval(n)},t.exports=n})),Eae=s(((e,t)=>{var n=Tae();n.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,a=0;a<i.length;a++)i[a].type===1||i[a].type===3?r.push({value:i[a].type===3?i[a].show:i[a].value,type:1}):i[a].type===13?r.push({value:i[a].show,type:1}):i[a].type===0?r[r.length-1]={value:i[a].show+(i[a].show==`-`?``:`(`)+r[r.length-1].value+(i[a].show==`-`?``:`)`),type:0}:i[a].type===7?r[r.length-1]={value:(r[r.length-1].type==1?``:`(`)+r[r.length-1].value+(r[r.length-1].type==1?``:`)`)+i[a].show,type:7}:i[a].type===10?(e=r.pop(),t=r.pop(),i[a].show===`P`||i[a].show===`C`?r.push({value:`<sup>`+t.value+`</sup>`+i[a].show+`<sub>`+e.value+`</sub>`,type:10}):r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+`<sup>`+e.value+`</sup>`,type:1})):i[a].type===2||i[a].type===9?(e=r.pop(),t=r.pop(),r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+i[a].show+(e.type==1?``:`(`)+e.value+(e.type==1?``:`)`),type:i[a].type})):i[a].type===12&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[a].show+`(`+n.value+`,`+t.value+`,`+e.value+`)`,type:12}));return r[0].value},t.exports=n})),Dae=s(((e,t)=>{var n=yae(),r=xae(),i=Eae(),a=100,o=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,s;t.exports=c;function c(e,t){s=0,t=10**(t===void 0?5:t),e=e.replace(/\n+/g,` `);function c(e,n,r){if(s++>a)throw s=0,Error(`Call stack overflow for `+r);if(e===``)throw Error(n+`(): '`+r+`' must contain a non-whitespace string`);e=u(e,r);var o=l(e);if(o.length>1||e.indexOf(`var(`)>-1)return n+`(`+e+`)`;var c=o[0]||``;c===`%`&&(e=e.replace(/\b[0-9\.]+%/g,function(e){return parseFloat(e.slice(0,-1))*.01}));var d=e.replace(new RegExp(c,`gi`),``),f;try{f=i.eval(d)}catch{return n+`(`+e+`)`}return c===`%`&&(f*=100),(n.length||c===`%`)&&(f=Math.round(f*t)/t),f+=c,f}function u(e,t){e=e.replace(/((?:\-[a-z]+\-)?calc)/g,``);for(var r=``,i=e,a;a=o.exec(i);){a[0].index>0&&(r+=i.substring(0,a[0].index));var s=n(`(`,`)`,i.substring([0].index));if(s.body===``)throw Error(`'`+e+`' must contain a non-whitespace string`);var l=c(s.body,``,t);r+=s.pre+l,i=s.post}return r+i}return r(e,/((?:\-[a-z]+\-)?calc)\(/,c)}function l(e){for(var t=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(e);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(t.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(e));return t}})),Oae=s(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),s8=s(((e,t)=>{var n=Oae(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),c8=s(((e,t)=>{t.exports=s8().Symbol})),kae=s(((e,t)=>{var n=c8(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Aae=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),jae=s(((e,t)=>{var n=c8(),r=kae(),i=Aae(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),l8=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Mae=s(((e,t)=>{var n=jae(),r=l8(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Nae=s(((e,t)=>{t.exports=s8()[`__core-js_shared__`]})),Pae=s(((e,t)=>{var n=Nae(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Fae=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Iae=s(((e,t)=>{var n=Mae(),r=Pae(),i=l8(),a=Fae(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Lae=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),u8=s(((e,t)=>{var n=Iae(),r=Lae();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),d8=s(((e,t)=>{t.exports=u8()(Object,`create`)})),Rae=s(((e,t)=>{var n=d8();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),zae=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Bae=s(((e,t)=>{var n=d8(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Vae=s(((e,t)=>{var n=d8(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Hae=s(((e,t)=>{var n=d8(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),Uae=s(((e,t)=>{var n=Rae(),r=zae(),i=Bae(),a=Vae(),o=Hae();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Wae=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Gae=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),f8=s(((e,t)=>{var n=Gae();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Kae=s(((e,t)=>{var n=f8(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),qae=s(((e,t)=>{var n=f8();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Jae=s(((e,t)=>{var n=f8();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Yae=s(((e,t)=>{var n=f8();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Xae=s(((e,t)=>{var n=Wae(),r=Kae(),i=qae(),a=Jae(),o=Yae();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Zae=s(((e,t)=>{t.exports=u8()(s8(),`Map`)})),Qae=s(((e,t)=>{var n=Uae(),r=Xae(),i=Zae();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),$ae=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),p8=s(((e,t)=>{var n=$ae();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),eoe=s(((e,t)=>{var n=p8();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),toe=s(((e,t)=>{var n=p8();function r(e){return n(this,e).get(e)}t.exports=r})),noe=s(((e,t)=>{var n=p8();function r(e){return n(this,e).has(e)}t.exports=r})),roe=s(((e,t)=>{var n=p8();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),ioe=s(((e,t)=>{var n=Qae(),r=eoe(),i=toe(),a=noe(),o=roe();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),aoe=u(s(((e,t)=>{var n=ioe(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i}))()),m8=`__react_svg_text_measurement_id`;function ooe(e,t){try{var n=document.getElementById(m8);if(!n){var r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);r.setAttribute(`aria-hidden`,`true`),r.style.width=`0`,r.style.height=`0`,r.style.position=`absolute`,r.style.top=`-100%`,r.style.left=`-100%`,n=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),n.setAttribute(`id`,m8),r.appendChild(n),document.body.appendChild(r)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch{return null}}var h8=(0,aoe.default)(ooe,function(e,t){return e+`_`+JSON.stringify(t)}),g8=u(Dae()),soe=[`verticalAnchor`,`scaleToFit`,`angle`,`width`,`lineHeight`,`capHeight`,`children`,`style`];function coe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function _8(e){return typeof e==`number`}function v8(e){return typeof e==`number`&&Number.isFinite(e)||typeof e==`string`}function loe(e){var t=e.verticalAnchor,n=t===void 0?`end`:t,r=e.scaleToFit,i=r===void 0?!1:r,a=e.angle,o=e.width,s=e.lineHeight,c=s===void 0?`1em`:s,l=e.capHeight,u=l===void 0?`0.71em`:l,d=e.children,f=e.style,p=coe(e,soe),m=p.x,h=m===void 0?0:m,g=p.y,_=g===void 0?0:g,v=!v8(h)||!v8(_),y=(0,W.useMemo)(function(){return{wordsWithWidth:(d==null?[]:d.toString().split(/(?:(?!\u00A0+)\s+)/)).map(function(e){return{word:e,wordWidth:h8(e,f)||0}}),spaceWidth:h8(`\xA0`,f)||0}},[d,f]),b=y.wordsWithWidth,x=y.spaceWidth,S=(0,W.useMemo)(function(){return v?[]:o||i?b.reduce(function(e,t){var n=t.word,r=t.wordWidth,a=e[e.length-1];if(a&&(o==null||i||(a.width||0)+r+x<o))a.words.push(n),a.width=a.width||0,a.width+=r+x;else{var s={words:[n],width:r};e.push(s)}return e},[]):[{words:d==null?[]:d.toString().split(/(?:(?!\u00A0+)\s+)/)}]},[v,o,i,d,b,x]);return{wordsByLines:S,startDy:(0,W.useMemo)(function(){return v?``:n===`start`?(0,g8.default)(`calc(`+u+`)`):n===`middle`?(0,g8.default)(`calc(`+(S.length-1)/2+` * -`+c+` + (`+u+` / 2))`):(0,g8.default)(`calc(`+(S.length-1)+` * -`+c+`)`)},[v,n,u,S.length,c]),transform:(0,W.useMemo)(function(){var e=[];if(v)return``;if(_8(h)&&_8(_)&&_8(o)&&i&&S.length>0){var t=S[0].width||1,n=i===`shrink-only`?Math.min(o/t,1):o/t,r=n,s=h-n*h,c=_-r*_;e.push(`matrix(`+n+`, 0, 0, `+r+`, `+s+`, `+c+`)`)}return a&&e.push(`rotate(`+a+`, `+h+`, `+_+`)`),e.length>0?e.join(` `):``},[v,h,_,o,i,S,a])}}var uoe=[`dx`,`dy`,`textAnchor`,`innerRef`,`innerTextRef`,`verticalAnchor`,`angle`,`lineHeight`,`scaleToFit`,`capHeight`,`width`];function y8(){return y8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y8.apply(this,arguments)}function doe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var foe={overflow:`visible`};function b8(e){var t=e.dx,n=t===void 0?0:t,r=e.dy,i=r===void 0?0:r,a=e.textAnchor,o=a===void 0?`start`:a,s=e.innerRef,c=e.innerTextRef;e.verticalAnchor,e.angle;var l=e.lineHeight,u=l===void 0?`1em`:l;e.scaleToFit,e.capHeight,e.width;var d=doe(e,uoe),f=d.x,p=f===void 0?0:f,m=d.fontSize,h=loe(e),g=h.wordsByLines,_=h.startDy,v=h.transform;return W.createElement(`svg`,{ref:s,x:n,y:i,fontSize:m,style:foe},g.length>0?W.createElement(`text`,y8({ref:c,transform:v},d,{textAnchor:o}),g.map(function(e,t){return W.createElement(`tspan`,{key:t,x:p,dy:t===0?_:u},e.words.join(` `))})):null)}var x8={top:`top`,left:`left`,right:`right`,bottom:`bottom`};function poe(e){var t=e.labelOffset,n=e.labelProps,r=e.orientation,i=e.range,a=e.tickLabelFontSize,o=e.tickLength,s=r===x8.left||r===x8.top?-1:1,c,l,u;if(r===x8.top||r===x8.bottom){var d=r===x8.bottom&&typeof n.fontSize==`number`?n.fontSize:0;c=(Number(i[0])+Number(i[i.length-1]))/2,l=s*(o+t+a+d)}else c=s*((Number(i[0])+Number(i[i.length-1]))/2),l=-(o+t),u=`rotate(`+s*90+`)`;return{x:c,y:l,transform:u}}function S8(){return S8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S8.apply(this,arguments)}function moe(e){var t=e.hideTicks,n=e.horizontal,r=e.orientation,i=e.tickClassName,a=e.tickComponent,o=e.tickLabelProps,s=e.tickStroke,c=s===void 0?`#222`:s,l=e.tickTransform,u=e.ticks,d=e.strokeWidth,f=e.tickLineProps;return u.map(function(e){var s=e.value,u=e.index,p=e.from,m=e.to,h=e.formattedValue,g=o[u]??{},_=Math.max(10,typeof g.fontSize==`number`&&g.fontSize||0),v=m.y+(n&&r!==x8.top?_:0);return W.createElement(F6,{key:`visx-tick-`+s+`-`+u,className:(0,yW.default)(`visx-axis-tick`,i),transform:l},!t&&W.createElement(i8,S8({from:p,to:m,stroke:c,strokeWidth:d,strokeLinecap:`square`},f)),a?a(S8({},g,{x:m.x,y:v,formattedValue:h})):W.createElement(b8,S8({x:m.x,y:v},g),h))})}function C8(){return C8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C8.apply(this,arguments)}var w8={textAnchor:`middle`,fontFamily:`Arial`,fontSize:10,fill:`#222`};function hoe(e){var t=e.axisFromPoint,n=e.axisLineClassName,r=e.axisToPoint,i=e.hideAxisLine,a=e.hideTicks,o=e.horizontal,s=e.label,c=s===void 0?``:s,l=e.labelClassName,u=e.labelOffset,d=u===void 0?14:u,f=e.labelProps,p=e.orientation,m=p===void 0?x8.bottom:p,h=e.scale,g=e.stroke,_=g===void 0?`#222`:g,v=e.strokeDasharray,y=e.strokeWidth,b=y===void 0?1:y,x=e.tickClassName,S=e.tickComponent,C=e.tickLineProps,w=e.tickLabelProps,T=e.tickLength,E=T===void 0?8:T,D=e.tickStroke,O=D===void 0?`#222`:D,k=e.tickTransform,A=e.ticks,j=e.ticksComponent,M=j===void 0?moe:j,N=C8({},w8,f),P=C8({},w8,typeof w==`object`?w:null),F=A.map(function(e){var t=e.value,n=e.index;return typeof w==`function`?w(t,n,A):P}),ee=Math.max.apply(Math,[10].concat(F.map(function(e){return typeof e.fontSize==`number`?e.fontSize:0})));return W.createElement(W.Fragment,null,M({hideTicks:a,horizontal:o,orientation:m,scale:h,tickClassName:x,tickComponent:S,tickLabelProps:F,tickStroke:O,tickTransform:k,ticks:A,strokeWidth:b,tickLineProps:C}),!i&&W.createElement(i8,{className:(0,yW.default)(`visx-axis-line`,n),from:t,to:r,stroke:_,strokeWidth:b,strokeDasharray:v}),c&&W.createElement(b8,C8({className:(0,yW.default)(`visx-axis-label`,l)},poe({labelOffset:d,labelProps:N,orientation:m,range:h.range(),tickLabelFontSize:ee,tickLength:E}),N),c))}function goe(e,t){t===void 0&&(t=`center`);var n=e;if(t!==`start`&&`bandwidth`in n){var r=n.bandwidth();return t===`center`&&(r/=2),n.round()&&(r=Math.round(r)),function(e){var t=n(e);return typeof t==`number`?t+r:t}}return e}function _oe(e){var t=e;return`tickFormat`in t?t.tickFormat():rae}var T8=function(){function e(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r;this.x=0,this.y=0,this.x=n,this.y=i}var t=e.prototype;return t.value=function(){return{x:this.x,y:this.y}},t.toArray=function(){return[this.x,this.y]},e}();function E8(e,t){var n=e.x,r=e.y;return new T8(t?{x:n,y:r}:{x:r,y:n})}function D8(){return D8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D8.apply(this,arguments)}function voe(e){return e===void 0&&(e=0),typeof e==`number`?{start:e,end:e}:D8({start:0,end:0},e)}M();var yoe=[`children`,`axisClassName`,`hideAxisLine`,`hideTicks`,`hideZero`,`innerRef`,`left`,`numTicks`,`orientation`,`rangePadding`,`scale`,`tickFormat`,`tickLength`,`tickValues`,`top`];function O8(){return O8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O8.apply(this,arguments)}function boe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function k8(e){var t=e.children,n=t===void 0?hoe:t,r=e.axisClassName,i=e.hideAxisLine,a=i===void 0?!1:i,o=e.hideTicks,s=o===void 0?!1:o,c=e.hideZero,l=c===void 0?!1:c,u=e.innerRef,d=e.left,f=d===void 0?0:d,p=e.numTicks,m=p===void 0?10:p,h=e.orientation,g=h===void 0?x8.bottom:h,_=e.rangePadding,v=_===void 0?0:_,y=e.scale,b=e.tickFormat,x=e.tickLength,S=x===void 0?8:x,C=e.tickValues,w=e.top,T=w===void 0?0:w,E=boe(e,yoe),D=b??_oe(y),O=g===x8.left,k=g===x8.top,A=k||g===x8.bottom,j=goe(y),M=O||k?-1:1,N=y.range(),P=voe(v),F=E8({x:Number(N[0])+.5-P.start,y:0},A),ee=E8({x:Number(N[N.length-1])+.5+P.end,y:0},A),te=(C??L6(y,m)).filter(function(e){return!l||e!==0&&e!==`0`}).map(function(e,t){return{value:e,index:t}}),I=te.map(function(e){var t=e.value,n=e.index,r=I6(j(t));return{value:t,index:n,from:E8({x:r,y:0},A),to:E8({x:r,y:S*M},A),formattedValue:D(t,n,te)}});return W.createElement(F6,{className:(0,yW.default)(`visx-axis`,r),innerRef:u,top:T,left:f},n(O8({},E,{axisFromPoint:F,axisToPoint:ee,hideAxisLine:a,hideTicks:s,hideZero:l,horizontal:A,numTicks:m,orientation:g,rangePadding:v,scale:y,tickFormat:D,tickLength:S,tickPosition:j,tickSign:M,ticks:I})))}M();var xoe=J(`path`)(({theme:e})=>({fill:`var(--arrow-color, ${e.palette.common.black})`})),A8=class extends W.Component{render(){let{x:e,y:t,className:n,scale:r}=this.props,i=this.props.direction||`left`,a=r.x(e),o=r.y(t),s=``,c=(e,t,n)=>`translate(${e}, ${t}) rotate(${n})`;return i===`left`&&(s=c(a-15,o,0)),i===`right`&&(s=c(a+15,o,180)),i===`up`&&(s=c(a,o-15,90)),i===`down`&&(s=c(a,o+15,270)),(0,G.jsx)(xoe,{d:`m 0,0 8,-5 0,10 -8,-5`,transform:s,className:n})}};A8.propTypes={y:j.number,x:j.number,direction:j.oneOf([`left`,`right`,`up`,`down`]),className:j.string,scale:V2.isRequired},A8.defaultProps={y:0,x:0,direction:`left`};var j8=e=>e?.label===``?xp(e,`label`):e,M8=Q2,N8=$2,Soe=()=>0,P8=()=>0,F8=e=>{let t=[],n=0;for(;n>=e.min&&t.indexOf(n)<0;)t.push(n),n=Math.round((n-e.step)*1e4)/1e4;for(n=Math.round(e.step*1e4)/1e4;n<=e.max&&t.indexOf(n)<0;)t.push(n),n=Math.round((n+e.step)*1e4)/1e4;return t?t.filter(t=>t>=e.min&&t<=e.max):[]},Coe=e=>e==null||pp(e)?1:e.split(` `).length,woe=e=>(e||``).replace(/<[^>]+>/g,``).split(` `).sort((e,t)=>t.length-e.length)[0].length,I8=e=>e?e*10:0,Toe=e=>{let t=ap(e),n={left:t.x,top:t.y,bottom:t.y,right:t.x};return Op(e).reduce((e,t)=>(e.left=Math.min(e.left,t.x),e.top=Math.max(e.top,t.y),e.bottom=Math.min(e.bottom,t.y),e.right=Math.max(e.right,t.x),e),n)},Eoe=(e,t)=>Doe(e,t),Doe=(e,t)=>((0,q2.default)(!!e&&!!t,`a or b is undefined`),{left:Math.min(e.x,t.x),top:Math.max(e.y,t.y),bottom:Math.min(e.y,t.y),right:Math.max(e.x,t.x)}),L8=e=>{let t=Lf(e);return t.sort((e,t)=>t.x-e.x),{a:t[0],b:t[1]}},R8=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),z8=e=>parseFloat(e.toFixed(4)),B8=(e,t)=>e&&t&&(z8(e.x)===z8(t.x)||z8(e.y)===z8(t.y)),V8=(e,t)=>e&&t&&mp({x:z8(e.x),y:z8(e.y)},{x:z8(t.x),y:z8(t.y)}),H8=(e,t)=>{let{min:n,max:r,step:i}=e;return t/((r-n)/i)},U8=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e;return H8(t,r)<14||H8(n,i)<14},W8=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e,a=H8(t,r),o=H8(n,i),s=t.step/(a/15),c=n.step/(o/15);return{domain:{min:t.min-s,max:t.max+s},range:{min:n.min-c,max:n.max+c}}},G8=(e,t)=>Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)),K8=e=>(e||[]).sort((e,t)=>e.x-t.x||e.y-t.y),q8=(e,t,n)=>(e.x-t.x)*(n.y-t.y)===(n.x-t.x)*(e.y-t.y),Ooe=(e,t)=>q8(e.from,t.from,t.to)&&q8(e.to,t.from,t.to),koe=(e,t)=>V8(e.root,t.root)&&G8(t.root,t.edge)===G8(e.root,e.edge),J8=(e,t,n)=>{let{type:r,building:i}=e;if(i)return!1;let a=(t||[]).filter(e=>e.type===r&&!e.building),o=a.findIndex(e=>mp(e,n));return o!==-1&&a.splice(o,1),!!a.find(t=>{if(r===`circle`||r===`parabola`||r===`sine`||r===`absolute`||r===`exponential`){let{root:n,edge:i}=e;return V8(n,t.root)&&V8(i,t.edge)||r===`circle`&&koe(t,e)}else if(r===`line`||r===`ray`||r===`segment`||r===`vector`){let{from:n,to:i}=e;return V8(n,t.from)&&V8(i,t.to)||V8(n,t.to)&&V8(i,t.from)||r===`line`&&Ooe(t,e)}else if(r===`polygon`)return mp(K8(Lf(e.points)),K8(Lf(t.points)));else if(r===`point`)return V8(t,e)})};M();function Y8(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function X8(e,t){return!e||Y8(e)?e:Y8(e.default)?e.default:t&&Y8(e[t])?e[t]:t&&Y8(e[t]?.default)?e[t].default:e}var Z8=X8(jb,`Readable`)||X8(Aoe.Readable,`Readable`),Q8=ix,$8=Q8.default,Aoe=$8&&typeof $8==`object`?$8:Q8,e5={includeArrows:j.object,graphProps:j.object},t5={includeArrows:{left:!0,right:!0,up:!0,down:!0}},n5=J(A8)(()=>({fill:X.PRIMARY})),r5=J(`div`)(({theme:e,centered:t})=>({padding:0,margin:0,"* > *":{margin:0,padding:0},"& p":{margin:0},fontSize:e.typography.fontSize,...t&&{textAlign:`center`}})),i5=J(`g`)(()=>({"& .visx-axis-line":{stroke:X.PRIMARY,strokeWidth:3},"& .visx-axis-tick":{fill:X.PRIMARY,"& line":{stroke:X.PRIMARY}}})),a5={fontFamily:`Roboto`,fontSize:`14px`,cursor:`inherit`},joe=(e,t,n,r,i,a)=>{let o=[];return e===t&&n-i<r&&r<n+i&&n-i<a&&a<n+i&&o.push(e),o},o5=e=>(e||[]).find(e=>e<0),Moe=class extends W.Component{static propTypes={...e5,graphProps:U2.isRequired};static defaultProps=t5;render(){let{includeArrows:e,graphProps:t,columnTicksValues:n,skipValues:r,distanceFromOriginToFirstNegativeY:i,dy:a}=this.props,{scale:o,domain:s,size:c,range:l}=t||{},u=e=>{let t=r&&r[0]===e?i+4:a;return{...a5,textAnchor:`middle`,y:t,dx:e===0?-10:0,dy:e===0?-7:0}},d=Coe(s.axisLabel),f=I8(woe(s.axisLabel))+2;return(0,G.jsxs)(i5,{children:[(0,G.jsx)(k8,{scale:o.x,top:o.y(0),left:0,label:s.label,rangePadding:8,tickFormat:e=>e,tickLabelProps:u,tickValues:n,hideZero:!(s.labelStep||l.labelStep)&&s.min<=0}),e&&e.left&&(0,G.jsx)(n5,{direction:`left`,x:s.min,y:0,scale:o}),e&&e.right&&(0,G.jsx)(n5,{direction:`right`,x:s.max,y:0,scale:o}),s.axisLabel&&(0,G.jsx)(`foreignObject`,{x:c.width+17,y:o.y(0)-9,width:f,height:20*d,children:(0,G.jsx)(Z8,{false:!0,children:(0,G.jsx)(r5,{dangerouslySetInnerHTML:{__html:s.axisLabel}})})})]})}},Noe=class extends W.Component{static propTypes={...e5,graphProps:U2.isRequired};static defaultProps=t5;render(){let{includeArrows:e,graphProps:t,skipValues:n,rowTickValues:r}=this.props,{scale:i,range:a,size:o}=t||{},s=a.axisLabel?I8(a.axisLabel.length):0;return(0,G.jsxs)(i5,{children:[(0,G.jsx)(k8,{orientation:`left`,scale:i.y,top:0,height:o.height,left:i.x(0),label:a.label,labelProps:{"data-pie-readable":!1},rangePadding:8,tickLength:10,tickFormat:e=>n&&n.indexOf(e)>=0?``:e,tickLabelProps:e=>{let t=e.toLocaleString().replace(/[.-]/g,``).length||1;return{...a5,dy:4,dx:-10-t*9,"data-pie-readable":!1}},hideZero:!0,tickTextAnchor:`bottom`,tickValues:r}),e&&e.down&&(0,G.jsx)(n5,{direction:`down`,x:0,y:a.min,scale:i}),e&&e.up&&(0,G.jsx)(n5,{direction:`up`,x:0,y:a.max,scale:i}),a.axisLabel&&(0,G.jsx)(`foreignObject`,{x:i.x(0)-s/2,y:-33,width:s,height:`20`,children:(0,G.jsx)(Z8,{false:!0,children:(0,G.jsx)(r5,{centered:!0,dangerouslySetInnerHTML:{__html:a.axisLabel}})})})]})}},Poe=class extends W.Component{static propTypes={...e5,graphProps:U2.isRequired};static defaultProps=t5;xValues=()=>{let{graphProps:e}=this.props,{scale:t,domain:n}=e||{};if(!n||!t)return;let r=F8({...n,step:n.labelStep}),i=o5(r);return{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:Math.abs(t.y(0)-t.y(i))}};yValues=()=>{let{graphProps:e}=this.props,{scale:t,range:n}=e||{};if(!n||!t)return;let r=F8({...n,step:n.labelStep}),i=o5(r);return{rowTickValues:r,firstNegativeY:i,distanceFromOriginToFirstNegativeY:Math.abs(t.x(0)-t.x(i))}};render(){let{graphProps:e}=this.props,{domain:t,range:n}=e||{},{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:a}=this.xValues(),{rowTickValues:o,firstNegativeY:s,distanceFromOriginToFirstNegativeY:c}=this.yValues(),l=joe(i,s,a,c,6,25);return(0,G.jsxs)(i5,{children:[n.min<=0?(0,G.jsx)(Moe,{...this.props,skipValues:l,columnTicksValues:r,distanceFromOriginToFirstNegativeY:c,dy:25}):null,t.min<=0?(0,G.jsx)(Noe,{...this.props,skipValues:l,rowTickValues:o,distanceFromOriginToFirstNegativeX:a}):null]})}},Foe=s((e=>{e.__esModule=!0,e.default=s;var t=i(p()),n=i(pW()),r=[`from`,`to`,`fill`,`className`,`innerRef`];function i(e){return e&&e.__esModule?e:{default:e}}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function o(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function s(e){var i=e.from,s=i===void 0?{x:0,y:0}:i,c=e.to,l=c===void 0?{x:1,y:1}:c,u=e.fill,d=u===void 0?`transparent`:u,f=e.className,p=e.innerRef,m=o(e,r),h=s.x===l.x||s.y===l.y;return t.default.createElement(`line`,a({ref:p,className:(0,n.default)(`visx-line`,f),x1:s.x,y1:s.y,x2:l.x,y2:l.y,fill:d,shapeRendering:h?`crispEdges`:`auto`},m))}}));function s5(e){return`bandwidth`in e?e.bandwidth():0}M();var c5=u(Foe()),Ioe=[`top`,`left`,`scale`,`width`,`stroke`,`strokeWidth`,`strokeDasharray`,`className`,`children`,`numTicks`,`lineStyle`,`offset`,`tickValues`];function l5(){return l5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l5.apply(this,arguments)}function Loe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function u5(e){var t=e.top,n=t===void 0?0:t,r=e.left,i=r===void 0?0:r,a=e.scale,o=e.width,s=e.stroke,c=s===void 0?`#eaf0f6`:s,l=e.strokeWidth,u=l===void 0?1:l,d=e.strokeDasharray,f=e.className,p=e.children,m=e.numTicks,h=m===void 0?10:m,g=e.lineStyle,_=e.offset,v=e.tickValues,y=Loe(e,Ioe),b=v??L6(a,h),x=(_??0)+s5(a)/2,S=b.map(function(e,t){var n=(I6(a(e))??0)+x;return{index:t,from:new T8({x:0,y:n}),to:new T8({x:o,y:n})}});return W.createElement(F6,{className:(0,yW.default)(`visx-rows`,f),top:n,left:i},p?p({lines:S}):S.map(function(e){var t=e.from,n=e.to,r=e.index;return W.createElement(c5.default,l5({key:`row-line-`+r,from:t,to:n,stroke:c,strokeWidth:u,strokeDasharray:d,style:g},y))}))}u5.propTypes={tickValues:j.array,width:j.number.isRequired},M();var Roe=[`top`,`left`,`scale`,`height`,`stroke`,`strokeWidth`,`strokeDasharray`,`className`,`numTicks`,`lineStyle`,`offset`,`tickValues`,`children`];function d5(){return d5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d5.apply(this,arguments)}function zoe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function f5(e){var t=e.top,n=t===void 0?0:t,r=e.left,i=r===void 0?0:r,a=e.scale,o=e.height,s=e.stroke,c=s===void 0?`#eaf0f6`:s,l=e.strokeWidth,u=l===void 0?1:l,d=e.strokeDasharray,f=e.className,p=e.numTicks,m=p===void 0?10:p,h=e.lineStyle,g=e.offset,_=e.tickValues,v=e.children,y=zoe(e,Roe),b=_??L6(a,m),x=(g??0)+s5(a)/2,S=b.map(function(e,t){var n=(I6(a(e))??0)+x;return{index:t,from:new T8({x:n,y:0}),to:new T8({x:n,y:o})}});return W.createElement(F6,{className:(0,yW.default)(`visx-columns`,f),top:n,left:i},v?v({lines:S}):S.map(function(e){var t=e.from,n=e.to,r=e.index;return W.createElement(c5.default,d5({key:`column-line-`+r,from:t,to:n,stroke:c,strokeWidth:u,strokeDasharray:d,style:h},y))}))}f5.propTypes={tickValues:j.array,height:j.number.isRequired},M();var Boe=[`top`,`left`,`xScale`,`yScale`,`width`,`height`,`className`,`stroke`,`strokeWidth`,`strokeDasharray`,`numTicksRows`,`numTicksColumns`,`rowLineStyle`,`columnLineStyle`,`xOffset`,`yOffset`,`rowTickValues`,`columnTickValues`];function p5(){return p5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p5.apply(this,arguments)}function Voe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function m5(e){var t=e.top,n=e.left,r=e.xScale,i=e.yScale,a=e.width,o=e.height,s=e.className,c=e.stroke,l=e.strokeWidth,u=e.strokeDasharray,d=e.numTicksRows,f=e.numTicksColumns,p=e.rowLineStyle,m=e.columnLineStyle,h=e.xOffset,g=e.yOffset,_=e.rowTickValues,v=e.columnTickValues,y=Voe(e,Boe);return W.createElement(F6,{className:(0,yW.default)(`visx-grid`,s),top:t,left:n},W.createElement(u5,p5({className:s,scale:i,width:a,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:d,lineStyle:p,offset:g,tickValues:_},y)),W.createElement(f5,p5({className:s,scale:r,height:o,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:f,lineStyle:m,offset:h,tickValues:v},y)))}m5.propTypes={rowTickValues:j.array,columnTickValues:j.array},M();var Hoe=class extends W.Component{static propTypes={disabled:j.bool,disabledAdditionalGrid:j.bool,graphProps:U2.isRequired};getAdditionalGridProps=(e,t)=>{let{graphProps:{scale:n,size:{width:r,height:i},domain:a,range:o}}=this.props,s=F8({...o,step:o.labelStep}).filter(t=>e.includes(t)),c=F8({...a,step:a.labelStep}).filter(e=>t.includes(e)),l=s.length&&Math.min(...s).toString().replace(/[.-]/g,``).length||1,u=s.length&&Math.max(...s).toString().replace(/[.-]/g,``).length||1,d=Math.max(l,u)*9+22,f=n.x(0),p=n.y(0),m=`${f-d} ${d} ${r}`,h=`${p} 28 ${i}`,g=a.labelStep>0&&o.labelStep>0&&s&&c&&s.length>1&&c.length>1&&(s.length!==e.length||c.length!==t.length),_=c.filter(e=>e>=0||f-n.x(e)>d);return{rowTickLabelValues:s.filter(e=>e>=0||n.y(e)-p>28),columnTickLabelValues:_,rowStrokeDasharray:m,columnStrokeDasharray:h,displayAdditionalGrid:g}};render(){let{graphProps:e}=this.props,{scale:t,size:{height:n,width:r},domain:i,range:a}=e,o=F8(a),s=F8(i),{rowTickLabelValues:c,columnTickLabelValues:l,rowStrokeDasharray:u,columnStrokeDasharray:d,displayAdditionalGrid:f}=this.getAdditionalGridProps(o,s),p=i.labelStep*2===i.step||a.labelStep*2===a.step?`#9FA8DA`:`#7985CB`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(m5,{innerRef:e=>this.grid=e,xScale:t.x,yScale:t.y,width:r,height:n,stroke:`#E1E6EC`,rowTickValues:o,columnTickValues:s}),f&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(u5,{scale:t.y,width:r,tickValues:c,stroke:p,strokeDasharray:u}),(0,G.jsx)(f5,{scale:t.x,height:n,tickValues:l,stroke:p,strokeDasharray:d})]})]})}};M();function h5(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function g5(e,t){return!e||h5(e)?e:h5(e.default)?e.default:t&&h5(e[t])?e[t]:t&&h5(e[t]?.default)?e[t].default:e}var Uoe=g5(jb,`Readable`)||g5(Woe.Readable,`Readable`),_5=ix,v5=_5.default,Woe=v5&&typeof v5==`object`?v5:_5,y5={left:-90,top:0,bottom:0,right:90},Goe=(e,t,n)=>{let r=(e,t,n)=>`translate(${e}, ${t}), rotate(${n})`;if(e===`left`)return r(-20,n/2,y5[e]);if(e===`right`)return r(t+30,n/2,y5[e]);if(e===`top`)return r(t/2,-20,y5[e]);if(e===`bottom`)return r(t/2,n+30,y5[e])},Koe=(e,t)=>{switch(e){case`left`:return-t;case`top`:return-t;case`right`:return-t-10;default:return-t+10}},qoe=J(P2,{shouldForwardProp:e=>![`side`,`disabledLabel`].includes(e)})(({theme:e,side:t,disabledLabel:n})=>({fontSize:e.typography.fontSize-2,textAlign:`center`,padding:`0 4px`,...t===`bottom`&&{marginTop:`44px`},...n&&{pointerEvents:`none`}})),b5=class extends W.Component{static propTypes={text:j.string,side:j.string,disabledLabel:j.bool,placeholder:j.string,graphProps:U2.isRequired,onChange:j.func,mathMlOptions:j.object};static defaultProps={onChange:()=>{}};render(){let{disabledLabel:e,placeholder:t,text:n,side:r,graphProps:i,onChange:a,mathMlOptions:o={}}=this.props,{size:s,domain:c,range:l}=i,u=(s.height||500)+(l.padding||0)*2,d=(s.width||500)+(c.padding||0)*2,f=Goe(r,d,u),p=r===`left`||r===`right`?u:d,m=Koe(r,36),h=r===`bottom`?58:54;return(0,G.jsx)(`foreignObject`,{x:-(p/2),y:m,width:p,height:h,transform:f,textAnchor:`middle`,children:(0,G.jsx)(Uoe,{false:!0,children:(0,G.jsx)(qoe,{side:r,disabledLabel:e,markup:n||``,onChange:a,placeholder:!e&&t,toolbarOpts:{position:r===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},activePlugins:[`bold`,`italic`,`underline`,`strikethrough`,`math`],mathMlOptions:o})})})}},x5={left:j.string,top:j.string,bottom:j.string,right:j.string};(class extends W.Component{static propTypes={className:j.string,disabledLabels:j.bool,placeholders:j.object,value:j.shape(x5),graphProps:j.object,onChange:j.object,mathMlOptions:j.object};static defaultProps={};onChangeLabel=(e,t)=>{let{value:n,onChange:r}=this.props;r({...n,[t]:e})};render(){let{disabledLabels:e,placeholders:t={},value:n={},graphProps:r,mathMlOptions:i={}}=this.props;return(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(b5,{side:`left`,text:n.left,disabledLabel:e,placeholder:t.left,graphProps:r,onChange:e=>this.onChangeLabel(e,`left`),mathMlOptions:i},`left`),(0,G.jsx)(b5,{side:`top`,text:n.top,disabledLabel:e,placeholder:t.top,graphProps:r,onChange:e=>this.onChangeLabel(e,`top`),mathMlOptions:i},`top`),(0,G.jsx)(b5,{side:`bottom`,text:n.bottom,disabledLabel:e,placeholder:t.bottom,graphProps:r,onChange:e=>this.onChangeLabel(e,`bottom`),mathMlOptions:i},`bottom`),(0,G.jsx)(b5,{side:`right`,text:n.right,disabledLabel:e,placeholder:t.right,graphProps:r,onChange:e=>this.onChangeLabel(e,`right`),mathMlOptions:i},`right`)]})}}),M();var Joe=class extends W.Component{static propTypes={width:j.number.isRequired,height:j.number.isRequired,onClick:j.func.isRequired,graphProps:U2.isRequired};static defaultProps={};componentDidMount(){let e=Rh(this.rect);e.on(`click`,t=>this.onRectClick(e,t))}shouldComponentUpdate(e){return!t4(this.props.graphProps,e.graphProps)||this.props.width!==e.width||this.props.height!==e.height}getRectPadding=()=>{let{graphProps:e}=this.props;return U8(e)?6:10};onRectClick=(e,t)=>{let{onClick:n,graphProps:r}=this.props,{scale:i}=r,a=this.getRectPadding(),o=Bh(t,e.node()),s=i.x.invert(o[0]-a),c=i.y.invert(o[1]-a),l=F8(r.range),u=F8(r.domain),d=(e,t)=>e.length&&e.reduce((e,n)=>Math.abs(n-t)<=Math.abs(e-t)?n:e),f={};u.indexOf(s)>=0&&l.indexOf(c)>=0?(f.x=s,f.y=c):(f.x=d(u,s),f.y=d(l,c)),n(f)};render(){let{width:e,height:t}=this.props,n=this.getRectPadding();return(0,G.jsx)(`rect`,{ref:e=>this.rect=e,transform:`translate(-${n}, -${n})`,fill:`red`,fillOpacity:`0.0`,width:e+n*2,height:t+n*2})}};M();var Yoe=ey(`pie-lib:graphing:graph`),S5={axesSettings:j.shape(e5),backgroundMarks:j.array,className:j.string,collapsibleToolbar:j.bool,collapsibleToolbarTitle:j.string,disabledLabels:j.bool,disabledTitle:j.bool,domain:I2,labels:j.shape(x5),labelModeEnabled:j.bool,coordinatesOnHover:j.bool,marks:j.array,onChangeLabels:j.func,onChangeMarks:j.func,onChangeTitle:j.func,range:I2,size:j.shape({width:j.number.isRequired,height:j.number.isRequired}),showLabels:j.bool,showPixelGuides:j.bool,showTitle:j.bool,title:j.string,tools:j.array,limitLabeling:j.bool},Xoe=e=>({x:-23,y:-23,width:e.width+46,height:e.height+46}),Zoe=({marks:e,currentTool:t,onChangeMarks:n,removeIncompleteTool:r})=>{let i=e.filter(e=>e.building)[0],a=Lf(e);if(i&&t&&i.type!==t.type){let e=a.findIndex(e=>mp(e,i));e>=0&&a.splice(e,1)}return r&&!mp(a,e)&&n(a),a},Qoe=class extends W.Component{constructor(e){super(e),this.maskUid=this.generateMaskId()}static propTypes={...S5,currentTool:j.object};static defaultProps={onChangeMarks:()=>{},disabledLabels:!1,disabledTitle:!1};state={};_justDragged=!1;startDrag=()=>{this._justDragged=!1};stopDrag=()=>{this._justDragged=!0,setTimeout(()=>{this._justDragged=!1},300)};generateMaskId(){return`graph-`+(Math.random()*1e4).toFixed()}componentDidMount=()=>this.setState({labelNode:this.labelNode});changeMark=(e,t)=>{let{onChangeMarks:n,marks:r}=this.props,i=Lf(r),a=i.findIndex(t=>mp(t,e));a>=0&&!J8(t,r,e)&&(i.splice(a,1,t),n(i))};completeMark=e=>{let{currentTool:t,marks:n}=this.props,r=n.filter(e=>e.building)[0];if(!r||!t)return;let i=t.complete(r,e);this.updateMarks(r,i)};updateMarks=(e,t,n=!1)=>{let{onChangeMarks:r,marks:i}=this.props,a=Lf(i);if(!t||!t.building&&J8(t,i))return;let o=a.findIndex(t=>mp(t,e));o>=0?(a.splice(o,1,t),r(a)):n&&r([...a,t])};getComponent=e=>{if(!e)return null;let t=(this.props.tools||[]).find(t=>t.type===e.type);return t&&t.Component||null};onBgClick=e=>{let{x:t,y:n}=e||{},{labelModeEnabled:r,currentTool:i,marks:a}=this.props;if(this._justDragged||r||!i||[null,void 0].includes(t)||[null,void 0].includes(n))return;Yoe(`[onBgClick] x,y: `,t,n);let o=a.filter(e=>e.building)[0],s;s=o&&i&&o.type===i.type?i.addPoint({x:t,y:n},{...o}):i.addPoint({x:t,y:n},void 0),this.updateMarks(o,s,!0)};render(){let{axesSettings:e,currentTool:t,coordinatesOnHover:n,size:r,disabledLabels:i,disabledTitle:a,domain:o,backgroundMarks:s,range:c,title:l,labels:u,labelModeEnabled:d,labelsPlaceholders:f,limitLabeling:p,showLabels:m,showPixelGuides:h,showTitle:g,titlePlaceholder:_,onChangeLabels:v,onChangeTitle:y,mathMlOptions:b={},onChangeMarks:x,removeIncompleteTool:S}=this.props,{marks:C}=this.props,w=eae(o,c,r,()=>this.rootNode),T=Xoe(r),E={graphProps:w,labelModeEnabled:d,limitLabeling:p};return C=Zoe({marks:C||[],currentTool:t,onChangeMarks:x,removeIncompleteTool:S}),(0,G.jsx)(N4,{rootRef:e=>this.rootNode=e,disabledTitle:a,disabledLabels:i,labels:u,labelsPlaceholders:f||{},showPixelGuides:h,showLabels:m,showTitle:g,title:l,titlePlaceholder:_,onChangeTitle:y,onChangeLabels:v,mathMlOptions:b,...E,children:(0,G.jsxs)(`g`,{transform:o&&o.padding&&o.range?`translate(${o.padding}, ${c.padding})`:void 0,children:[(0,G.jsx)(Hoe,{...E}),(0,G.jsx)(Poe,{...e,...E}),(0,G.jsx)(Joe,{...r,onClick:this.onBgClick,...E}),(0,G.jsxs)(`mask`,{id:`${this.maskUid}`,children:[(0,G.jsx)(`rect`,{...T,fill:`white`}),` `]}),(0,G.jsxs)(`g`,{id:`marks`,mask:`url('#${this.maskUid}')`,children:[(s||[]).map((e,t)=>{let n=this.getComponent(e),r=e.type;return(0,G.jsx)(n,{mark:{...e,disabled:!0,isBackground:!0},labelNode:this.state.labelNode,onClick:this.onBgClick,...E},`${r}-${t}-bg`)}),C.map((e,r)=>{let i=this.getComponent(e),a=e.type;return(0,G.jsx)(i,{mark:e,coordinatesOnHover:n,onChange:this.changeMark,onComplete:this.completeMark,onClick:this.onBgClick,onDragStart:this.startDrag,onDragStop:this.stopDrag,labelNode:this.state.labelNode,isToolActive:t&&a===t.type,...E},`${a}-${r}`)}),(0,G.jsx)(`foreignObject`,{ref:e=>this.labelNode=e,x:`0`,y:`0`,...r,style:{pointerEvents:`none`,fontSize:`14px`}})]})]})})}},C5=W.createContext(null);M();var w5=function(e){Ng(t,e);function t(t){var n=e.call(this,t)||this,r=t.store;return n.state={storeState:r.getState(),store:r},n}var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this.subscribe()},n.componentWillUnmount=function(){this.unsubscribe&&this.unsubscribe(),this._isMounted=!1},n.componentDidUpdate=function(e){this.props.store!==e.store&&(this.unsubscribe&&this.unsubscribe(),this.subscribe())},n.subscribe=function(){var e=this,t=this.props.store;this.unsubscribe=t.subscribe(function(){var n=t.getState();e._isMounted&&e.setState(function(e){return e.storeState===n?null:{storeState:n}})});var n=t.getState();n!==this.state.storeState&&this.setState({storeState:n})},n.render=function(){var e=this.props.context||C5;return W.createElement(e.Provider,{value:this.state},this.props.children)},t}(W.Component);w5.propTypes={store:j.shape({subscribe:j.func.isRequired,dispatch:j.func.isRequired,getState:j.func.isRequired}),context:j.object,children:j.any};var $oe=ct();function ese(e,t){t===void 0&&(t={});var n=t,r=n.getDisplayName,i=r===void 0?function(e){return`ConnectAdvanced(`+e+`)`}:r,a=n.methodName,o=a===void 0?`connectAdvanced`:a,s=n.renderCountProp,c=s===void 0?void 0:s,l=n.shouldHandleStateChanges,u=l===void 0?!0:l,d=n.storeKey,f=d===void 0?`store`:d,p=n.withRef,m=p===void 0?!1:p,h=n.forwardRef,g=h===void 0?!1:h,_=n.context,v=_===void 0?C5:_,y=jg(n,[`getDisplayName`,`methodName`,`renderCountProp`,`shouldHandleStateChanges`,`storeKey`,`withRef`,`forwardRef`,`context`]);(0,q2.default)(c===void 0,`renderCountProp is removed. render counting is built into the latest React dev tools profiling extension`),(0,q2.default)(!m,`withRef is removed. To access the wrapped instance, use a ref on the connected component`);var b=`To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a {context : MyContext} option to connect`;(0,q2.default)(f===`store`,`storeKey has been removed and does not do anything. `+b);var x=v;return function(t){var n=t.displayName||t.name||`Component`,r=i(n),a=F({},y,{getDisplayName:i,methodName:o,renderCountProp:c,shouldHandleStateChanges:u,storeKey:f,displayName:r,wrappedComponentName:n,WrappedComponent:t}),s=y.pure,l=W.Component;s&&(l=W.PureComponent);function d(){var t,n,r,i,a,o;return function(c,l,u,d){return s&&t===l&&n===c?r:((u!==i||a!==d)&&(i=u,a=d,o=e(u.dispatch,d)),t=l,n=c,r=o(c,l),r)}}function p(){var e,t,n,r;return function(i,a,o){return(a!==e||o!==t||r!==i)&&(e=a,t=o,r=i,n=W.createElement(i,F({},a,{ref:o}))),n}}var m=function(e){Ng(n,e);function n(t){var n=e.call(this,t)||this;return(0,q2.default)(g?!t.wrapperProps[f]:!t[f],`Passing redux store in props has been removed and does not do anything. `+b),n.selectDerivedProps=d(),n.selectChildElement=p(),n.indirectRenderWrappedComponent=n.indirectRenderWrappedComponent.bind(Zg(n)),n}var i=n.prototype;return i.indirectRenderWrappedComponent=function(e){return this.renderWrappedComponent(e)},i.renderWrappedComponent=function(e){(0,q2.default)(e,`Could not find "store" in the context of `+(`"`+r+`". Either wrap the root component in a <Provider>, `)+`or pass a custom React context provider to <Provider> and the corresponding `+(`React context consumer to `+r+` in connect options.`));var n=e.storeState,i=e.store,o=this.props,s;g&&(o=this.props.wrapperProps,s=this.props.forwardedRef);var c=this.selectDerivedProps(n,o,i,a);return this.selectChildElement(t,c,s)},i.render=function(){var e=this.props.context&&this.props.context.Consumer&&(0,$oe.isContextConsumer)(W.createElement(this.props.context.Consumer,null))?this.props.context:x;return W.createElement(e.Consumer,null,this.indirectRenderWrappedComponent)},n}(l);if(m.WrappedComponent=t,m.displayName=r,g){var h=W.forwardRef(function(e,t){return W.createElement(m,{wrapperProps:e,forwardedRef:t})});return h.displayName=r,h.WrappedComponent=t,(0,Ht.default)(h,t)}return(0,Ht.default)(m,t)}}var tse=Object.prototype.hasOwnProperty;function T5(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function E5(e,t){if(T5(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!tse.call(t,n[i])||!T5(e[n[i]],t[n[i]]))return!1;return!0}function D5(e){"@babel/helpers - typeof";return D5=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},D5(e)}function nse(e,t){if(D5(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(D5(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function rse(e){var t=nse(e,`string`);return D5(t)==`symbol`?t:t+``}function ise(e,t,n){return(t=rse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?O5(Object(n),!0).forEach(function(t){ise(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A5(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var j5=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),M5=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},N5={INIT:`@@redux/INIT`+M5(),REPLACE:`@@redux/REPLACE`+M5(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+M5()}};function ase(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function P5(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(A5(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(A5(1));return n(P5)(e,t)}if(typeof e!=`function`)throw Error(A5(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(A5(3));return a}function d(e){if(typeof e!=`function`)throw Error(A5(4));if(c)throw Error(A5(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(A5(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!ase(e))throw Error(A5(7));if(e.type===void 0)throw Error(A5(8));if(c)throw Error(A5(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;n<t.length;n++){var r=t[n];r()}return e}function p(e){if(typeof e!=`function`)throw Error(A5(10));i=e,f({type:N5.REPLACE})}function m(){var e,t=d;return e={subscribe:function(e){if(typeof e!=`object`||!e)throw Error(A5(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}},e[j5]=function(){return this},e}return f({type:N5.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[j5]=m,r}function ose(e){Object.keys(e).forEach(function(t){var n=e[t];if(n(void 0,{type:N5.INIT})===void 0)throw Error(A5(12));if(n(void 0,{type:N5.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(A5(13))})}function sse(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}var a=Object.keys(n),o;try{ose(n)}catch(e){o=e}return function(e,t){if(e===void 0&&(e={}),o)throw o;for(var r=!1,i={},s=0;s<a.length;s++){var c=a[s],l=n[c],u=e[c],d=l(u,t);if(d===void 0)throw t&&t.type,Error(A5(14));i[c]=d,r||=d!==u}return r||=a.length!==Object.keys(e).length,r?i:e}}function F5(e,t){return function(){return t(e.apply(this,arguments))}}function cse(e,t){if(typeof e==`function`)return F5(e,t);if(typeof e!=`object`||!e)throw Error(A5(16));var n={};for(var r in e){var i=e[r];typeof i==`function`&&(n[r]=F5(i,t))}return n}function lse(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function use(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw Error(A5(15))},i={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},a=t.map(function(e){return e(i)});return r=lse.apply(void 0,a)(n.dispatch),k5(k5({},n),{},{dispatch:r})}}}function I5(e){return function(t,n){var r=e(t,n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function L5(e){return e.dependsOnOwnProps!==null&&e.dependsOnOwnProps!==void 0?!!e.dependsOnOwnProps:e.length!==1}function R5(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=L5(e);var i=r(t,n);return typeof i==`function`&&(r.mapToProps=i,r.dependsOnOwnProps=L5(i),i=r(t,n)),i},r}}function dse(e){return typeof e==`function`?R5(e,`mapDispatchToProps`):void 0}function fse(e){return e?void 0:I5(function(e){return{dispatch:e}})}function pse(e){return e&&typeof e==`object`?I5(function(t){return cse(e,t)}):void 0}var mse=[dse,fse,pse];function hse(e){return typeof e==`function`?R5(e,`mapStateToProps`):void 0}function gse(e){return e?void 0:I5(function(){return{}})}var _se=[hse,gse];function vse(e,t,n){return F({},n,e,t)}function yse(e){return function(t,n){n.displayName;var r=n.pure,i=n.areMergedPropsEqual,a=!1,o;return function(t,n,s){var c=e(t,n,s);return a?(!r||!i(c,o))&&(o=c):(a=!0,o=c),o}}}function bse(e){return typeof e==`function`?yse(e):void 0}function xse(e){return e?void 0:function(){return vse}}var Sse=[bse,xse];function Cse(e,t,n,r){return function(i,a){return n(e(i,a),t(r,a),a)}}function wse(e,t,n,r,i){var a=i.areStatesEqual,o=i.areOwnPropsEqual,s=i.areStatePropsEqual,c=!1,l,u,d,f,p;function m(i,a){return l=i,u=a,d=e(l,u),f=t(r,u),p=n(d,f,u),c=!0,p}function h(){return d=e(l,u),t.dependsOnOwnProps&&(f=t(r,u)),p=n(d,f,u),p}function g(){return e.dependsOnOwnProps&&(d=e(l,u)),t.dependsOnOwnProps&&(f=t(r,u)),p=n(d,f,u),p}function _(){var t=e(l,u),r=!s(t,d);return d=t,r&&(p=n(d,f,u)),p}function v(e,t){var n=!o(t,u),r=!a(e,l);return l=e,u=t,n&&r?h():n?g():r?_():p}return function(e,t){return c?v(e,t):m(e,t)}}function Tse(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,a=jg(t,[`initMapStateToProps`,`initMapDispatchToProps`,`initMergeProps`]),o=n(e,a),s=r(e,a),c=i(e,a);return(a.pure?wse:Cse)(o,s,c,e,a)}function z5(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw Error(`Invalid value of type `+typeof e+` for `+n+` argument when connecting component `+r.wrappedComponentName+`.`)}}function Ese(e,t){return e===t}function Dse(e){var t=e===void 0?{}:e,n=t.connectHOC,r=n===void 0?ese:n,i=t.mapStateToPropsFactories,a=i===void 0?_se:i,o=t.mapDispatchToPropsFactories,s=o===void 0?mse:o,c=t.mergePropsFactories,l=c===void 0?Sse:c,u=t.selectorFactory,d=u===void 0?Tse:u;return function(e,t,n,i){i===void 0&&(i={});var o=i,c=o.pure,u=c===void 0?!0:c,f=o.areStatesEqual,p=f===void 0?Ese:f,m=o.areOwnPropsEqual,h=m===void 0?E5:m,g=o.areStatePropsEqual,_=g===void 0?E5:g,v=o.areMergedPropsEqual,y=v===void 0?E5:v,b=jg(o,[`pure`,`areStatesEqual`,`areOwnPropsEqual`,`areStatePropsEqual`,`areMergedPropsEqual`]),x=z5(e,a,`mapStateToProps`),S=z5(t,s,`mapDispatchToProps`),C=z5(n,l,`mergeProps`);return r(d,F({methodName:`connect`,getDisplayName:function(e){return`Connect(`+e+`)`},shouldHandleStateChanges:!!e,initMapStateToProps:x,initMapDispatchToProps:S,initMergeProps:C,pure:u,areStatesEqual:p,areOwnPropsEqual:h,areStatePropsEqual:_,areMergedPropsEqual:y},b))}}var Ose=Dse(),kse=(e=[],t)=>{switch(t.type){case`CHANGE_MARKS`:if(Array.isArray(t.marks))return t.marks;throw Error(`marks must be an array`);default:return e}},B5={UNDO:`@@redux-undo/UNDO`,REDO:`@@redux-undo/REDO`,JUMP_TO_FUTURE:`@@redux-undo/JUMP_TO_FUTURE`,JUMP_TO_PAST:`@@redux-undo/JUMP_TO_PAST`,JUMP:`@@redux-undo/JUMP`,CLEAR_HISTORY:`@@redux-undo/CLEAR_HISTORY`},V5={undo(){return{type:B5.UNDO}},redo(){return{type:B5.REDO}},jumpToFuture(e){return{type:B5.JUMP_TO_FUTURE,index:e}},jumpToPast(e){return{type:B5.JUMP_TO_PAST,index:e}},jump(e){return{type:B5.JUMP,index:e}},clearHistory(){return{type:B5.CLEAR_HISTORY}}};function H5(e,t=[]){return Array.isArray(e)?e:typeof e==`string`?[e]:t}function Ase(e){return typeof e.present<`u`&&typeof e.future<`u`&&typeof e.past<`u`&&Array.isArray(e.future)&&Array.isArray(e.past)}function U5(e,t,n,r=null){return{past:e,present:t,future:n,group:r,_latestUnfiltered:t,index:e.length,limit:e.length+n.length+1}}var W5,G5,K5={prevState:`#9E9E9E`,action:`#03A9F4`,nextState:`#4CAF50`};function jse(){G5={header:[],prev:[],action:[],next:[],msgs:[]}}function Mse(){let{header:e,prev:t,next:n,action:r,msgs:i}=G5;console.group?(console.groupCollapsed(...e),console.log(...t),console.log(...r),console.log(...n),console.log(...i),console.groupEnd()):(console.log(...e),console.log(...t),console.log(...r),console.log(...n),console.log(...i))}function q5(e,t,n){return[`%c${e}`,`color: ${t}; font-weight: bold`,n]}function Nse(e,t){jse(),W5&&(console.group?(G5.header=[`%credux-undo`,`font-style: italic`,`action`,e.type],G5.action=q5(`action`,K5.action,e),G5.prev=q5(`prev history`,K5.prevState,t)):(G5.header=[`redux-undo action`,e.type],G5.action=[`action`,e],G5.prev=[`prev history`,t]))}function J5(e){W5&&(console.group?G5.next=q5(`next history`,K5.nextState,e):G5.next=[`next history`,e],Mse())}function Y5(...e){W5&&(G5.msgs=G5.msgs.concat([...e,`
373
- `]))}function Pse(e){W5=e}function X5(e,t){let n=U5([],e,[]);return t&&(n._latestUnfiltered=null),n}function Fse(e,t,n,r){let i=e.past.length+1;Y5(`inserting`,t),Y5(`new free: `,n-i);let{past:a,_latestUnfiltered:o}=e,s=n&&n<=i,c=a.slice(+!!s);return U5(o==null?c:[...c,o],t,[],r)}function Z5(e,t){if(t<0||t>=e.future.length)return e;let{past:n,future:r,_latestUnfiltered:i}=e,a=[...n,i,...r.slice(0,t)],o=r[t];return U5(a,o,r.slice(t+1))}function Q5(e,t){if(t<0||t>=e.past.length)return e;let{past:n,future:r,_latestUnfiltered:i}=e,a=n.slice(0,t),o=[...n.slice(t+1),i,...r],s=n[t];return U5(a,s,o)}function $5(e,t){return t>0?Z5(e,t-1):t<0?Q5(e,e.past.length+t):e}function Ise(e,t){return t.indexOf(e)>-1?e:!e}function Lse(e,t={}){Pse(t.debug);let n={limit:void 0,filter:()=>!0,groupBy:()=>null,undoType:B5.UNDO,redoType:B5.REDO,jumpToPastType:B5.JUMP_TO_PAST,jumpToFutureType:B5.JUMP_TO_FUTURE,jumpType:B5.JUMP,neverSkipReducer:!1,ignoreInitialState:!1,syncFilter:!1,...t,initTypes:H5(t.initTypes,[`@@redux-undo/INIT`]),clearHistoryType:H5(t.clearHistoryType,[B5.CLEAR_HISTORY])},r=n.neverSkipReducer?(t,n,...r)=>({...t,present:e(t.present,n,...r)}):e=>e,i;return(t=i,a={},...o)=>{Nse(a,t);let s=t;if(!i){if(Y5(`history is uninitialized`),t===void 0)return s=X5(e(t,{type:`@@redux-undo/CREATE_HISTORY`},...o),n.ignoreInitialState),Y5(`do not set initialState on probe actions`),J5(s),s;Ase(t)?(s=i=n.ignoreInitialState?t:U5(t.past,t.present,t.future),Y5(`initialHistory initialized: initialState is a history`,i)):(s=i=X5(t,n.ignoreInitialState),Y5(`initialHistory initialized: initialState is not a history`,i))}let c;switch(a.type){case void 0:return s;case n.undoType:return c=$5(s,-1),Y5(`perform undo`),J5(c),r(c,a,...o);case n.redoType:return c=$5(s,1),Y5(`perform redo`),J5(c),r(c,a,...o);case n.jumpToPastType:return c=Q5(s,a.index),Y5(`perform jumpToPast to ${a.index}`),J5(c),r(c,a,...o);case n.jumpToFutureType:return c=Z5(s,a.index),Y5(`perform jumpToFuture to ${a.index}`),J5(c),r(c,a,...o);case n.jumpType:return c=$5(s,a.index),Y5(`perform jump to ${a.index}`),J5(c),r(c,a,...o);case Ise(a.type,n.clearHistoryType):return c=X5(s.present,n.ignoreInitialState),Y5(`perform clearHistory`),J5(c),r(c,a,...o);default:if(c=e(s.present,a,...o),n.initTypes.some(e=>e===a.type))return Y5(`reset history due to init action`),J5(i),i;if(s._latestUnfiltered===c)return s;if(typeof n.filter==`function`&&!n.filter(a,c,s)){let e=U5(s.past,c,s.future,s.group);return n.syncFilter||(e._latestUnfiltered=s._latestUnfiltered),Y5(`filter ignored action, not storing it in past`),J5(e),e}let t=n.groupBy(a,c,s);if(t!=null&&t===s.group){let e=U5(s.past,c,s.future,s.group);return Y5(`groupBy grouped the action with the previous action`),J5(e),e}return s=Fse(s,c,n.limit,t),Y5(`inserted new state into history`),J5(s),s}}}var Rse=()=>sse({marks:Lse(kse,{debug:!1})}),e7=e=>({type:`CHANGE_MARKS`,marks:e});M();var zse=J(aY)(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize,borderRadius:`8px`,background:e.palette.common.white,color:X.PRIMARY_DARK,"& .MuiInputBase-input":{padding:0}})),Bse=(e,t,n,r)=>{let{scale:i,domain:a,range:o}=e,s=n===o.min?16:n===o.max?0:8;return i.x(t)+r+10>=i.x(a.max)?{left:i.x(t)-10-r,top:i.y(n)-s}:{left:i.x(t)+10,top:i.y(n)-s}},t7=({x:e,y:t,graphProps:n})=>{let r=`(${z8(e)}, ${z8(t)})`,i=(r.length||0)*6;return(0,G.jsx)(zse,{style:{position:`absolute`,pointerEvents:`auto`,width:i,padding:0,...Bse(n,e,t,i)},value:r,inputProps:{ariaLabel:`naked`}})};t7.propTypes={graphProps:U2,x:j.number,y:j.number},M();var n7=({scale:e,x:t,y:n})=>(0,G.jsx)(`svg`,{width:`9`,height:`10`,viewBox:`0 0 9 10`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,x:e.x(t)-4.5,y:e.y(n)-5,style:{pointerEvents:`none`},children:(0,G.jsx)(`path`,{d:`M0.125 3.76562V1.34375C0.125 1.08984 0.320312 0.875 0.59375 0.875H3.01562C3.13281 0.875 3.25 0.992188 3.25 1.10938V1.89062C3.25 2.02734 3.13281 2.125 3.01562 2.125H1.375V3.76562C1.375 3.90234 1.25781 4 1.14062 4H0.359375C0.222656 4 0.125 3.90234 0.125 3.76562ZM5.75 1.10938C5.75 0.992188 5.84766 0.875 5.98438 0.875H8.40625C8.66016 0.875 8.875 1.08984 8.875 1.34375V3.76562C8.875 3.90234 8.75781 4 8.64062 4H7.85938C7.72266 4 7.625 3.90234 7.625 3.76562V2.125H5.98438C5.84766 2.125 5.75 2.02734 5.75 1.89062V1.10938ZM8.64062 6.5C8.75781 6.5 8.875 6.61719 8.875 6.73438V9.15625C8.875 9.42969 8.66016 9.625 8.40625 9.625H5.98438C5.84766 9.625 5.75 9.52734 5.75 9.39062V8.60938C5.75 8.49219 5.84766 8.375 5.98438 8.375H7.625V6.73438C7.625 6.61719 7.72266 6.5 7.85938 6.5H8.64062ZM3.25 9.39062C3.25 9.52734 3.13281 9.625 3.01562 9.625H0.59375C0.320312 9.625 0.125 9.42969 0.125 9.15625V6.73438C0.125 6.61719 0.222656 6.5 0.359375 6.5H1.14062C1.25781 6.5 1.375 6.61719 1.375 6.73438V8.375H3.01562C3.13281 8.375 3.25 8.49219 3.25 8.60938V9.39062Z`,fill:`white`})});n7.propTypes={scale:j.shape({x:j.func,y:j.func}),x:j.number,y:j.number},M();var r7=({scale:e,x:t,y:n})=>(0,G.jsx)(`svg`,{width:`11`,height:`13`,viewBox:`0 0 14 14`,fill:`none`,stroke:`#ffffff`,x:e.x(t)-5,y:e.y(n)-6,style:{pointerEvents:`none`},xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M10.1953 2.46875C10.3125 2.35156 10.5 2.35156 10.5938 2.46875L11.2734 3.125C11.3672 3.24219 11.3672 3.42969 11.2734 3.52344L4.24219 10.5547C4.125 10.6719 3.96094 10.6719 3.84375 10.5547L0.703125 7.4375C0.609375 7.32031 0.609375 7.13281 0.703125 7.03906L1.38281 6.35938C1.47656 6.26562 1.66406 6.26562 1.78125 6.35938L4.03125 8.63281L10.1953 2.46875Z`,fill:`white`})});r7.propTypes={scale:j.shape({x:j.func,y:j.func}),x:j.number,y:j.number},M();var i7=({scale:e,x:t,y:n})=>(0,G.jsx)(`svg`,{width:`14px`,height:`14px`,viewBox:`0 0 24 24`,fill:`none`,stroke:`#ffffff`,strokeWidth:`2`,x:e.x(t)-7,y:e.y(n)-7,style:{pointerEvents:`none`},xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z`})});i7.propTypes={scale:j.shape({x:j.func,y:j.func}),x:j.number,y:j.number};var a7=()=>Yv.SHAPES_FILL_COLOR,o7=(e=`fill`)=>({[e]:ov(),pointerEvents:`none`}),s7=(e=`fill`)=>({[e]:ov(),pointerEvents:`none`}),c7=(e=`fill`)=>({[e]:uv(),pointerEvents:`none`}),l7=(e=`fill`)=>({[e]:fv(),pointerEvents:`none`}),u7=(e=`fill`)=>({[e]:hv(),pointerEvents:`none`});M();var Vse=J(`g`)(({disabled:e,correctness:t})=>({cursor:`pointer`,"& circle":{fill:`currentColor`},...e&&{...o7(`fill`),...o7(`color`)},...t===`correct`&&{...c7(`fill`),...c7(`color`)},...t===`incorrect`&&{...l7(`fill`),...l7(`color`)},...t===`missing`&&{...u7(`fill`),...u7(`color`)}})),Hse=class extends W.Component{static propTypes={className:j.string,coordinatesOnHover:j.bool,correctness:j.string,disabled:j.bool,labelNode:j.object,x:j.number.isRequired,y:j.number.isRequired,graphProps:U2.isRequired,onClick:j.func,onTouchStart:j.func,onTouchEnd:j.func};state={showCoordinates:!1};render(){let{className:e,coordinatesOnHover:t,x:n,y:r,disabled:i,correctness:a,graphProps:o,labelNode:s,onClick:c,onTouchStart:l,onTouchEnd:u}=this.props,{showCoordinates:d}=this.state,{scale:f}=o,p=U8(o)?5:7,m;switch(a){case`missing`:m=n7;break;case`correct`:m=r7;break;case`incorrect`:m=i7;break;default:m=null}return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`circle`,{style:{fill:`transparent`,cursor:`pointer`,pointerEvents:`all`},r:p*3,cx:f.x(n),cy:f.y(r),onMouseEnter:()=>this.setState({showCoordinates:!0}),onMouseLeave:()=>this.setState({showCoordinates:!1}),onTouchStart:l,onTouchEnd:u,onClick:c}),(0,G.jsxs)(Vse,{className:e,disabled:i,correctness:a,onMouseEnter:()=>this.setState({showCoordinates:!0}),onMouseLeave:()=>this.setState({showCoordinates:!1}),children:[(0,G.jsx)(`circle`,{r:p,cx:f.x(n),cy:f.y(r)}),m&&(0,G.jsx)(m,{scale:f,x:n,y:r}),s&&t&&d&&Vg.createPortal((0,G.jsx)(t7,{graphProps:o,x:n,y:r}),s)]})]})}};M();var Use=class extends W.Component{static propTypes={className:j.string,correctness:j.string,disabled:j.bool,x:j.number.isRequired,y:j.number.isRequired,from:j.shape({x:j.number,y:j.number}).isRequired,to:j.shape({x:j.number,y:j.number}),graphProps:U2.isRequired};static defaultProps={from:{},to:{}};render(){let{className:e,x:t,y:n,graphProps:r,from:i,to:a,...o}=this.props,{scale:s}=r,c=i&&a?Soe(i.x,i.y,a.x,a.y):0,l=i&&a&&(i.x!==a.x||i.y!==a.y)?`0,0 ${P8.vector},${P8.vector*2} -${P8.vector},${P8.vector*2}`:`0,0 0,0 0,0`;return(0,G.jsx)(`g`,{className:e,...o,children:(0,G.jsx)(`polygon`,{points:l,transform:`translate(${s.x(t)}, ${s.y(n)}) rotate(${c} 0 0)`})})}};M();var Wse=J(`polygon`)(({disabled:e,correctness:t})=>({fill:X.BLACK,...e&&{fill:ov()},...t===`correct`&&{fill:uv()},...t===`incorrect`&&{fill:fv()},...t===`missing`&&{fill:hv()}})),Gse=J(`marker`)(({disabled:e,correctness:t})=>({"& polygon":{fill:X.BLACK,...e&&{fill:ov()},...t===`correct`&&{fill:uv()},...t===`incorrect`&&{fill:fv()},...t===`missing`&&{fill:hv()}}})),d7=({size:e,transform:t,points:n,disabled:r,correctness:i})=>(0,G.jsx)(Wse,{points:n||`0,0 ${e},${e/2} 0,${e}`,transform:t,disabled:r,correctness:i});d7.propTypes={points:j.string,size:j.number,transform:j.string,disabled:j.bool,correctness:j.string},d7.defaultProps={points:``,size:10,transform:``};var f7=()=>`arrow-${(Math.random()*1e3).toFixed(0)}`,p7=({id:e,size:t,className:n,disabled:r,correctness:i})=>{let a=r||n?.includes(`disabled`),o=i||(n?.includes(`incorrect`)?`incorrect`:n?.includes(`correct`)?`correct`:n?.includes(`missing`)?`missing`:null);return(0,G.jsx)(Gse,{id:e,viewBox:`0 0 ${t} ${t}`,refX:t/2,refY:t/2,markerWidth:t,markerHeight:t,orient:`auto-start-reverse`,disabled:a,correctness:o,children:(0,G.jsx)(d7,{size:t,disabled:a,correctness:o})})};p7.propTypes={id:j.string,size:j.number,className:j.string,disabled:j.bool,correctness:j.string},p7.defaultProps={size:5},M();var Kse=class extends W.Component{static propTypes={className:j.string,correctness:j.string,disabled:j.bool,x:j.number.isRequired,y:j.number.isRequired,angle:j.number.isRequired,graphProps:U2.isRequired};render(){let{className:e,angle:t,x:n,y:r,correctness:i,graphProps:a,...o}=this.props,s=U8(a)?12:14,{scale:c}=a,l=c.x(n),u=c.y(r),d=`rotate(${-t}, ${l},${u})`,f=`${l},${u}
374
- ${l-s},${u-s/2}
375
- ${l-s},${u+s/2}`;return(0,G.jsx)(`g`,{className:e,...o,children:(0,G.jsx)(d7,{size:s,transform:d,points:f,correctness:i})})}},m7={bounds:(e,{domain:t,range:n})=>{let{x:r,y:i}=e;return M8({left:r,top:i,bottom:i,right:r},t,n)},anchorPoint:e=>{let{x:t,y:n}=e;return{x:t,y:n}},fromDelta:(e,t)=>N8(e).add(N8(t))},h7=J(`g`)(()=>({"& circle, & polygon":{cursor:`pointer`},"&[disabled]":{"& circle, & polygon":{fill:ov()}}})),g7=L4(m7)(e=>(0,G.jsx)(h7,{...e,children:(0,G.jsx)(Hse,{...e})}));L4(m7)(e=>(0,G.jsx)(h7,{...e,children:(0,G.jsx)(Use,{...e})}));var qse=L4(m7)(e=>(0,G.jsx)(h7,{...e,children:(0,G.jsx)(Kse,{...e})}));M();var _7={mark:j.any,onChange:j.func,onDragStart:j.func,onDragStop:j.func};j.shape(_7);var Jse=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=p(),i=o(r),a=o((M(),d(k)));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function l(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f={position:`absolute`,top:0,left:0,visibility:`hidden`,height:0,overflow:`scroll`,whiteSpace:`pre`},m=[`extraWidth`,`injectStyles`,`inputClassName`,`inputRef`,`inputStyle`,`minWidth`,`onAutosize`,`placeholderIsMinWidth`],h=function(e){return m.forEach(function(t){return delete e[t]}),e},g=function(e,t){t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,t.style.fontWeight=e.fontWeight,t.style.fontStyle=e.fontStyle,t.style.letterSpacing=e.letterSpacing,t.style.textTransform=e.textTransform},_=typeof window<`u`&&window.navigator?/MSIE |Trident\/|Edge\//.test(window.navigator.userAgent):!1,v=function(){return _?`_`+Math.random().toString(36).substr(2,12):void 0},y=function(e){u(r,e);function r(e){c(this,r);var t=l(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.inputRef=function(e){t.input=e,typeof t.props.inputRef==`function`&&t.props.inputRef(e)},t.placeHolderSizerRef=function(e){t.placeHolderSizer=e},t.sizerRef=function(e){t.sizer=e},t.state={inputWidth:e.minWidth,inputId:e.id||v()},t}return n(r,[{key:`componentDidMount`,value:function(){this.mounted=!0,this.copyInputStyles(),this.updateInputWidth()}},{key:`UNSAFE_componentWillReceiveProps`,value:function(e){var t=e.id;t!==this.props.id&&this.setState({inputId:t||v()})}},{key:`componentDidUpdate`,value:function(e,t){t.inputWidth!==this.state.inputWidth&&typeof this.props.onAutosize==`function`&&this.props.onAutosize(this.state.inputWidth),this.updateInputWidth()}},{key:`componentWillUnmount`,value:function(){this.mounted=!1}},{key:`copyInputStyles`,value:function(){if(!(!this.mounted||!window.getComputedStyle)){var e=this.input&&window.getComputedStyle(this.input);e&&(g(e,this.sizer),this.placeHolderSizer&&g(e,this.placeHolderSizer))}}},{key:`updateInputWidth`,value:function(){if(!(!this.mounted||!this.sizer||this.sizer.scrollWidth===void 0)){var e=void 0;e=this.props.placeholder&&(!this.props.value||this.props.value&&this.props.placeholderIsMinWidth)?Math.max(this.sizer.scrollWidth,this.placeHolderSizer.scrollWidth)+2:this.sizer.scrollWidth+2;var t=this.props.type===`number`&&this.props.extraWidth===void 0?16:parseInt(this.props.extraWidth)||0;e+=t,e<this.props.minWidth&&(e=this.props.minWidth),e!==this.state.inputWidth&&this.setState({inputWidth:e})}}},{key:`getInput`,value:function(){return this.input}},{key:`focus`,value:function(){this.input.focus()}},{key:`blur`,value:function(){this.input.blur()}},{key:`select`,value:function(){this.input.select()}},{key:`renderStyles`,value:function(){var e=this.props.injectStyles;return _&&e?i.default.createElement(`style`,{dangerouslySetInnerHTML:{__html:`input#`+this.state.inputId+`::-ms-clear {display: none;}`}}):null}},{key:`render`,value:function(){var e=[this.props.defaultValue,this.props.value,``].reduce(function(e,t){return e??t}),n=t({},this.props.style);n.display||=`inline-block`;var r=t({boxSizing:`content-box`,width:this.state.inputWidth+`px`},this.props.inputStyle),a=s(this.props,[]);return h(a),a.className=this.props.inputClassName,a.id=this.state.inputId,a.style=r,i.default.createElement(`div`,{className:this.props.className,style:n},this.renderStyles(),i.default.createElement(`input`,t({},a,{ref:this.inputRef})),i.default.createElement(`div`,{ref:this.sizerRef,style:f},e),this.props.placeholder?i.default.createElement(`div`,{ref:this.placeHolderSizerRef,style:f},this.props.placeholder):null)}}]),r}(r.Component);y.propTypes={className:a.default.string,defaultValue:a.default.any,extraWidth:a.default.oneOfType([a.default.number,a.default.string]),id:a.default.string,injectStyles:a.default.bool,inputClassName:a.default.string,inputRef:a.default.func,inputStyle:a.default.object,minWidth:a.default.oneOfType([a.default.number,a.default.string]),onAutosize:a.default.func,onChange:a.default.func,placeholder:a.default.string,placeholderIsMinWidth:a.default.bool,style:a.default.object,value:a.default.any},y.defaultProps={minWidth:1,injectStyles:!0},e.default=y})),Yse=(e,t)=>{let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e]),n};M();var v7=({type:e})=>({correct:(0,G.jsx)(`svg`,{width:`8`,height:`6`,viewBox:`0 0 8 6`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M6.79688 0.306152C6.875 0.228027 7 0.228027 7.0625 0.306152L7.51562 0.743652C7.57812 0.821777 7.57812 0.946777 7.51562 1.00928L2.82812 5.69678C2.75 5.7749 2.64062 5.7749 2.5625 5.69678L0.46875 3.61865C0.40625 3.54053 0.40625 3.41553 0.46875 3.35303L0.921875 2.8999C0.984375 2.8374 1.10938 2.8374 1.1875 2.8999L2.6875 4.41553L6.79688 0.306152Z`,fill:`#0B7D38`})}),incorrect:(0,G.jsx)(`svg`,{width:`7`,height:`7`,viewBox:`0 0 7 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M4.23438 3.21045L5.92188 4.89795C6.01562 4.9917 6.01562 5.16357 5.92188 5.25732L5.53125 5.64795C5.4375 5.7417 5.26562 5.7417 5.17188 5.64795L3.5 3.96045L1.8125 5.64795C1.71875 5.7417 1.54688 5.7417 1.45312 5.64795L1.0625 5.25732C0.96875 5.16357 0.96875 4.9917 1.0625 4.89795L2.75 3.21045L1.0625 1.53857C0.96875 1.44482 0.96875 1.27295 1.0625 1.1792L1.45312 0.788574C1.54688 0.694824 1.71875 0.694824 1.8125 0.788574L3.5 2.47607L5.17188 0.788574C5.26562 0.694824 5.4375 0.694824 5.53125 0.788574L5.92188 1.1792C6.01562 1.27295 6.01562 1.44482 5.92188 1.53857L4.23438 3.21045Z`,fill:`#BF0D00`})}),empty:(0,G.jsx)(`svg`,{width:`11`,height:`12`,viewBox:`0 0 11 12`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M0.25 4.13965V1.2334C0.25 0.928711 0.484375 0.670898 0.8125 0.670898H3.71875C3.85938 0.670898 4 0.811523 4 0.952148V1.51465C4 1.67871 3.85938 1.7959 3.71875 1.7959H1.375V4.13965C1.375 4.30371 1.23438 4.4209 1.09375 4.4209H0.53125C0.367188 4.4209 0.25 4.30371 0.25 4.13965ZM7 0.952148C7 0.811523 7.11719 0.670898 7.28125 0.670898H10.1875C10.4922 0.670898 10.75 0.928711 10.75 1.2334V4.13965C10.75 4.30371 10.6094 4.4209 10.4688 4.4209H9.90625C9.74219 4.4209 9.625 4.30371 9.625 4.13965V1.7959H7.28125C7.11719 1.7959 7 1.67871 7 1.51465V0.952148ZM10.4688 7.4209C10.6094 7.4209 10.75 7.56152 10.75 7.70215V10.6084C10.75 10.9365 10.4922 11.1709 10.1875 11.1709H7.28125C7.11719 11.1709 7 11.0537 7 10.8896V10.3271C7 10.1865 7.11719 10.0459 7.28125 10.0459H9.625V7.70215C9.625 7.56152 9.74219 7.4209 9.90625 7.4209H10.4688ZM4 10.8896C4 11.0537 3.85938 11.1709 3.71875 11.1709H0.8125C0.484375 11.1709 0.25 10.9365 0.25 10.6084V7.70215C0.25 7.56152 0.367188 7.4209 0.53125 7.4209H1.09375C1.23438 7.4209 1.375 7.56152 1.375 7.70215V10.0459H3.71875C3.85938 10.0459 4 10.1865 4 10.3271V10.8896Z`,fill:`#BF0D00`})})})[e]||null;v7.propTypes={type:j.string.isRequired},M();var y7=u(Jse(),1),Xse=y7.default?.default??y7.default,Zse=J(`div`)(({theme:e})=>({float:`right`,padding:e.spacing(.5),borderRadius:`4px`,fontSize:`10px`,backgroundColor:X.WHITE,color:X.CORRECT_WITH_ICON,border:`solid 1px ${X.CORRECT_WITH_ICON}`})),Qse=J(`div`)(({theme:e})=>({float:`right`,padding:e.spacing(.5),borderRadius:`4px`,fontSize:`10px`,backgroundColor:X.WHITE,color:X.INCORRECT_WITH_ICON,border:`solid 1px ${X.INCORRECT_WITH_ICON}`})),b7=J(`div`)(({theme:e})=>({float:`right`,padding:e.spacing(.5),borderRadius:`4px`,fontSize:`10px`,backgroundColor:X.WHITE,color:X.MISSING_WITH_ICON,border:`solid 1px ${X.MISSING_WITH_ICON}`,fontWeight:`bold`})),$se=J(`div`)(()=>({float:`right`,padding:0,borderRadius:`4px`,fontSize:`10px`,backgroundColor:X.WHITE,color:X.INCORRECT_WITH_ICON,fontWeight:`bold`})),ece=(e,t,n)=>({float:`right`,padding:e.spacing(.5),fontFamily:e.typography.fontFamily,fontSize:`10px`,border:t?`solid 1px ${X.PRIMARY_DARK}`:n?`solid 1px ${av()}`:`solid 1px ${X.SECONDARY}`,borderRadius:`3px`,color:n?av():X.PRIMARY_DARK,backgroundColor:X.WHITE,WebkitOpacity:t?`1`:void 0,WebkitTextFillColor:n?av():void 0}),tce=()=>({padding:`0`,border:`none`,color:`inherit`,fontWeight:`bold`}),nce=(e,t,n={width:0,height:0})=>{let{scale:r,domain:i,range:a}=e,o=r.x(t.x)+n.width+5,s=r.y(t.y)+n.height+5,c=o>=r.x(i.max)?`left`:`right`;return`${s>=r.y(a.min)?`top`:`bottom`}-${c}`},rce=(e,t,n={width:0,height:0},r)=>{let{scale:i}=e;switch(r){case`bottom-right`:return{left:i.x(t.x)+5,top:i.y(t.y)+5};case`bottom-left`:return{left:i.x(t.x)-5-n.width,top:i.y(t.y)+5};case`top-left`:return{left:i.x(t.x)-5-n.width,top:i.y(t.y)-5-n.height};case`top-right`:return{left:i.x(t.x)+5,top:i.y(t.y)-5-n.height};default:return{}}},x7=({_ref:e,externalInputRef:t,label:n,disabled:r,inputStyle:i,onChange:a,onBlur:o})=>(0,G.jsx)(Xse,{inputRef:n=>{e(n),t(n)},disabled:r,inputStyle:i,value:n,onChange:a,onBlur:o});x7.propTypes={_ref:j.func,externalInputRef:j.func,label:j.string,disabled:j.bool,inputStyle:j.object,onChange:j.func,onBlur:j.func};var S7=e=>{let[t,n]=(0,W.useState)(null),r=(0,W.useCallback)(e=>n(e)),i=No(),{mark:a,graphProps:o,disabled:s,inputRef:c}=e,[l,u]=(0,W.useState)(a.label),{correctness:d,correctnesslabel:f,correctlabel:p}=a,m=e=>u(e.target.value),h=(0,W.useCallback)(()=>{l===``&&e.onChange(``)},[l,e.onChange]),g=Yse(l,200);(0,W.useEffect)(()=>{u(a.label)},[a.label]),(0,W.useEffect)(()=>{typeof g==`string`&&g!==a.label&&e.onChange(g)},[g]);let _=t?t.getBoundingClientRect():{width:0,height:0},v=rce(o,a,_,nce(o,a,_)),y={position:`fixed`,pointerEvents:`auto`,display:`flex`,alignItems:`center`,gap:`3px`,...v},b={...y,top:v.top+25},x=s||a.disabled,S=(e,t)=>(0,G.jsx)(x7,{_ref:r,externalInputRef:c,label:t,disabled:x,inputStyle:e,onChange:m,onBlur:h}),C=tce();return d===`correct`&&f===`correct`&&p?(0,G.jsxs)(Zse,{style:y,children:[(0,G.jsx)(v7,{type:`correct`}),S(C,p)]}):d===`correct`&&f===`correct`&&!p?null:d===`correct`&&f===`incorrect`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(Qse,{style:y,children:[(0,G.jsx)(v7,{type:`incorrect`}),l===``?(0,G.jsx)(v7,{type:`empty`,style:{marginLeft:`3px`}}):S(C,l)]}),(0,G.jsx)(b7,{style:b,children:S(C,p)})]}):d===`missing`?(0,G.jsx)(b7,{style:y,children:S(C,l)}):d===`incorrect`?(0,G.jsx)($se,{style:y,children:S(C,l)}):(0,G.jsx)(`div`,{style:y,children:S(ece(i,s,a.disabled),l)})};S7.propTypes={disabled:j.bool,onChange:j.func,graphProps:U2,inputRef:j.func,mark:j.object};var ice=class extends W.Component{static propTypes={graphProps:U2.isRequired,..._7};static defaultProps={};constructor(e){super(e),this.state={}}move=e=>{let t={...this.state.mark,...e};this.setState({mark:t})};startDrag=()=>{let{onDragStart:e}=this.props,t={...this.props.mark};t.label===``&&delete t.label,this.setState({mark:t}),e&&e()};stopDrag=()=>{let{onChange:e,onDragStop:t}=this.props,n={...this.state.mark};this.setState({mark:void 0},()=>{mp(this.props.mark,n)||e(this.props.mark,n),t&&t()})};labelChange=e=>{let{onChange:t}=this.props,n={...this.props.mark,label:e};(!e||pp(e))&&delete n.label,this.setState({mark:n},()=>{t(this.props.mark,n)})};clickPoint=()=>{let{labelModeEnabled:e,onChange:t,onClick:n,mark:r}=this.props;if(!e){n(r);return}r.disabled||(t(r,{label:``,...r}),setTimeout(()=>{this.input&&this.input.focus()},0))};render(){let{coordinatesOnHover:e,graphProps:t,labelNode:n,labelModeEnabled:r}=this.props,i=this.state.mark?this.state.mark:this.props.mark;return(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(g7,{...i,coordinatesOnHover:e,graphProps:t,labelNode:n,onDrag:this.move,onDragStart:this.startDrag,onDragStop:this.stopDrag,onClick:this.clickPoint,onTouchStart:e=>{e.stopPropagation(),this.clickPoint()},onTouchEnd:e=>{e.stopPropagation(),this.clickPoint()}}),n&&Object.prototype.hasOwnProperty.call(i,`label`)&&Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input=e,disabled:!r,mark:i,graphProps:t,onChange:this.labelChange}),n)]})}},ace=()=>({label:`Point`,type:`point`,Component:ice,addPoint:e=>({type:`point`,...e})});M();var oce=class extends W.Component{static propTypes={className:j.string,correctness:j.string,disabled:j.bool,x:j.number.isRequired,y:j.number.isRequired,radius:j.number,graphProps:U2.isRequired};render(){let{disabled:e,className:t,correctness:n,x:r,y:i,radius:a,graphProps:o,...s}=this.props,{scale:c}=o,l=Math.abs(c.x(r+a)-c.x(r)),u=Math.abs(c.y(i+a)-c.y(i));return(0,G.jsx)(sce,{className:(0,yW.default)(t,e&&`disabledSecondary`,n),cx:c.x(r),cy:c.y(i),rx:l,ry:u,...s})}},C7=e=>({...e(`stroke`),"&:hover":{strokeWidth:3,...e(`stroke`)}}),sce=J(`ellipse`)(()=>({fill:`transparent`,stroke:X.BLACK,strokeWidth:3,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`,"&:hover":{strokeWidth:6,stroke:X.PRIMARY_DARK},"&.disabled":C7(o7),"&.disabledSecondary":C7(s7),"&.correct":C7(c7),"&.incorrect":C7(l7),"&.missing":C7(u7)})),cce=oce,lce=L4({bounds:(e,{domain:t,range:n})=>{let{x:r,y:i}=e;return M8({left:r,top:i,bottom:i,right:r},t,n)},anchorPoint:e=>{let{x:t,y:n}=e;return{x:t,y:n}},fromDelta:(e,t)=>N8(e).add(N8(t))})(cce);M();var w7=()=>({strokeWidth:4,stroke:X.BLACK}),uce=J(o8)(({disabled:e,correctness:t})=>({fill:`none`,strokeWidth:3,stroke:jv(),...e&&{...s7(`stroke`),strokeWidth:2},...t===`correct`&&c7(`stroke`),...t===`incorrect`&&l7(`stroke`),...t===`missing`&&{...u7(`stroke`),strokeWidth:1,strokeDasharray:`4 3`}})),dce=J(o8)(({theme:e,disabled:t,correctness:n,isDragging:r})=>({strokeWidth:7,fill:`none`,transition:`stroke-width 200ms ease-in, stroke 200ms ease-in`,stroke:`transparent`,pointerEvents:`stroke`,"&:hover":w7(e),...r&&w7(e),...(t||n)&&{pointerEvents:`none`}})),T7=class extends W.Component{static propTypes={className:j.string,data:j.arrayOf(j.arrayOf(j.number)),graphProps:U2.isRequired,disabled:j.bool,correctness:j.string,from:z2,to:z2,isDragging:j.bool};static defaultProps={from:{},to:{}};render(){let{data:e,className:t,disabled:n,correctness:r,from:i,to:a,graphProps:o,isDragging:s,...c}=this.props;return(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(uce,{data:e,className:t,disabled:n,correctness:r,...c}),(0,G.jsx)(dce,{data:e,className:t,isDragging:s,disabled:n,correctness:r,...c})]})}};M();var fce=J(`g`)(({disabled:e,correctness:t})=>({"& line:not(.hit-area)":{fill:`transparent`,stroke:X.BLACK,strokeWidth:3,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`,"&:hover":{strokeWidth:6,stroke:X.PRIMARY_DARK}},...e&&{"& line:not(.hit-area)":{...s7(`stroke`),strokeWidth:2}},...t===`correct`&&{"& line:not(.hit-area)":{...c7(`stroke`)}},...t===`incorrect`&&{"& line:not(.hit-area)":{...l7(`stroke`)}},...t===`missing`&&{"& line:not(.hit-area)":{...u7(`stroke`),strokeWidth:1,strokeDasharray:`4 3`}}})),E7=(e,t)=>()=>({type:e,Component:t,addPoint:(t,n)=>n&&V8(n.root,t)?n:n?V8(t,n.from)?{...n}:{...n,building:!1,to:t}:{type:e,building:!0,from:t}}),D7=e=>class extends W.Component{static propTypes={...W2,graphProps:U2.isRequired,limitLabeling:j.bool,changeMarkProps:j.func,disabled:j.bool,from:z2,to:z2,labelModeEnabled:j.bool,onClick:j.func};constructor(e){super(e),this.state={}}startDrag=()=>{let{onDragStart:e}=this.props;this.setState({mark:{...this.props.mark}}),e&&e()};stopDrag=()=>{let{onChange:e,mark:t,onDragStop:n}=this.props,r={...this.state.mark};this.setState({mark:void 0},()=>{let{type:i}=r,a=i&&(i===`parabola`||i===`sine`||i===`absolute`||i===`exponential`)&&B8(r.from,r.to);!a&&i&&i===`exponential`&&r.from&&r.to&&(a=r.from.y===0||r.to.y===0||r.from.y*r.to.y<0),!mp(t,r)&&!a&&e(t,r),n&&n()})};changeMark=({from:e,to:t,middle:n})=>{let r={...this.state.mark,from:e,to:t};n&&(r={...r,middle:n}),this.setState({mark:r})};changeMarkProps=({from:e,to:t,middle:n})=>{let{onChange:r,mark:i}=this.props,a={...i,...this.state.mark};e&&(a={...a,from:e}),t&&(a={...a,to:t}),n&&(a={...a,middle:n}),mp(i,a)||r(i,a)};render(){let{graphProps:t,onClick:n,labelNode:r,labelModeEnabled:i,coordinatesOnHover:a,limitLabeling:o}=this.props,s=this.state.mark?this.state.mark:this.props.mark,c=Lf(s.from),l=Lf(s.to),u=Lf(s.middle);return c&&s.isBackground&&(c.disabled=!0),l&&s.isBackground&&(l.disabled=!0),u&&s.isBackground&&(u.disabled=!0),(0,G.jsx)(e,{disabled:s.disabled,coordinatesOnHover:a,correctness:s.correctness,from:c,to:l,middle:u,graphProps:t,onChange:this.changeMark,changeMarkProps:this.changeMarkProps,onClick:n,onDragStart:this.startDrag,onDragStop:this.stopDrag,labelNode:r,labelModeEnabled:i,limitLabeling:o})}},pce=()=>({bounds:(e,{domain:t,range:n})=>Q2(Z2(e.from,e.to),t,n),anchorPoint:e=>{let{from:t}=e;return t},fromDelta:(e,t)=>{let{from:n,to:r}=e;return{from:$2(n).add($2(t)),to:$2(r).add($2(t))}}}),O7=(e,t)=>{let n=L4(pce())(e),r=t&&t.from?t.from:g7,i=t&&t.to?t.to:g7;class a extends W.Component{static propTypes={coordinatesOnHover:j.bool,graphProps:U2,from:z2,to:z2,middle:z2,onChange:j.func,onDragStart:j.func,onDragStop:j.func,onClick:j.func,correctness:j.string,disabled:j.bool,limitLabeling:j.bool,changeMarkProps:j.func,labelModeEnabled:j.bool,labelNode:j.object};onChangePoint=e=>{let{middle:t,onChange:n}=this.props,{from:r,to:i}=e;V8(r,i)||(t&&(e.middle={...t,...R8(r,i)}),n(e))};dragComp=({from:e,to:t})=>{let{from:n,to:r,onChange:i,middle:a}=this.props;n.label&&(e.label=n.label),r.label&&(t.label=r.label);let o={from:e,to:t};a&&(o.middle={...a,...R8(e,t)}),i(o)};dragFrom=e=>{let{from:t,to:n}=this.props;t.label&&(e.label=t.label),V8(e,n)||this.onChangePoint({from:e,to:n})};dragTo=e=>{let{from:t,to:n}=this.props;n.label&&(e.label=n.label),V8(t,e)||this.onChangePoint({from:t,to:e})};labelChange=(e,t)=>{let{changeMarkProps:n}=this.props,r={...e};(!e.label||pp(e.label))&&delete r.label,n({[t]:r})};clickPoint=(e,t,n)=>{let{changeMarkProps:r,disabled:i,from:a,to:o,middle:s,labelModeEnabled:c,limitLabeling:l,onClick:u}=this.props;if(!c){u(e||n);return}i||l||(t===`middle`&&!e&&a&&o&&(e={...e,...R8(a,o)}),r({from:j8(a),to:j8(o),middle:j8(s),[t]:{label:``,...e}}),this.input[t]&&this.input[t].focus())};input={};render(){let{coordinatesOnHover:e,graphProps:t,onDragStart:a,onDragStop:o,from:s,to:c,middle:l,disabled:u,correctness:d,onClick:f,labelNode:p,labelModeEnabled:m}=this.props,h={graphProps:t,onDragStart:a,onDragStop:o,disabled:u,correctness:d,onClick:f},g=c?z4(V4(s,c)):0,_=null,v=null,y=null;return p&&(s&&Object.prototype.hasOwnProperty.call(s,`label`)&&(_=Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input.from=e,disabled:!m,mark:s,graphProps:t,onChange:e=>this.labelChange({...s,label:e},`from`)}),p)),c&&Object.prototype.hasOwnProperty.call(c,`label`)&&(v=Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input.to=e,disabled:!m,mark:c,graphProps:t,onChange:e=>this.labelChange({...c,label:e},`to`)}),p)),l&&Object.prototype.hasOwnProperty.call(l,`label`)&&(y=Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input.middle=e,disabled:!m,mark:l,graphProps:t,onChange:e=>this.labelChange({...l,label:e},`middle`)}),p))),(0,G.jsxs)(fce,{disabled:u,correctness:d,children:[c&&(0,G.jsx)(n,{from:s,to:c,middle:l,onDrag:this.dragComp,...h,onClick:e=>this.clickPoint(l,`middle`,e)}),y,(0,G.jsx)(r,{x:s.x,y:s.y,labelNode:p,coordinatesOnHover:e,onDrag:this.dragFrom,...h,onClick:e=>this.clickPoint(s,`from`,e)}),_,c&&(0,G.jsx)(i,{x:c.x,y:c.y,angle:g,labelNode:p,coordinatesOnHover:e,onDrag:this.dragTo,...h,onClick:e=>this.clickPoint(c,`to`,e)}),v]})}}return a},k7={line:()=>({fill:`transparent`,stroke:X.BLACK,strokeWidth:3,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`,"&:hover":{strokeWidth:6,stroke:X.PRIMARY_DARK}}),arrow:()=>({fill:X.BLACK}),disabledArrow:()=>({...s7()}),disabledSecondary:()=>({...s7(`stroke`),strokeWidth:2}),disabled:()=>({...o7(`stroke`),strokeWidth:2}),correct:(e,t)=>({...c7(t)}),incorrect:(e,t)=>({...l7(t)}),missing:(e,t)=>({...u7(t),strokeWidth:1,strokeDasharray:`4 3`})};M();var A7=e=>{let t={...e};return t.root={...e.from},t.edge=e.to?{...e.to}:void 0,delete t.from,delete t.to,t},mce=e=>{let t={...e};return t.from={...e.root},t.to=e.edge?{...e.edge}:void 0,delete t.root,delete t.edge,t},hce=e=>{let t=t=>{let n=mce(t.mark),r=(e,n)=>{t.onChange(A7(e),A7(n))};return(0,G.jsx)(e,{...t,mark:n,onChange:r})};return t.propTypes={onChange:j.func,mark:j.object},t},j7=e=>hce(D7(e)),gce=e=>{let t=t=>{let{graphProps:n,from:r,to:i,onClick:a,onDragStart:o,onDragStop:s,onChange:c,disabled:l,correctness:u,...d}=t,{dataPoints:f,enableCurve:p=!0}=e({graphProps:t.graphProps,root:r,edge:i}),m=f.map(e=>[n.scale.x(e.x),n.scale.y(e.y)]),h={onClick:a,graphProps:n,onDragStart:o,onDragStop:s,onChange:c,disabled:l,correctness:u};return p?(0,G.jsx)(T7,{data:m,from:r,to:i,curve:dae,...h,...d}):(0,G.jsx)(T7,{data:m,from:r,to:i,...h,...d})};return t.propTypes={graphProps:U2.isRequired,from:z2.isRequired,to:z2,onClick:j.func,onDragStart:j.func,onDragStop:j.func,onChange:j.func,disabled:j.bool,correctness:j.string},t},M7=e=>O7(gce(e));M();var _ce=e=>Kt({"0%":{opacity:`0.0`},"50%":{opacity:e},"100%":{opacity:`0.0`}}),vce=(e,t)=>N8(e).dist(N8(t)),yce=class extends W.Component{static propTypes={building:j.bool,className:j.string,coordinatesOnHover:j.bool,correctness:j.string,from:z2,disabled:j.bool,to:z2,middle:z2,onChange:j.func.isRequired,onDragStart:j.func,onDragStop:j.func,graphProps:U2.isRequired,onClick:j.func,labelNode:j.object,labelModeEnabled:j.bool,changeMarkProps:j.func,limitLabeling:j.bool};static defaultProps={onClick:()=>({})};onChangePoint=e=>{let{middle:t,onChange:n}=this.props,{from:r,to:i}=e;V8(r,i)||(t&&(e.middle={...t,...R8(r,i)}),n(e))};dragFrom=e=>{let{from:t,to:n}=this.props;t.label&&(e.label=t.label),V8(e,n)||this.onChangePoint({from:e,to:n})};dragTo=e=>{let{from:t,to:n}=this.props;n.label&&(e.label=n.label),V8(t,e)||this.onChangePoint({from:t,to:e})};dragCircle=e=>{let{from:t,to:n,onChange:r,middle:i}=this.props,a=N8(t).sub(N8(e)),o=N8(n).sub(a);t.label&&(e.label=t.label),n.label&&(o.label=n.label);let s={from:e,to:o};i&&(s.middle={...i,...R8(e,o)}),this.setState({draggedroot:void 0,draggedOuter:void 0,isCircleDrag:!1},()=>r(s))};labelChange=(e,t)=>{let{changeMarkProps:n}=this.props,r={...e};(!e.label||pp(e.label))&&delete r.label,n({[t]:r})};clickPoint=(e,t,n)=>{let{changeMarkProps:r,disabled:i,from:a,to:o,middle:s,labelModeEnabled:c,limitLabeling:l,onClick:u}=this.props;if(!c){u(e||n);return}i||l||(t===`middle`&&!e&&a&&o&&(e={...e,...R8(a,o)}),r({from:j8(a),to:j8(o),middle:j8(s),[t]:{label:``,...e}}),this.input[t]&&this.input[t].focus())};input={};render(){let{from:e,to:t,middle:n,disabled:r,building:i,coordinatesOnHover:a,onDragStart:o,onDragStop:s,onClick:c,correctness:l,graphProps:u,labelNode:d,labelModeEnabled:f}=this.props,p={onDragStart:o,onDragStop:s,graphProps:u,onClick:c};t||=e;let m=vce(e,t),h=null,g=null,_=null;return d&&(e?.label!==void 0&&(h=Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input.from=e,disabled:!f,mark:e,graphProps:u,onChange:t=>this.labelChange({...e,label:t},`from`)}),d)),t?.label!==void 0&&(g=Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input.to=e,disabled:!f,mark:t,graphProps:u,onChange:e=>this.labelChange({...t,label:e},`to`)}),d)),n?.label!==void 0&&(_=Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input.middle=e,disabled:!f,mark:n,graphProps:u,onChange:e=>this.labelChange({...n,label:e},`middle`)}),d))),(0,G.jsxs)(`g`,{children:[(0,G.jsx)(bce,{disabled:i||r,correctness:l,className:(0,yW.default)(i&&`bgCircleBuilding`),x:e.x,y:e.y,radius:m,onDrag:this.dragCircle,...p,onClick:e=>this.clickPoint(n,`middle`,e)}),_,(0,G.jsx)(g7,{disabled:i||r,coordinatesOnHover:a,correctness:l,labelNode:d,x:t.x,y:t.y,onDrag:this.dragTo,...p,onClick:e=>this.clickPoint(t,`to`,e)}),g,(0,G.jsx)(g7,{disabled:i||r,coordinatesOnHover:a,correctness:l,labelNode:d,x:e.x,y:e.y,className:`from`,onDrag:this.dragFrom,...p,onClick:t=>this.clickPoint(e,`from`,t)}),h]})}},bce=J(lce)(()=>({"&.outerLine":{fill:Nv(),stroke:X.BLACK,strokeWidth:4,"&:hover":{strokeWidth:6,stroke:X.PRIMARY_DARK}},"&.bgCircleBuilding":{stroke:X.BLACK,animation:`${_ce(`0.3`)} 2s ease-out infinite`,opacity:1}})),xce=j7(yce),Sce=()=>({type:`circle`,Component:xce,hover:(e,t)=>({...t,edge:e}),addPoint:(e,t)=>t&&V8(t.root,e)?t:t?{...t,edge:e,building:!1}:{type:`circle`,root:e,building:!0}});M();var Cce=J(`line`)(({disabled:e,correctness:t})=>({strokeWidth:7,transition:`stroke-width 200ms ease-in, stroke 200ms ease-in`,stroke:`transparent`,pointerEvents:`stroke`,"&:hover":{strokeWidth:4,stroke:X.BLACK},...(e||t)&&{pointerEvents:`none`}})),wce=class extends W.Component{static propTypes={className:j.string,from:z2,to:z2,graphProps:U2.isRequired,disabled:j.bool,correctness:j.string};static defaultProps={from:{},to:{}};render(){let{graphProps:e,from:t,to:n,className:r,disabled:i,correctness:a,...o}=this.props,{scale:s}=e;return(0,G.jsx)(Cce,{x1:s.x(t.x),y1:s.y(t.y),x2:s.x(n.x),y2:s.y(n.y),className:r,disabled:i,correctness:a,...o})}},Tce=L4({bounds:(e,{domain:t,range:n})=>{let{from:r,to:i}=e;return M8(Eoe(r,i),t,n)},anchorPoint:e=>{let{from:t}=e;return t},fromDelta:(e,t)=>{let{from:n,to:r}=e;return{from:N8(n).add(N8(t)),to:N8(r).add(N8(t))}}})(wce);M();var Ece=J(`polygon`)(({disabled:e,correctness:t})=>({fill:wi(a7(),.2),strokeWidth:3,stroke:X.BLACK,...e&&s7(`stroke`),...t===`correct`&&c7(`stroke`),...t===`incorrect`&&l7(`stroke`),...t===`missing`&&{...u7(`stroke`),stroke:`inherit`}})),Dce=J(`polyline`)(({disabled:e,correctness:t})=>({fill:wi(a7(),0),strokeWidth:3,stroke:X.BLACK,pointerEvents:`none`,...e&&s7(`stroke`),...t===`correct`&&c7(`stroke`),...t===`incorrect`&&l7(`stroke`),...t===`missing`&&{...u7(`stroke`),stroke:`inherit`}})),Oce=(e,t)=>(e||[]).map(e=>{let n={x:t.x(e.x),y:t.y(e.y)};return`${n.x},${n.y}`}).join(` `),N7=class extends W.Component{static propTypes={className:j.string,disabled:j.bool,points:j.arrayOf(z2),graphProps:U2.isRequired,closed:j.bool.isRequired,correctness:j.string};static defaultProps={points:[]};render(){let{points:e,className:t,disabled:n,correctness:r,graphProps:i,closed:a,...o}=this.props,{scale:s}=i,c=Oce(e,s);return a?(0,G.jsx)(Ece,{points:c,className:t,disabled:n,correctness:r,...o}):(0,G.jsx)(Dce,{points:c,className:t,disabled:n,correctness:r,...o})}},kce=L4({bounds:(e,{domain:t,range:n})=>{let{points:r}=e;return M8(Toe(r),t,n)},anchorPoint:e=>{let{points:t}=e;return t[0]},fromDelta:(e,t)=>{let{points:n}=e;return n.map(e=>N8(e).add(N8(t)))}})(N7);M();var P7=ey(`pie-lib:graphing:polygon`),Ace=(e,t)=>{let n=Bu(e.reduce((t,n,r)=>{t.push({...n,index:r});let i=r===e.length-1?0:r+1;return t.push({...e[i],index:i}),t},[]),2).map(([e,t])=>({from:e,to:t}));return t?n:cp(n)},jce=(e,...t)=>Bu(t,2).reduce((e,t)=>{if(t.length===2){let[n,r]=t;(0,q2.default)(Number.isFinite(n.index),`Index must be defined`);let i=n.index;return i>=0&&e.splice(i,1,r),e}else return e},[...e]),Mce=class extends W.Component{static propTypes={classes:j.object,className:j.string,disabled:j.bool,correctness:j.string,points:j.arrayOf(z2),closed:j.bool,coordinatesOnHover:j.bool,onChange:j.func.isRequired,onClosePolygon:j.func.isRequired,onDragStart:j.func,onDragStop:j.func,onClick:j.func,graphProps:U2.isRequired,isToolActive:j.bool,middle:j.object,labelNode:j.object,labelModeEnabled:j.bool,limitLabeling:j.bool,onChangeLabelProps:j.func,onSetMiddleLabel:j.func,onChangeProps:j.func};static defaultProps={points:[]};dragPoint=(e,t,n)=>{P7(`[dragPoint] from, to:`,t,n);let{onChange:r,points:i}=this.props,a=[...i],o=!!(i||[]).find(e=>V8(e,n));V8(t,n)||o||(i[e].label&&(n.label=i[e].label),a.splice(e,1,n),r(a))};dragLine=(e,t)=>{P7(`[dragLine]: `,e,t);let{onChange:n}=this.props;e.from.label&&(t.from.label=e.from.label),e.to.label&&(t.to.label=e.to.label),n(jce(this.props.points,e.from,t.from,e.to,t.to))};dragPoly=(e,t)=>{P7(`[dragPoly] `,e,t);let{onChange:n}=this.props;t.forEach((n,r)=>{e[r].label&&(t[r].label=e[r].label)}),n(t)};close=()=>{let{points:e,onClosePolygon:t}=this.props;P7(`[close] ...`),e.length>=3?t():P7(`[close] - nope`)};labelChange=(e,t)=>{let{points:n,onChangeProps:r}=this.props,i={...e};(!e.label||pp(e.label))&&delete i.label;let a=[...n];a.splice(t,1,i),r(a)};clickPoint=(e,t,n)=>{let{closed:r,disabled:i,middle:a,onClick:o,isToolActive:s,labelModeEnabled:c,limitLabeling:l,onSetMiddleLabel:u,points:d}=this.props;if(c){if(i||l)return;if(d&&t===d.length){let{a:t,b:n}=L8(d);u({label:``,...e,...R8(t,n)},d.map(j8))}else{let n=d.map(j8);n.splice(t,1,{label:``,...e}),u(a&&j8(a),n)}setTimeout(()=>{this.input[t]&&this.input[t].focus()},0);return}if(s&&!r&&t===0){this.close();return}o(e||n)};input={};render(){let{closed:e,coordinatesOnHover:t,correctness:n,disabled:r,graphProps:i,onChangeLabelProps:a,onDragStart:o,onDragStop:s,points:c,middle:l,labelNode:u,labelModeEnabled:d}=this.props,f=Ace(c,e),p={onDragStart:o,onDragStop:s,graphProps:i,disabled:r,correctness:n},m=c&&c.length||0,h=null;return u&&l&&Object.prototype.hasOwnProperty.call(l,`label`)&&(h=Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input[m]=e,disabled:r||!d,mark:l,graphProps:i,onChange:e=>a({...l,label:e})}),u)),(0,G.jsxs)(`g`,{children:[e?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(kce,{points:c,onDrag:this.dragPoly.bind(this,c),closed:e,...p,onClick:this.clickPoint.bind(this,l,m)}),h]}):(0,G.jsx)(N7,{points:c,graphProps:i,closed:e}),(f||[]).map((e,t)=>(0,G.jsx)(Tce,{from:e.from,to:e.to,onDrag:this.dragLine.bind(this,e),...p,onClick:this.clickPoint.bind(this,l,m)},`line-${t}`)),(c||[]).map((e,n)=>[(0,G.jsx)(g7,{coordinatesOnHover:t,labelNode:u,x:e.x,y:e.y,onDrag:this.dragPoint.bind(this,n,e),...p,onClick:this.clickPoint.bind(this,e,n)},`point-${n}`),u&&Object.prototype.hasOwnProperty.call(e,`label`)?Vg.createPortal((0,G.jsx)(S7,{inputRef:e=>this.input[n]=e,disabled:r||!d,mark:e,graphProps:i,onChange:t=>this.labelChange({...e,label:t},n)}),u):null])]})}},Nce=class extends W.Component{static propTypes={..._7,graphProps:U2.isRequired};static defaultProps={};constructor(e){super(e),this.state={}}change=e=>{let{mark:{middle:t}}=this.props,n={...this.state.mark,points:e};if(t){let{a:r,b:i}=L8(e);n.middle={...t,...R8(r,i)}}this.setState({mark:n})};changeProps=e=>{let t={...this.props.mark,points:e};this.props.onChange(this.props.mark,t)};changeLabelProps=e=>{let{mark:t,onChange:n}=this.props,r={...t.middle,...e};(!r.label||pp(r.label))&&delete r.label,n(t,{...t,middle:r})};setMiddleLabel=(e,t)=>{let{mark:n,onChange:r}=this.props,i={...n,middle:e};t&&(i.points=t),r(n,i)};closePolygon=()=>{P7(`[closePolygon] ...`);let{onComplete:e,mark:t}=this.props;e(t,{...t,closed:!0})};dragStart=()=>this.setState({mark:this.props.mark});dragStop=()=>{let{onChange:e}=this.props,t={...this.state.mark};this.setState({mark:void 0},()=>{e(this.props.mark,t)})};render(){let{coordinatesOnHover:e,mark:t,graphProps:n,onClick:r,isToolActive:i,labelNode:a,labelModeEnabled:o,limitLabeling:s}=this.props,{mark:c}=this.state;return(0,G.jsx)(Mce,{...c||t,coordinatesOnHover:e,onChange:this.change,onChangeLabelProps:this.changeLabelProps,onSetMiddleLabel:this.setMiddleLabel,onChangeProps:this.changeProps,onClosePolygon:this.closePolygon,onDragStart:this.dragStart,onDragStop:this.dragStop,onClick:r,graphProps:n,isToolActive:i,labelNode:a,labelModeEnabled:o,limitLabeling:s})}},Pce=(e,t)=>{if(t||=[],t.length===0)return{points:[e],closed:!1};if(t.length===1)return V8(e,t[0])?{points:t,closed:!1}:{points:[...t,e],closed:!1};if(t.length>=2){let n=V8(e,t[0]);return n?{points:t,closed:n}:t.find(t=>V8(t,e))?{points:t,closed:!1}:{points:[...t,e],closed:!1}}},Fce=()=>({type:`polygon`,Component:Nce,complete:(e,t)=>({...t,building:!1,closed:!0}),addPoint:(e,t)=>{if(t){let{closed:n,points:r}=Pce(e,t.points);return{...t,closed:n,points:r,building:!n}}else return{type:`polygon`,points:[e],closed:!1,building:!0}}}),F7=ey(`pie-lib:graphing:tools:utils`),Ice=(e,t)=>{if(!t||e.x==t.x)return{freq:0,amplitude:0};let n=new K2(e.x,e.y),r=new K2(t.x,t.y).sub(n);return{freq:r.x*4,amplitude:r.y}},Lce=(e,t,n,r)=>(t=Math.abs(t),F7(`[xPoints] root:`,e,`freq:`,t,` min:`,n,` max:`,r),fee(Dp(e,n-t,t*-1),Ep(e+t,r+t,t))),Rce=(e,t,n)=>r=>{n={phase:0,vertical:0,...n};let i=Math.PI*2*(r-n.phase)/t;return e*parseFloat(Math.sin(i)).toFixed(10)+n.vertical},zce=(e,t)=>{t||={...e};let n={x:e.x-(t.x-e.x),y:t.y};return Bce(e,t,n)},Bce=(e,t,n)=>{F7(e,t,n);let{a:r,b:i,c:a}=Vce(e,t,n);return F7(r,i,a),Hce(r,i,a)},Vce=(e,t,n)=>{let r=e.x**2*-1+t.x**2,i=e.x*-1+t.x,a=e.y*-1+t.y,o=t.x**2*-1+n.x**2,s=t.x*-1+n.x,c=t.y*-1+n.y,l=s/i*-1,u=l*r+o,d=(l*a+c)/u,f=(a-r*d)/i;return{a:d,b:f,c:e.y-d*e.x**2-f*e.x}},Hce=(e,t,n)=>r=>e*r**2+t*r+n,Uce=(e,t)=>(t||={...e},Gce(Wce(e,t),e.x,e.y)),Wce=(e,t)=>{let n=(t.y-e.y)/(t.x-e.x);return t.x<e.x&&(n*=-1),n},Gce=(e,t,n)=>r=>e*Math.abs(r-t)+n,Kce=(e,t)=>{t||={...e};let{a:n,b:r}=qce(e,t);return Jce(n,r)},qce=(e,t)=>{let n=(e.y/t.y)**+(1/(e.x-t.x));return{a:e.y/n**+e.x,b:n}},Jce=(e,t)=>n=>e*t**+n,I7=(e,t,n,r,i,a=!1)=>{F7(`[buildDataPoints] domain:`,e,`range:`,t,`root:`,n,`edge:`,r),e={min:0,max:0,step:1,...e},t={min:0,max:0,step:1,...t},r||={...n};let o=Lce(Math.min(n.x,r.x),e.step,e.min-e.step,e.max+e.step);F7(`[buildDataPoints]:xPts:`,o);let s=-1,c=-1,l=o.map(e=>new K2(e,i(e)));if(!a)return l;let u=l.reduce((e,n,r)=>n.y>=t.min-t.step&&n.y<=t.max+t.step?(s===-1&&(s=r),c<r&&(c=r),[...e,n]):e,[]);return s-1>=0&&u.unshift(l[s-1]),c+1<=l.length-1&&u.push(l[c+1]),l},Yce=ey(`pie-lib:graphing:sine`),Xce=j7(M7(e=>{let{root:t,edge:n,graphProps:r}=e,{domain:i,range:a}=r,{amplitude:o,freq:s}=Ice(t,n),c=s/16;Yce(`[getPoints] amplitude:`,o,`freq:`,s);let l=n&&n.x===t.x?[]:I7({...i,step:c},a,t,n,Rce(o,s,{phase:t.x,vertical:t.y}));return{root:e.root,edge:e.edge,dataPoints:l}})),Zce=ey(`pie-lib:graphing:sine`),Qce=()=>({type:`sine`,Component:Xce,complete:(e,t)=>({...t,building:!1,closed:!0}),addPoint:(e,t)=>{if(Zce(`add point to sine model: `,e,`mark: `,t),t&&(V8(t.root,e)||B8(t.root,e)))return t;if(!t)return{type:`sine`,root:e,edge:void 0,closed:!1,building:!0};if(t&&!t.root)throw Error(`no root - should never happen`);return{...t,edge:e,closed:!0,building:!1}}}),$ce=ey(`pie-lib:graphing:parabola`),ele=j7(M7(e=>{let{root:t,edge:n,graphProps:r}=e,{domain:i,range:a}=r,o=n&&n.x===t.x?[]:I7(i,a,t,n,zce(t,n),!0);return $ce(`dataPoints:`,o),{root:e.root,edge:e.edge,dataPoints:o}})),tle=ey(`pie-lib:graphing:parabola`),nle=()=>({type:`parabola`,Component:ele,complete:(e,t)=>({...t,building:!1,closed:!0}),addPoint:(e,t)=>{if(tle(`add point to parabola model: `,e,`mark: `,t),t&&(V8(t.root,e)||B8(t.root,e)))return t;if(!t)return{type:`parabola`,root:e,edge:void 0,closed:!1,building:!0};if(t&&!t.root)throw Error(`no root - should never happen`);return{...t,edge:e,closed:!0,building:!1}}});M();var rle=J(`g`)(({theme:e,disabled:t,correctness:n})=>({"& line:not(.hit-area)":{...k7.line(e),...t&&k7.disabledSecondary(e),...n===`correct`&&k7.correct(e,`stroke`),...n===`incorrect`&&k7.incorrect(e,`stroke`),...n===`missing`&&k7.missing(e,`stroke`)},"& .enabledArrow":{...k7.arrow(e)},"& .disabledArrow":{...k7.disabledArrow(e)},"& .correctArrow":{...k7.correct(e)},"& .incorrectArrow":{...k7.incorrect(e)},"& .missingArrow":{...k7.missing(e)}})),L7=e=>{let t=f7(),{className:n,correctness:r,disabled:i,graphProps:a,from:o,to:s,markerId:c,...l}=e,{scale:u}=a,{domain:d,range:f}=W8(a),[p,m]=W4(d,f)(o,s),h=r||i&&`disabled`||`enabled`,g=c||t;return(0,G.jsxs)(rle,{disabled:i,correctness:r,children:[(0,G.jsx)(`defs`,{children:(0,G.jsx)(p7,{size:U8(a)?4:5,id:`${g}-${h}`,className:(0,yW.default)(h===`enabled`?`enabledArrow`:h===`disabled`?`disabledArrow`:`${h}Arrow`)})}),(0,G.jsx)(`line`,{x1:u.x(p.x),y1:u.y(p.y),x2:u.x(m.x),y2:u.y(m.y),className:`hit-area`,stroke:`transparent`,strokeWidth:7,style:{cursor:`pointer`,pointerEvents:`stroke`}}),(0,G.jsx)(`line`,{x1:u.x(p.x),y1:u.y(p.y),x2:u.x(m.x),y2:u.y(m.y),className:n,markerEnd:`url(#${g}-${h})`,markerStart:`url(#${g}-${h})`,...l})]})};L7.propTypes={className:j.string,correctness:j.string,disabled:j.bool,graphProps:U2,from:z2,to:z2,markerId:j.string};var ile=E7(`line`,D7(O7(L7)));M();var ale=J(`line`)(({theme:e,disabled:t,correctness:n})=>({...k7.line(e),...t&&{...k7.disabled(e),...k7.disabledSecondary(e)},...n===`correct`&&k7.correct(e,`stroke`),...n===`incorrect`&&k7.incorrect(e,`stroke`),...n===`missing`&&k7.missing(e,`stroke`)})),R7=e=>{let{className:t,correctness:n,disabled:r,graphProps:i,from:a,to:o,...s}=e,{scale:c}=i,l=c.x(a.x),u=c.y(a.y),d=c.x(o.x),f=c.y(o.y);return(0,G.jsxs)(`g`,{children:[(0,G.jsx)(`line`,{className:`hit-area`,x1:l,y1:u,x2:d,y2:f,stroke:`transparent`,strokeWidth:7,style:{cursor:`pointer`,pointerEvents:`stroke`}}),(0,G.jsx)(ale,{x1:l,y1:u,x2:d,y2:f,className:t,disabled:r,correctness:n,...s})]})};R7.propTypes={className:j.string,correctness:j.string,disabled:j.bool,graphProps:j.any,from:z2,to:z2};var ole=E7(`segment`,D7(O7(R7)));M();var sle=J(`g`)(({theme:e,disabled:t,correctness:n})=>({"& line:not(.hit-area)":{...k7.line(e),...t&&k7.disabledSecondary(e),...n===`correct`&&k7.correct(e,`stroke`),...n===`incorrect`&&k7.incorrect(e,`stroke`),...n===`missing`&&k7.missing(e,`stroke`)},"& .enabledArrow":{...k7.arrow(e)},"& .disabledArrow":{...k7.disabledArrow(e)},"& .correctArrow":{...k7.correct(e)},"& .incorrectArrow":{...k7.incorrect(e)},"& .missingArrow":{...k7.missing(e)}})),z7=e=>{let t=f7(),{graphProps:n,from:r,to:i,disabled:a,correctness:o,className:s,markerId:c,...l}=e,{scale:u}=n,{domain:d,range:f}=W8(n),[p]=W4(d,f)(r,i),m=o||a&&`disabled`||`enabled`,h=c||t;return(0,G.jsxs)(sle,{disabled:a,correctness:o,children:[(0,G.jsx)(`defs`,{children:(0,G.jsx)(p7,{size:U8(n)?4:5,id:`${h}-${m}`,className:(0,yW.default)(m===`enabled`?`enabledArrow`:m===`disabled`?`disabledArrow`:`${m}Arrow`)})}),(0,G.jsx)(`line`,{x1:u.x(r.x),y1:u.y(r.y),x2:u.x(p.x),y2:u.y(p.y),className:`hit-area`,stroke:`transparent`,strokeWidth:7,style:{cursor:`pointer`,pointerEvents:`stroke`}}),(0,G.jsx)(`line`,{x1:u.x(r.x),y1:u.y(r.y),x2:u.x(p.x),y2:u.y(p.y),className:s,markerEnd:`url(#${h}-${m})`,...l})]})};z7.propTypes={className:j.string,disabled:j.bool,correctness:j.string,graphProps:j.any,from:z2,to:z2,markerId:j.string};var cle=E7(`ray`,D7(O7(z7)));M();var lle=J(`line`)(({theme:e,disabled:t,correctness:n})=>({...k7.line(e),...t&&k7.disabledSecondary(e),...n&&k7[n]&&k7[n](e,`stroke`)})),B7=e=>{let{className:t,disabled:n,correctness:r,graphProps:{scale:i},from:a,to:o,...s}=e,c={x:i.x(a.x),y:i.y(a.y)},l={x:i.x(o.x),y:i.y(o.y)},u=G8(c,l);return(0,G.jsx)(lle,{className:t,disabled:n,correctness:r,x1:c.x,y1:c.y,x2:l.x,y2:l.y,strokeDasharray:u-7,...s})};B7.propTypes={className:j.string,disabled:j.bool,correctness:j.string,graphProps:j.any,from:z2,to:z2};var ule=E7(`vector`,D7(O7(B7,{to:qse}))),dle=ey(`pie-lib:graphing:absolute`),fle=j7(M7(e=>{let{root:t,edge:n,graphProps:r}=e,{domain:i,range:a}=r,o=n&&n.x===t.x?[]:I7(i,a,t,n,Uce(t,n),!0);return dle(`dataPoints:`,o),{root:e.root,edge:e.edge,dataPoints:o,enableCurve:!1}})),ple=ey(`pie-lib:graphing:absolute`),mle=()=>({type:`absolute`,Component:fle,complete:(e,t)=>({...t,building:!1,closed:!0}),addPoint:(e,t)=>{if(ple(`add point to absolute model: `,e,`mark: `,t),t&&(V8(t.root,e)||B8(t.root,e)))return t;if(!t)return{type:`absolute`,root:e,edge:void 0,closed:!1,building:!0};if(t&&!t.root)throw Error(`no root - should never happen`);return{...t,edge:e,closed:!0,building:!1}}}),hle=ey(`pie-lib:graphing:exponential`),gle=j7(M7(e=>{let{root:t,edge:n,graphProps:r}=e,{domain:i,range:a}=r,o=n&&n.x===t.x?[]:I7(i,a,t,n,Kce(t,n),!0);return hle(`dataPoints:`,o),{root:e.root,edge:e.edge,dataPoints:o}})),_le=ey(`pie-lib:graphing:exponential`),vle=()=>({type:`exponential`,Component:gle,complete:(e,t)=>({...t,building:!1,closed:!0}),addPoint:(e,t)=>{if(_le(`add point to exponential model: `,e,`mark: `,t),t&&(V8(t.root,e)||B8(t.root,e))||t&&t.root.y*e.y<0||e.y===0)return t;if(!t)return{type:`exponential`,root:e,edge:void 0,closed:!1,building:!0};if(t&&!t.root)throw Error(`no root - should never happen`);return{...t,edge:e,closed:!0,building:!1}}}),V7=[`circle`,`line`,`label`,`parabola`,`point`,`polygon`,`ray`,`segment`,`sine`,`vector`,`absolute`,`exponential`],H7=[Sce(),ile(),nle(),ace(),Fce(),cle(),ole(),Qce(),ule(),mle(),vle(),{type:`label`}];M();function U7({children:e,onDragEnd:t,onDragStart:n,collisionDetection:r,modifiers:i,autoScroll:a}){let[o,s]=(0,W.useState)(null),c=fH(dH(cU,{activationConstraint:{distance:8}}),dH(rU));return(0,G.jsx)(aW,{sensors:c,onDragStart:e=>{s(e.active.id),n&&n(e)},onDragEnd:e=>{s(null),t&&t(e)},collisionDetection:r,modifiers:i,autoScroll:a,children:e})}U7.propTypes={children:j.node.isRequired,onDragEnd:j.func,onDragStart:j.func,collisionDetection:j.func,modifiers:j.arrayOf(j.func),autoScroll:j.object};function yle(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}eU.Down,eU.Right,eU.Up,eU.Left;var W7=e=>typeof e==`string`,G7=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},K7=e=>e==null?``:``+e,ble=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},xle=/###/g,q7=e=>e&&e.indexOf(`###`)>-1?e.replace(xle,`.`):e,J7=e=>!e||W7(e),Y7=(e,t,n)=>{let r=W7(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(J7(e))return{};let t=q7(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return J7(e)?{}:{obj:e,k:q7(r[i])}},X7=(e,t,n)=>{let{obj:r,k:i}=Y7(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=Y7(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Y7(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Sle=(e,t,n,r)=>{let{obj:i,k:a}=Y7(e,t,Object);i[a]=i[a]||[],i[a].push(n)},Z7=(e,t)=>{let{obj:n,k:r}=Y7(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Cle=(e,t,n)=>{let r=Z7(e,n);return r===void 0?Z7(t,n):r},Q7=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?W7(e[r])||e[r]instanceof String||W7(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Q7(e[r],t[r],n):e[r]=t[r]);return e},$7=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),wle={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Tle=e=>W7(e)?e.replace(/[&<>"'\/]/g,e=>wle[e]):e,Ele=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Dle=[` `,`,`,`?`,`!`,`;`],Ole=new Ele(20),kle=(e,t,n)=>{t||=``,n||=``;let r=Dle.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Ole.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},e9=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},t9=e=>e?.replace(/_/g,`-`),Ale={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},n9=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Ale,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(W7(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},r9=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},i9=class extends r9{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):W7(n)&&i?o.push(...n.split(i)):o.push(n)));let s=Z7(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!W7(n)?s:e9(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),X7(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(W7(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=Z7(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Q7(s,n,i):s={...s,...n},X7(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},a9={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},o9=Symbol(`i18next/PATH_KEY`);function jle(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===o9?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function s9(e,t){let{[o9]:n}=e(jle()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var c9={},l9=e=>!W7(e)&&typeof e!=`boolean`&&typeof e!=`number`,u9=class e extends r9{constructor(e,t={}){super(),ble([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=n9.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=l9(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!kle(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:W7(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:W7(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=s9(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?s9(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!W7(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=l9(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(O)<0&&!(W7(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:l9(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&W7(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=W7(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!W7(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=W7(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=a9.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return W7(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?s9(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!W7(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(W7(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!c9[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(c9[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!W7(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},d9=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=n9.create(`languageUtils`)}getScriptPartFromCode(e){if(e=t9(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=t9(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(W7(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),W7(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return W7(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):W7(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},f9={zero:0,one:1,two:2,few:3,many:4,other:5},p9={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Mle=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=n9.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=t9(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),p9;if(!e.match(/-|_/))return p9;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>f9[e]-f9[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},m9=(e,t,n,r=`.`,i=!0)=>{let a=Cle(e,t,n);return!a&&i&&W7(n)&&(a=e9(e,n,r),a===void 0&&(a=e9(t,n,r))),a},h9=e=>e.replace(/\$/g,`$$$$`),g9=class{constructor(e={}){this.logger=n9.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Tle:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?$7(i):a||`{{`,this.suffix=o?$7(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?$7(d):f||$7(`$t(`),this.nestingSuffix=p?$7(p):m||$7(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=m9(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(m9(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>h9(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?h9(this.escape(e)):h9(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=W7(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !W7(a)&&!this.useRawValueToEscape&&(a=K7(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${$7(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!W7(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!W7(i))return i;W7(i)||(i=K7(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Nle=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},_9=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(t9(r),i),t[o]=s),s(n)}},Ple=e=>(t,n,r)=>e(t9(n),r)(t),Fle=class{constructor(e={}){this.logger=n9.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?_9:Ple;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=_9(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Nle(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Ile=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Lle=class extends r9{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=n9.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Sle(n.loaded,[i],a),Ile(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();W7(e)&&(e=this.languageUtils.toResolveHierarchy(e)),W7(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},v9=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),W7(e[1])&&(t.defaultValue=e[1]),W7(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),y9=e=>(W7(e.ns)&&(e.ns=[e.ns]),W7(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),W7(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),b9=()=>{},Rle=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},x9=`__i18next_supportNoticeShown`,zle=()=>!!(typeof globalThis<`u`&&globalThis[x9]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env),Ble=()=>{typeof globalThis<`u`&&(globalThis[x9]=!0)},Vle=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),S9=class e extends r9{constructor(e={},t){if(super(),this.options=y9(e),this.services={},this.logger=n9,this.modules={external:[]},Rle(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(W7(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=v9();this.options={...n,...this.options,...y9(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Vle(this)&&!zle()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),Ble());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?n9.init(r(this.modules.logger),this.options):n9.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Fle;let t=new d9(this.options);this.store=new i9(this.options.resources,this.options);let i=this.services;i.logger=n9,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Mle(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new g9(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Lle(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new u9(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=b9,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=G7(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=b9){let n=t,r=W7(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=G7();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=b9,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&a9.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=G7();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=W7(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(W7(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=s9(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=s9(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=s9(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return W7(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=G7();return this.options.ns?(W7(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=G7();W7(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new d9(v9());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=b9){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new i9(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...v9().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new g9(n)}return a.translator=new u9(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();S9.createInstance,S9.dir,S9.init,S9.loadResources,S9.reloadResources,S9.use,S9.changeLanguage,S9.getFixedT,S9.t,S9.exists,S9.setDefaultNamespace,S9.hasLoadedNamespace,S9.loadNamespaces,S9.loadLanguages,S9.init({fallbackLng:`en`,lng:`en`,debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:`You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.`,maxChoicesPerCategoryRestriction:`To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s].`},ebsr:{part:`Part {{index}}`},numberLine:{addElementLimit_one:`You can only add {{count}} element`,addElementLimit_other:`You can only add {{count}} elements`,clearAll:`Clear all`},imageClozeAssociation:{reachedLimit_one:`You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.`,reachedLimit_other:`Full`},drawingResponse:{fillColor:`Fill color`,outlineColor:`Outline color`,noFill:`No fill`,lightblue:`Light blue`,lightyellow:`Light yellow`,red:`Red`,orange:`Orange`,yellow:`Yellow`,violet:`Violet`,blue:`Blue`,green:`Green`,white:`White`,black:`Black`,onDoubleClick:`Double click to edit this text. Press Enter to submit.`},charting:{addCategory:`Add category`,actions:`Actions`,add:`Add`,delete:`Delete`,newLabel:`New label`,reachedLimit_other:`There can't be more than {{count}} categories.`,keyLegend:{incorrectAnswer:`Student incorrect answer`,correctAnswer:`Student correct answer`,correctKeyAnswer:`Answer key correct`}},graphing:{point:`Point`,circle:`Circle`,line:`Line`,parabola:`Parabola`,absolute:`Absolute Value`,exponential:`Exponential`,polygon:`Polygon`,ray:`Ray`,segment:`Segment`,sine:`Sine`,vector:`Vector`,label:`Label`,redo:`Redo`,reset:`Reset`},mathInline:{primaryCorrectWithAlternates:`Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.`},multipleChoice:{minSelections:`Select at least {{minSelections}}.`,maxSelections_one:`Only {{maxSelections}} answer is allowed.`,maxSelections_other:`Only {{maxSelections}} answers are allowed.`,minmaxSelections_equal:`Select {{minSelections}}.`,minmaxSelections_range:`Select between {{minSelections}} and {{maxSelections}}.`},selectText:{correctAnswerSelected:`Correct`,correctAnswerNotSelected:`Correct Answer Not Selected`,incorrectSelection:`Incorrect Selection`,key:`Key`}},common:{undo:`Undo`,clearAll:`Clear all`,correct:`Correct`,incorrect:`Incorrect`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,commonCorrectAnswerWithAlternates:`Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.`,warning:`Warning`,showNote:`Show Note`,hideNote:`Hide Note`,cancel:`Cancel`}},es:{translation:{categorize:{limitMaxChoicesPerCategory:`Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.`,maxChoicesPerCategoryRestriction:`Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta`},ebsr:{part:`Parte {{index}}`},numberLine:{addElementLimit_one:`Solo puedes agregar {{count}} elemento`,addElementLimit_other:`Solo puedes agregar {{count}} elementos`,clearAll:`Borrar todo`},imageClozeAssociation:{reachedLimit_one:`Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.`,reachedLimit_other:`Lleno`},drawingResponse:{fillColor:`Color de relleno`,outlineColor:`Color del contorno`,noFill:`Sin relleno`,lightblue:`Azul claro`,lightyellow:`Amarillo claro`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,violet:`Violeta`,blue:`Azul`,green:`Verde`,white:`Blanco`,black:`Negro`,onDoubleClick:`Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar`},charting:{addCategory:`Añadir categoría`,actions:`Acciones`,add:`Añadir`,delete:`Eliminar`,newLabel:`Nueva etiqueta`,reachedLimit_other:`No puede haber más de {{count}} categorías.`,keyLegend:{incorrectAnswer:`Respuesta incorrecta del estudiante`,correctAnswer:`Respuesta correcta del estudiante`,correctKeyAnswer:`Clave de respuesta correcta`}},graphing:{point:`Punto`,circle:`Circulo`,line:`Línea`,parabola:`Parábola`,absolute:`Valor absoluto`,exponential:`Exponencial`,polygon:`Polígono`,ray:`Semirrecta`,segment:`Segmento `,sine:`Seno`,vector:`Vector`,label:`Etiqueta`,redo:`Rehacer`,reset:`Reiniciar`},mathInline:{primaryCorrectWithAlternates:`Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas.`},multipleChoice:{minSelections:`Seleccione al menos {{minSelections}}.`,maxSelections_one:`Sólo se permite {{maxSelections}} respuesta.`,maxSelections_other:`Sólo se permiten {{maxSelections}} respuestas.`,minmaxSelections_equal:`Seleccione {{minSelections}}.`,minmaxSelections_range:`Seleccione entre {{minSelections}} y {{maxSelections}}.`},selectText:{correctAnswerSelected:`Respuesta Correcta`,correctAnswerNotSelected:`Respuesta Correcta No Seleccionada`,incorrectSelection:`Selección Incorrecta`,key:`Clave`}},common:{undo:`Deshacer`,clearAll:`Borrar todo`,correct:`Correct`,incorrect:`Incorrect`,showCorrectAnswer:`Mostrar respuesta correcta`,hideCorrectAnswer:`Ocultar respuesta correcta`,commonCorrectAnswerWithAlternates:`Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.`,warning:`Advertencia`,showNote:`Mostrar Nota`,hideNote:`Ocultar Nota`,cancel:`Cancelar`}}}});var C9={translator:{...S9,t:(e,t)=>{let{lng:n}=t;switch(n){case`en_US`:case`en-US`:t.lng=`en`;break;case`es_ES`:case`es-ES`:case`es_MX`:case`es-MX`:t.lng=`es`;break;default:break}return S9.t(e,{lng:n,...t})}},languageOptions:[{value:`en_US`,label:`English (US)`},{value:`es_ES`,label:`Spanish`}]};M();var{translator:Hle}=C9,Ule=J(Wy,{shouldForwardProp:e=>![`selected`].includes(e)})(({selected:e,disabled:t})=>({color:iv(),backgroundColor:Tv(),border:`1px solid ${qv()}`,"&:hover":{backgroundColor:Jv()},...e&&{border:`1px solid ${xv()}`},...!e&&{"& span":{color:gv()}},...t&&{"& span":{color:gv()},backgroundColor:av()}})),w9=e=>{let{disabled:t,className:n,selected:r,value:i,onClick:a,language:o}=e,s=i.toLowerCase();return(0,G.jsx)(Ule,{size:`small`,disabled:t,className:n,selected:r,value:i,variant:`outlined`,onClick:e=>a({...e,buttonValue:i}),children:Hle.t(`graphing.${s}`,{lng:o})},i)};w9.propTypes={disabled:j.bool,className:j.string,disabledClassName:j.string,selected:j.bool,value:j.string,onClick:j.func,language:j.string};var Wle=J(`div`)(()=>({display:`flex`,flexWrap:`wrap`})),Gle=J(w9)(({theme:e})=>({marginRight:e.spacing(.5),marginBottom:e.spacing(.5),color:iv()})),Kle=J(`div`)({position:`relative`}),qle=class extends W.Component{static propTypes={className:j.string,options:j.arrayOf(j.string),selectedToolType:j.string,disabled:j.bool,draggableTools:j.bool,onChange:j.func,onChangeToolsOrder:j.func,language:j.string};static defaultProps={};select=e=>this.props.onChange(e.buttonValue||e.target.textContent);moveTool=(e,t)=>{let{options:n,onChangeToolsOrder:r}=this.props;r(yle(n,e,t))};handleDragEnd=e=>{let{active:t,over:n}=e;if(!n||!t)return;let r=t.data.current,i=n.data.current;if(r?.type===`tool`&&i?.type===`tool`){let e=r.index,t=i.index;e!==t&&this.moveTool(e,t)}};render(){let{className:e,disabled:t,options:n,selectedToolType:r,draggableTools:i,language:a}=this.props;return(0,G.jsx)(U7,{onDragEnd:this.handleDragEnd,children:(0,G.jsx)(Wle,{className:e,children:(n||[]).map((e,n)=>{if((V7||[]).includes(e)){let o=e===r,s=W.createRef();return(0,G.jsx)(T9,{index:n,value:e,draggable:i,moveTool:this.moveTool,toolRef:s,children:(0,G.jsx)(Gle,{disabled:t,disableRipple:!0,onClick:this.select,value:e,selected:o,language:a})},e)}})})})}};function T9({children:e,index:t,draggable:n,toolRef:r,value:i}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=lW({id:`tool-${i}-${t}`,disabled:!n,data:{type:`tool`,index:t,value:i}}),{setNodeRef:d}=fW({id:`drop-tool-${i}-${t}`,data:{type:`tool`,index:t,accepts:[`tool`]}});return(0,G.jsx)(Kle,{ref:e=>{s(e),d(e),r?.current&&(r.current=e)},style:{transform:XV.Transform.toString(c),transition:l,opacity:u?.5:1},children:(0,G.jsx)(`div`,{...a,...o,children:e})})}T9.propTypes={children:j.node,index:j.number,draggable:j.bool,moveTool:j.func,toolRef:j.object,value:j.string},M();var Jle=class extends W.Component{static propTypes={className:j.string,currentToolType:j.string,disabled:j.bool,draggableTools:j.bool,labelModeEnabled:j.bool,onChange:j.func,onChangeTools:j.func,toolbarTools:j.arrayOf(j.string),language:j.string};static defaultProps={toolbarTools:[]};updateToolsOrder=e=>{let{onChangeTools:t}=this.props;t(e)};render(){let{className:e,currentToolType:t,disabled:n,draggableTools:r,onChange:i,language:a}=this.props,{toolbarTools:o}=this.props;return(0,G.jsx)(`div`,{className:(0,yW.default)(e),children:(0,G.jsx)(qle,{disabled:n,draggableTools:r,options:o,selectedToolType:t,onChange:i,onChangeToolsOrder:e=>this.updateToolsOrder(e),language:a})})}};M();var{translator:E9}=C9,D9=J(Wy)(({theme:e})=>({color:iv(),fontWeight:`bold`,marginBottom:e.spacing(.5),"&:not(:last-of-type)":{marginRight:e.spacing(.5)},"&:hover":{backgroundColor:Jv()}})),Yle=class extends W.Component{static propTypes={className:j.string,onUndo:j.func.isRequired,onRedo:j.func.isRequired,onReset:j.func.isRequired,language:j.string};static defaultProps={};render(){let{className:e,onUndo:t,onRedo:n,onReset:r,language:i}=this.props;return(0,G.jsxs)(`div`,{className:(0,yW.default)(e),children:[(0,G.jsx)(D9,{onClick:()=>t(!0),children:E9.t(`common:undo`,{lng:i})}),(0,G.jsx)(D9,{onClick:()=>n(!0),children:E9.t(`graphing.redo`,{lng:i})}),(0,G.jsx)(D9,{onClick:()=>r(),children:E9.t(`graphing.reset`,{lng:i})})]})}},O9=W.createContext({});function Xle(e){return Qr(`MuiAccordion`,e)}var k9=$r(`MuiAccordion`,[`root`,`heading`,`rounded`,`expanded`,`disabled`,`gutters`,`region`]);M();var Zle=e=>{let{classes:t,square:n,expanded:r,disabled:i,disableGutters:a}=e;return ba({root:[`root`,!n&&`rounded`,r&&`expanded`,i&&`disabled`,!a&&`gutters`],heading:[`heading`],region:[`region`]},Xle,t)},Qle=J(N_,{name:`MuiAccordion`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${k9.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(y_(({theme:e})=>{let t={duration:e.transitions.duration.shortest};return{position:`relative`,transition:e.transitions.create([`margin`],t),overflowAnchor:`none`,"&::before":{position:`absolute`,left:0,top:-1,right:0,height:1,content:`""`,opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create([`opacity`,`background-color`],t)},"&:first-of-type":{"&::before":{display:`none`}},[`&.${k9.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:`none`}}},[`&.${k9.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),y_(({theme:e})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${k9.expanded}`]:{margin:`16px 0`}}}]}))),$le=J(`h3`,{name:`MuiAccordion`,slot:`Heading`})({all:`unset`}),eue=J(`div`,{name:`MuiAccordion`,slot:`Region`})({}),tue=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiAccordion`}),{children:r,className:i,defaultExpanded:a=!1,disabled:o=!1,disableGutters:s=!1,expanded:c,onChange:l,slots:u={},slotProps:d={},TransitionComponent:f,TransitionProps:p,...m}=n,[h,g]=H_({controlled:c,default:a,name:`Accordion`,state:`expanded`}),_=W.useCallback(e=>{g(!h),l&&l(e,!h)},[h,l,g]),[v,...y]=W.Children.toArray(r),b=W.useMemo(()=>({expanded:h,disabled:o,disableGutters:s,toggle:_}),[h,o,s,_]),x={...n,disabled:o,disableGutters:s,expanded:h},S=Zle(x),C={slots:{transition:f,...u},slotProps:{transition:p,...d}},[w,T]=T_(`root`,{elementType:Qle,externalForwardedProps:{...C,...m},className:K(S.root,i),shouldForwardComponentProp:!0,ownerState:x,ref:t}),[E,D]=T_(`heading`,{elementType:$le,externalForwardedProps:C,className:S.heading,ownerState:x}),[O,k]=T_(`transition`,{elementType:uy,externalForwardedProps:C,ownerState:x}),[A,j]=T_(`region`,{elementType:eue,externalForwardedProps:C,ownerState:x,className:S.region,additionalProps:{"aria-labelledby":v.props.id,id:v.props[`aria-controls`],role:`region`}});return(0,G.jsxs)(w,{...T,children:[(0,G.jsx)(E,{...D,children:(0,G.jsx)(O9.Provider,{value:b,children:v})}),(0,G.jsx)(O,{in:h,timeout:`auto`,...k,children:(0,G.jsx)(A,{...j,children:y})})]})});function nue(e){return Qr(`MuiAccordionDetails`,e)}$r(`MuiAccordionDetails`,[`root`]),M();var rue=e=>{let{classes:t}=e;return ba({root:[`root`]},nue,t)},iue=J(`div`,{name:`MuiAccordionDetails`,slot:`Root`})(y_(({theme:e})=>({padding:e.spacing(1,2,2)}))),aue=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiAccordionDetails`}),{className:r,...i}=n,a=n;return(0,G.jsx)(iue,{className:K(rue(a).root,r),ref:t,ownerState:a,...i})});function oue(e){return Qr(`MuiAccordionSummary`,e)}var A9=$r(`MuiAccordionSummary`,[`root`,`expanded`,`focusVisible`,`disabled`,`gutters`,`contentGutters`,`content`,`expandIconWrapper`]);M();var sue=e=>{let{classes:t,expanded:n,disabled:r,disableGutters:i}=e;return ba({root:[`root`,n&&`expanded`,r&&`disabled`,!i&&`gutters`],focusVisible:[`focusVisible`],content:[`content`,n&&`expanded`,!i&&`contentGutters`],expandIconWrapper:[`expandIconWrapper`,n&&`expanded`]},oue,t)},cue=J(gy,{name:`MuiAccordionSummary`,slot:`Root`})(y_(({theme:e})=>{let t={duration:e.transitions.duration.shortest};return{display:`flex`,width:`100%`,minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create([`min-height`,`background-color`],t),[`&.${A9.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${A9.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${A9.disabled})`]:{cursor:`pointer`},variants:[{props:e=>!e.disableGutters,style:{[`&.${A9.expanded}`]:{minHeight:64}}}]}})),lue=J(`span`,{name:`MuiAccordionSummary`,slot:`Content`})(y_(({theme:e})=>({display:`flex`,textAlign:`start`,flexGrow:1,margin:`12px 0`,variants:[{props:e=>!e.disableGutters,style:{transition:e.transitions.create([`margin`],{duration:e.transitions.duration.shortest}),[`&.${A9.expanded}`]:{margin:`20px 0`}}}]}))),uue=J(`span`,{name:`MuiAccordionSummary`,slot:`ExpandIconWrapper`})(y_(({theme:e})=>({display:`flex`,color:(e.vars||e).palette.action.active,transform:`rotate(0deg)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shortest}),[`&.${A9.expanded}`]:{transform:`rotate(180deg)`}}))),due=W.forwardRef(function(e,t){let n=_g({props:e,name:`MuiAccordionSummary`}),{children:r,className:i,expandIcon:a,focusVisibleClassName:o,onClick:s,slots:c,slotProps:l,...u}=n,{disabled:d=!1,disableGutters:f,expanded:p,toggle:m}=W.useContext(O9),h=e=>{m&&m(e),s&&s(e)},g={...n,expanded:p,disabled:d,disableGutters:f},_=sue(g),v={slots:c,slotProps:l},[y,b]=T_(`root`,{ref:t,shouldForwardComponentProp:!0,className:K(_.root,i),elementType:cue,externalForwardedProps:{...v,...u},ownerState:g,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:d,"aria-expanded":p,focusVisibleClassName:K(_.focusVisible,o)},getSlotProps:e=>({...e,onClick:t=>{e.onClick?.(t),h(t)}})}),[x,S]=T_(`content`,{className:_.content,elementType:lue,externalForwardedProps:v,ownerState:g}),[C,w]=T_(`expandIconWrapper`,{className:_.expandIconWrapper,elementType:uue,externalForwardedProps:v,ownerState:g});return(0,G.jsxs)(y,{...b,children:[(0,G.jsx)(x,{...S,children:r}),a&&(0,G.jsx)(C,{...w,children:a})]})}),fue=L_((0,G.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`}),`ExpandMore`);M();var pue=J(`div`)({display:`flex`,flexDirection:`column`,width:`min-content`}),mue=J(`div`)(({theme:e})=>({display:`flex`,justifyContent:`space-between`,padding:e.spacing(1),color:iv(),backgroundColor:_v(),"& button":{fontSize:e.typography.fontSize}})),hue=J(tue)({backgroundColor:_v(),width:`100%`}),gue=J(due)(({theme:e})=>({padding:`0 ${e.spacing(1)}`,minHeight:`32px !important`,"& .MuiAccordionSummary-content":{margin:`4px 0 !important`}})),_ue=J(aue)(({theme:e})=>({padding:0,marginTop:e.spacing(1),display:`flex`,justifyContent:`space-between`})),vue=e=>H7.map(t=>({...t,toolbar:!!e.find(e=>e===t.type)}))||[],yue=(e,t)=>t&&e&&(e.find(e=>e.type===t.type)||{}).toolbar,bue=e=>e.find(e=>e.toolbar),xue=e=>e.filter(e=>!!V7.find(t=>t===e.type)),Sue=(e,t)=>t.filter(t=>!!e.find(e=>e===t.type)),j9=e=>H7.find(t=>t.type===e)||null,M9=({children:e,title:t})=>(0,G.jsxs)(hue,{elevation:0,disableGutters:!0,square:!0,TransitionProps:{timeout:{enter:225,exit:195}},children:[(0,G.jsx)(gue,{expandIcon:(0,G.jsx)(fue,{}),children:(0,G.jsx)(gJ,{variant:`subheading`,children:t})}),(0,G.jsx)(_ue,{children:e})]});M9.propTypes={children:j.array,title:j.string};var N9=class extends W.Component{static propTypes={...S5,onUndo:j.func,onRedo:j.func,onReset:j.func,toolbarTools:j.arrayOf(j.string),language:j.string};static defaultProps={collapsibleToolbar:!1,collapsibleToolbarTitle:``,disabledLabels:!1,disabledTitle:!1,showLabels:!0,showTitle:!0,toolbarTools:[]};constructor(e){super(e),this.state={currentTool:j9(e.defaultTool),labelModeEnabled:!1}}componentDidUpdate(e){let{defaultTool:t}=this.props;if(e.defaultTool!==t){let e=j9(t);this.setState({currentTool:e})}}changeCurrentTool=(e,t)=>this.setState({currentTool:t.find(t=>t.type===e),labelModeEnabled:e===`label`});render(){let{currentTool:e,labelModeEnabled:t}=this.state,{axesSettings:n,className:r,coordinatesOnHover:i,collapsibleToolbar:a,collapsibleToolbarTitle:o,disabled:s,disabledLabels:c,disabledTitle:l,domain:u,draggableTools:d,labels:f,labelsPlaceholders:p,onChangeLabels:m,onChangeMarks:h,onChangeTitle:g,onChangeTools:_,onUndo:v,onRedo:y,onReset:b,range:x,size:S,showLabels:C,showPixelGuides:w,showTitle:T,title:E,titlePlaceholder:D,language:O,removeIncompleteTool:k,limitLabeling:A}=this.props,{backgroundMarks:j,marks:M,toolbarTools:N}=this.props;N=Ip(N||[]).filter(e=>!!sp(e))||[],j=xue(j||[]),M=Sue(N,M||[]);let P=vue(N);(!e||!yue(P,e))&&(e=bue(P));let F=(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(Jle,{currentToolType:e&&e.type,disabled:!!s,draggableTools:d,labelModeEnabled:t,onChange:e=>this.changeCurrentTool(e,P),toolbarTools:N,onChangeTools:_,language:O}),!s&&(0,G.jsx)(Yle,{onUndo:v,onRedo:y,onReset:b,language:O})]});return(0,G.jsxs)(pue,{className:r,children:[(0,G.jsx)(mue,{children:a?(0,G.jsx)(M9,{title:o,children:F}):F}),(0,G.jsx)(`div`,{ref:e=>this.labelNode=e}),(0,G.jsx)(Qoe,{axesSettings:n,backgroundMarks:j,coordinatesOnHover:i,currentTool:e,disabledLabels:c,disabledTitle:l,domain:u,labels:f,labelModeEnabled:t,labelsPlaceholders:p,marks:M,onChangeMarks:s?void 0:h,onChangeLabels:m,onChangeTitle:g,range:x,size:S,showLabels:C,showPixelGuides:w,showTitle:T,title:E,titlePlaceholder:D,tools:P,removeIncompleteTool:k,limitLabeling:A})]})}},Cue=()=>e=>t=>e(t);M();var wue=Ose(e=>({marks:e.marks.present}),e=>({onChangeMarks:t=>e(e7(t)),onUndo:()=>e(V5.undo()),onRedo:()=>e(V5.redo()),onReset:()=>e(e7([]))}))(N9),Tue=class extends W.Component{static propTypes={onChangeMarks:j.func,marks:j.array};constructor(e){super(e);let t=Rse();this.store=P5(t,{marks:e.marks},use(Cue)),this.store.subscribe(this.onStoreChange)}componentDidUpdate(e){let{marks:t}=this.props;mp(this.store.getState().marks.present,t)||mp(e.marks,t)||this.store.dispatch(e7(t))}onStoreChange=()=>{let{marks:e,onChangeMarks:t}=this.props,n=this.store.getState();mp(n.marks.present,e)||t(n.marks.present)};render(){let{onChangeMarks:e,marks:t,...n}=this.props,r=t&&t.find(e=>e.correctness);return r?(0,G.jsx)(N9,{...n,marks:t,disabled:r}):(0,G.jsx)(w5,{store:this.store,children:(0,G.jsx)(wue,{...n})})}};M();var Eue=J(`div`)(()=>({backgroundColor:X.WHITE,padding:`20px`,width:`355px`,boxShadow:`0px 1px 5px 0px #9297A6`})),P9=J(`div`)({display:`flex`,alignItems:`center`,padding:`10px`}),Due=J(`div`)(({theme:e})=>({fontSize:e.typography.h6.fontSize,marginLeft:`30px`,fontWeight:`700`,marginBottom:`10px`})),F9=J(`div`)({textAlign:`right`,marginRight:`10px`,width:`175px`,fontSize:`15px`}),I9=({className:e,isLabelAvailable:t})=>(0,G.jsxs)(Eue,{className:e,children:[(0,G.jsx)(Due,{children:`Key`}),t&&(0,G.jsxs)(P9,{children:[(0,G.jsx)(F9,{children:` Missing Required Label `}),(0,G.jsxs)(`svg`,{width:`34`,height:`16`,viewBox:`0 0 34 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`33`,height:`15`,rx:`3.5`,fill:`white`,stroke:`#BF0D00`}),(0,G.jsx)(`path`,{d:`M17.25 6.13965V3.2334C17.25 2.92871 17.4844 2.6709 17.8125 2.6709H20.7188C20.8594 2.6709 21 2.81152 21 2.95215V3.51465C21 3.67871 20.8594 3.7959 20.7188 3.7959H18.375V6.13965C18.375 6.30371 18.2344 6.4209 18.0938 6.4209H17.5312C17.3672 6.4209 17.25 6.30371 17.25 6.13965ZM24 2.95215C24 2.81152 24.1172 2.6709 24.2812 2.6709H27.1875C27.4922 2.6709 27.75 2.92871 27.75 3.2334V6.13965C27.75 6.30371 27.6094 6.4209 27.4688 6.4209H26.9062C26.7422 6.4209 26.625 6.30371 26.625 6.13965V3.7959H24.2812C24.1172 3.7959 24 3.67871 24 3.51465V2.95215ZM27.4688 9.4209C27.6094 9.4209 27.75 9.56152 27.75 9.70215V12.6084C27.75 12.9365 27.4922 13.1709 27.1875 13.1709H24.2812C24.1172 13.1709 24 13.0537 24 12.8896V12.3271C24 12.1865 24.1172 12.0459 24.2812 12.0459H26.625V9.70215C26.625 9.56152 26.7422 9.4209 26.9062 9.4209H27.4688ZM21 12.8896C21 13.0537 20.8594 13.1709 20.7188 13.1709H17.8125C17.4844 13.1709 17.25 12.9365 17.25 12.6084V9.70215C17.25 9.56152 17.3672 9.4209 17.5312 9.4209H18.0938C18.2344 9.4209 18.375 9.56152 18.375 9.70215V12.0459H20.7188C20.8594 12.0459 21 12.1865 21 12.3271V12.8896Z`,fill:`#BF0D00`}),(0,G.jsx)(`path`,{d:`M9.23438 8.21045L10.9219 9.89795C11.0156 9.9917 11.0156 10.1636 10.9219 10.2573L10.5312 10.6479C10.4375 10.7417 10.2656 10.7417 10.1719 10.6479L8.5 8.96045L6.8125 10.6479C6.71875 10.7417 6.54688 10.7417 6.45312 10.6479L6.0625 10.2573C5.96875 10.1636 5.96875 9.9917 6.0625 9.89795L7.75 8.21045L6.0625 6.53857C5.96875 6.44482 5.96875 6.27295 6.0625 6.1792L6.45312 5.78857C6.54688 5.69482 6.71875 5.69482 6.8125 5.78857L8.5 7.47607L10.1719 5.78857C10.2656 5.69482 10.4375 5.69482 10.5312 5.78857L10.9219 6.1792C11.0156 6.27295 11.0156 6.44482 10.9219 6.53857L9.23438 8.21045Z`,fill:`#BF0D00`})]})]}),(0,G.jsxs)(P9,{children:[(0,G.jsx)(F9,{children:` Answer Key Correct `}),(0,G.jsxs)(`svg`,{width:`75`,height:`15`,viewBox:`0 0 75 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,G.jsx)(`circle`,{cx:`7.5`,cy:`7.5`,r:`7.5`,fill:`#6A78A1`}),(0,G.jsx)(`path`,{d:`M3.125 5.76562V3.34375C3.125 3.08984 3.32031 2.875 3.59375 2.875H6.01562C6.13281 2.875 6.25 2.99219 6.25 3.10938V3.89062C6.25 4.02734 6.13281 4.125 6.01562 4.125H4.375V5.76562C4.375 5.90234 4.25781 6 4.14062 6H3.35938C3.22266 6 3.125 5.90234 3.125 5.76562ZM8.75 3.10938C8.75 2.99219 8.84766 2.875 8.98438 2.875H11.4062C11.6602 2.875 11.875 3.08984 11.875 3.34375V5.76562C11.875 5.90234 11.7578 6 11.6406 6H10.8594C10.7227 6 10.625 5.90234 10.625 5.76562V4.125H8.98438C8.84766 4.125 8.75 4.02734 8.75 3.89062V3.10938ZM11.6406 8.5C11.7578 8.5 11.875 8.61719 11.875 8.73438V11.1562C11.875 11.4297 11.6602 11.625 11.4062 11.625H8.98438C8.84766 11.625 8.75 11.5273 8.75 11.3906V10.6094C8.75 10.4922 8.84766 10.375 8.98438 10.375H10.625V8.73438C10.625 8.61719 10.7227 8.5 10.8594 8.5H11.6406ZM6.25 11.3906C6.25 11.5273 6.13281 11.625 6.01562 11.625H3.59375C3.32031 11.625 3.125 11.4297 3.125 11.1562V8.73438C3.125 8.61719 3.22266 8.5 3.35938 8.5H4.14062C4.25781 8.5 4.375 8.61719 4.375 8.73438V10.375H6.01562C6.13281 10.375 6.25 10.4922 6.25 10.6094V11.3906Z`,fill:`white`}),(0,G.jsx)(`path`,{d:`M75 7L15 7`,stroke:`#6A78A1`,strokeDasharray:`4 2`})]})]}),t&&(0,G.jsxs)(P9,{children:[(0,G.jsx)(F9,{children:` Answer Key Correct Label `}),(0,G.jsxs)(`svg`,{width:`30`,height:`16`,viewBox:`0 0 30 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`29`,height:`15`,rx:`3.5`,fill:`white`}),(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`29`,height:`15`,rx:`3.5`,stroke:`#6A78A1`}),(0,G.jsx)(`path`,{d:`M4.37793 10.2061H6.58984V11.5H2.91309V4.44434H4.37793V10.2061ZM11.6387 10.1377C11.6387 10.6715 11.6794 11.0801 11.7607 11.3633V11.5H10.4473L10.335 10.9531C10.1559 11.168 9.92155 11.3291 9.63184 11.4365C9.34212 11.5439 9.03939 11.5977 8.72363 11.5977C8.55762 11.5977 8.40137 11.583 8.25488 11.5537C8.1084 11.5244 7.9668 11.4756 7.83008 11.4072C7.69661 11.3356 7.58105 11.2477 7.4834 11.1436C7.38574 11.0394 7.30762 10.9076 7.24902 10.748C7.19043 10.5853 7.16113 10.403 7.16113 10.2012C7.16113 9.99935 7.19206 9.81868 7.25391 9.65918C7.31576 9.49642 7.39714 9.3597 7.49805 9.24902C7.59896 9.13835 7.73079 9.03906 7.89355 8.95117C8.05632 8.86328 8.22233 8.79167 8.3916 8.73633C8.56087 8.68099 8.75944 8.62891 8.9873 8.58008L9.8125 8.39453C9.98828 8.35221 10.112 8.30013 10.1836 8.23828C10.2585 8.17318 10.2959 8.08854 10.2959 7.98438C10.2959 7.75977 10.2129 7.59863 10.0469 7.50098C9.88411 7.40332 9.68555 7.35449 9.45117 7.35449C8.875 7.35449 8.54785 7.61003 8.46973 8.12109L7.22461 7.89648C7.32878 7.37891 7.57129 6.99805 7.95215 6.75391C8.33301 6.50651 8.85872 6.38281 9.5293 6.38281C10.9355 6.38281 11.6387 6.98665 11.6387 8.19434V10.1377ZM9.16309 10.6455C9.5179 10.6455 9.80762 10.5251 10.0322 10.2842C10.2568 10.04 10.3691 9.68034 10.3691 9.20508L9.17773 9.54199C8.95964 9.59408 8.79199 9.66243 8.6748 9.74707C8.56087 9.83171 8.50391 9.95215 8.50391 10.1084C8.50391 10.2809 8.56576 10.4144 8.68945 10.5088C8.81315 10.5999 8.97103 10.6455 9.16309 10.6455ZM15.96 6.38281C16.2887 6.38281 16.5996 6.44303 16.8926 6.56348C17.1855 6.68392 17.4411 6.85482 17.6592 7.07617C17.8805 7.29427 18.0547 7.56934 18.1816 7.90137C18.3086 8.2334 18.3721 8.59961 18.3721 9C18.3721 9.40039 18.3086 9.7666 18.1816 10.0986C18.0547 10.4307 17.8805 10.7074 17.6592 10.9287C17.4411 11.1468 17.1855 11.3161 16.8926 11.4365C16.5996 11.557 16.2887 11.6172 15.96 11.6172C15.6084 11.6172 15.291 11.5505 15.0078 11.417C14.7279 11.2803 14.5179 11.0898 14.3779 10.8457L14.3438 11.5H13.0107V4H14.417V7.09082C14.5602 6.86621 14.7686 6.69206 15.042 6.56836C15.3187 6.44466 15.6247 6.38281 15.96 6.38281ZM15.6328 10.4502C16.0169 10.4502 16.3343 10.3184 16.585 10.0547C16.8389 9.79102 16.9658 9.43945 16.9658 9C16.9658 8.55729 16.8389 8.2041 16.585 7.94043C16.3343 7.67676 16.0169 7.54492 15.6328 7.54492C15.2552 7.54492 14.9395 7.68001 14.6855 7.9502C14.4316 8.21712 14.3047 8.56706 14.3047 9C14.3047 9.43294 14.43 9.78288 14.6807 10.0498C14.9346 10.3167 15.252 10.4502 15.6328 10.4502ZM24.1582 8.91699L24.1436 9.25391H20.4229C20.4521 9.6543 20.5856 9.96029 20.8232 10.1719C21.0609 10.3835 21.3555 10.4893 21.707 10.4893C21.9609 10.4893 22.1807 10.4323 22.3662 10.3184C22.555 10.2012 22.6966 10.0319 22.791 9.81055L24.0801 10.001C23.9141 10.5055 23.6211 10.8978 23.2012 11.1777C22.7812 11.4577 22.2865 11.5977 21.7168 11.5977C20.8965 11.5977 20.2438 11.3682 19.7588 10.9092C19.277 10.4469 19.0361 9.80729 19.0361 8.99023C19.0361 8.17969 19.2786 7.54167 19.7637 7.07617C20.2487 6.60742 20.8851 6.37305 21.6729 6.37305C22.4215 6.37305 23.0221 6.58626 23.4746 7.0127C23.9271 7.43913 24.1549 8.07389 24.1582 8.91699ZM21.6826 7.36914C20.999 7.36914 20.5921 7.69141 20.4619 8.33594H22.7666C22.7308 8.02344 22.6152 7.78418 22.4199 7.61816C22.2246 7.45215 21.9788 7.36914 21.6826 7.36914ZM25.2275 11.5V4H26.6484V11.5H25.2275Z`,fill:`#6A78A1`})]})]}),(0,G.jsxs)(P9,{children:[(0,G.jsx)(F9,{children:` Student Incorrect `}),(0,G.jsxs)(`svg`,{width:`77`,height:`16`,viewBox:`0 0 77 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,G.jsx)(`circle`,{cx:`8`,cy:`8`,r:`8`,fill:`#BF0D00`}),(0,G.jsx)(`path`,{d:`M9.04688 8.5L11.3906 10.8672C11.6953 11.1484 11.6953 11.6172 11.3906 11.8984L10.875 12.4141C10.5938 12.7188 10.125 12.7188 9.84375 12.4141L7.5 10.0703L5.13281 12.4141C4.85156 12.7188 4.38281 12.7188 4.10156 12.4141L3.58594 11.8984C3.28125 11.6172 3.28125 11.1484 3.58594 10.8672L5.92969 8.5L3.58594 6.15625C3.28125 5.875 3.28125 5.40625 3.58594 5.125L4.10156 4.60938C4.38281 4.30469 4.85156 4.30469 5.13281 4.60938L7.5 6.95312L9.84375 4.60938C10.125 4.30469 10.5938 4.30469 10.875 4.60938L11.3906 5.125C11.6953 5.40625 11.6953 5.875 11.3906 6.15625L9.04688 8.5Z`,fill:`white`}),(0,G.jsx)(`path`,{d:`M77 8L15 8`,stroke:`#BF0D00`,strokeWidth:`3`})]})]}),t&&(0,G.jsxs)(P9,{children:[(0,G.jsx)(F9,{children:` Incorrect Student Label `}),(0,G.jsxs)(`svg`,{width:`42`,height:`16`,viewBox:`0 0 42 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`41`,height:`15`,rx:`3.5`,fill:`white`}),(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`41`,height:`15`,rx:`3.5`,stroke:`#BF0D00`}),(0,G.jsx)(`path`,{d:`M7.23438 8.5L8.92188 10.1875C9.01562 10.2812 9.01562 10.4531 8.92188 10.5469L8.53125 10.9375C8.4375 11.0312 8.26562 11.0312 8.17188 10.9375L6.5 9.25L4.8125 10.9375C4.71875 11.0312 4.54688 11.0312 4.45312 10.9375L4.0625 10.5469C3.96875 10.4531 3.96875 10.2812 4.0625 10.1875L5.75 8.5L4.0625 6.82812C3.96875 6.73438 3.96875 6.5625 4.0625 6.46875L4.45312 6.07812C4.54688 5.98438 4.71875 5.98438 4.8125 6.07812L6.5 7.76562L8.17188 6.07812C8.26562 5.98438 8.4375 5.98438 8.53125 6.07812L8.92188 6.46875C9.01562 6.5625 9.01562 6.73438 8.92188 6.82812L7.23438 8.5Z`,fill:`#BF0D00`}),(0,G.jsx)(`path`,{d:`M14.9531 10.7041H17.3408V11.5H14.0791V4.625H14.9531V10.7041ZM19.5869 11.5928C19.1605 11.5928 18.8089 11.4837 18.5322 11.2656C18.2588 11.0443 18.1221 10.7155 18.1221 10.2793C18.1221 10.0384 18.166 9.83008 18.2539 9.6543C18.3418 9.47526 18.472 9.32878 18.6445 9.21484C18.8171 9.10091 19.0042 9.01139 19.2061 8.94629C19.4111 8.87793 19.6553 8.81934 19.9385 8.77051L20.7148 8.64355C20.998 8.59147 21.1396 8.44336 21.1396 8.19922C21.1396 7.8737 21.0387 7.63607 20.8369 7.48633C20.6383 7.33333 20.3861 7.25684 20.0801 7.25684C19.7806 7.25684 19.5299 7.33008 19.3281 7.47656C19.1263 7.62305 19.0075 7.84766 18.9717 8.15039L18.21 7.98926C18.2816 7.53353 18.4818 7.19173 18.8105 6.96387C19.1393 6.73275 19.5755 6.61719 20.1191 6.61719C20.373 6.61719 20.6042 6.64648 20.8125 6.70508C21.0241 6.76042 21.2178 6.84993 21.3936 6.97363C21.5726 7.09408 21.7109 7.2666 21.8086 7.49121C21.9095 7.71257 21.96 7.97461 21.96 8.27734V10.2598C21.96 10.5072 21.9958 10.6748 22.0674 10.7627C22.1423 10.8473 22.2692 10.8896 22.4482 10.8896H22.5264V11.5H22.1064C21.5889 11.5 21.2861 11.2835 21.1982 10.8506H21.1592C20.7946 11.3454 20.2705 11.5928 19.5869 11.5928ZM19.7822 10.9092C20.2087 10.9092 20.5521 10.7546 20.8125 10.4453C21.0729 10.1361 21.2031 9.71289 21.2031 9.17578L19.9336 9.41992C19.5983 9.47526 19.3493 9.56478 19.1865 9.68848C19.027 9.80892 18.9473 9.98307 18.9473 10.2109C18.9473 10.4486 19.0238 10.6243 19.1768 10.7383C19.333 10.8522 19.5348 10.9092 19.7822 10.9092ZM26.2666 6.60742C26.8916 6.60742 27.4206 6.83854 27.8535 7.30078C28.2865 7.76302 28.5029 8.36361 28.5029 9.10254C28.5029 9.84473 28.2881 10.4469 27.8584 10.9092C27.4287 11.3714 26.8981 11.6025 26.2666 11.6025C25.889 11.6025 25.5472 11.5098 25.2412 11.3242C24.9385 11.1387 24.7106 10.8864 24.5576 10.5674L24.5381 11.5H23.7227V4H24.5625L24.5674 7.61816C24.7236 7.30566 24.9515 7.0599 25.251 6.88086C25.5537 6.69857 25.8923 6.60742 26.2666 6.60742ZM26.0811 10.8701C26.527 10.8701 26.9014 10.7074 27.2041 10.3818C27.5068 10.0531 27.6582 9.62663 27.6582 9.10254C27.6582 8.57845 27.5068 8.15365 27.2041 7.82812C26.9014 7.49935 26.527 7.33496 26.0811 7.33496C25.6416 7.33496 25.2705 7.50423 24.9678 7.84277C24.665 8.18132 24.5137 8.60124 24.5137 9.10254C24.5137 9.6071 24.6634 10.0286 24.9629 10.3672C25.2656 10.7025 25.6383 10.8701 26.0811 10.8701ZM34.0352 9.00488L34.0254 9.23438H30.2754C30.2884 9.76823 30.4414 10.1784 30.7344 10.4648C31.0273 10.748 31.3919 10.8896 31.8281 10.8896C32.1211 10.8896 32.3864 10.8132 32.624 10.6602C32.8617 10.5072 33.0439 10.2956 33.1709 10.0254L33.9326 10.1865C33.7601 10.6227 33.4867 10.9661 33.1123 11.2168C32.738 11.4674 32.3132 11.5928 31.8379 11.5928C31.125 11.5928 30.5488 11.3698 30.1094 10.9238C29.6699 10.4779 29.4502 9.86914 29.4502 9.09766C29.4502 8.32943 29.6699 7.72233 30.1094 7.27637C30.5521 6.8304 31.1201 6.60742 31.8135 6.60742C32.484 6.60742 33.0212 6.8125 33.4248 7.22266C33.8317 7.63281 34.0352 8.22689 34.0352 9.00488ZM31.8135 7.25684C31.4163 7.25684 31.0827 7.37077 30.8125 7.59863C30.5456 7.82324 30.3779 8.15202 30.3096 8.58496H33.1855C33.153 8.15202 33.013 7.82324 32.7656 7.59863C32.5182 7.37077 32.2008 7.25684 31.8135 7.25684ZM35.3633 11.5V4H36.2178V11.5H35.3633Z`,fill:`#BF0D00`})]})]}),(0,G.jsxs)(P9,{children:[(0,G.jsx)(F9,{children:` Student Correct `}),(0,G.jsxs)(`svg`,{width:`76`,height:`16`,viewBox:`0 0 76 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,G.jsx)(`path`,{d:`M76 8L14 8`,stroke:`#0B7D38`,strokeWidth:`3`}),(0,G.jsx)(`circle`,{cx:`8`,cy:`8`,r:`8`,fill:`#0B7D38`}),(0,G.jsx)(`path`,{d:`M12.1953 4.46875C12.3125 4.35156 12.5 4.35156 12.5938 4.46875L13.2734 5.125C13.3672 5.24219 13.3672 5.42969 13.2734 5.52344L6.24219 12.5547C6.125 12.6719 5.96094 12.6719 5.84375 12.5547L2.70312 9.4375C2.60938 9.32031 2.60938 9.13281 2.70312 9.03906L3.38281 8.35938C3.47656 8.26562 3.66406 8.26562 3.78125 8.35938L6.03125 10.6328L12.1953 4.46875Z`,fill:`white`}),` `]})]}),t&&(0,G.jsxs)(P9,{children:[(0,G.jsx)(F9,{children:` Student Correct Label `}),(0,G.jsxs)(`svg`,{width:`43`,height:`16`,viewBox:`0 0 43 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`42`,height:`15`,rx:`3.5`,fill:`white`}),(0,G.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`42`,height:`15`,rx:`3.5`,stroke:`#0B7D38`}),(0,G.jsx)(`path`,{d:`M11.7969 5.3125C11.875 5.23438 12 5.23438 12.0625 5.3125L12.5156 5.75C12.5781 5.82812 12.5781 5.95312 12.5156 6.01562L7.82812 10.7031C7.75 10.7812 7.64062 10.7812 7.5625 10.7031L5.46875 8.625C5.40625 8.54688 5.40625 8.42188 5.46875 8.35938L5.92188 7.90625C5.98438 7.84375 6.10938 7.84375 6.1875 7.90625L7.6875 9.42188L11.7969 5.3125Z`,fill:`#0B7D38`}),(0,G.jsx)(`path`,{d:`M15.9531 10.7041H18.3408V11.5H15.0791V4.625H15.9531V10.7041ZM20.5869 11.5928C20.1605 11.5928 19.8089 11.4837 19.5322 11.2656C19.2588 11.0443 19.1221 10.7155 19.1221 10.2793C19.1221 10.0384 19.166 9.83008 19.2539 9.6543C19.3418 9.47526 19.472 9.32878 19.6445 9.21484C19.8171 9.10091 20.0042 9.01139 20.2061 8.94629C20.4111 8.87793 20.6553 8.81934 20.9385 8.77051L21.7148 8.64355C21.998 8.59147 22.1396 8.44336 22.1396 8.19922C22.1396 7.8737 22.0387 7.63607 21.8369 7.48633C21.6383 7.33333 21.3861 7.25684 21.0801 7.25684C20.7806 7.25684 20.5299 7.33008 20.3281 7.47656C20.1263 7.62305 20.0075 7.84766 19.9717 8.15039L19.21 7.98926C19.2816 7.53353 19.4818 7.19173 19.8105 6.96387C20.1393 6.73275 20.5755 6.61719 21.1191 6.61719C21.373 6.61719 21.6042 6.64648 21.8125 6.70508C22.0241 6.76042 22.2178 6.84993 22.3936 6.97363C22.5726 7.09408 22.7109 7.2666 22.8086 7.49121C22.9095 7.71257 22.96 7.97461 22.96 8.27734V10.2598C22.96 10.5072 22.9958 10.6748 23.0674 10.7627C23.1423 10.8473 23.2692 10.8896 23.4482 10.8896H23.5264V11.5H23.1064C22.5889 11.5 22.2861 11.2835 22.1982 10.8506H22.1592C21.7946 11.3454 21.2705 11.5928 20.5869 11.5928ZM20.7822 10.9092C21.2087 10.9092 21.5521 10.7546 21.8125 10.4453C22.0729 10.1361 22.2031 9.71289 22.2031 9.17578L20.9336 9.41992C20.5983 9.47526 20.3493 9.56478 20.1865 9.68848C20.027 9.80892 19.9473 9.98307 19.9473 10.2109C19.9473 10.4486 20.0238 10.6243 20.1768 10.7383C20.333 10.8522 20.5348 10.9092 20.7822 10.9092ZM27.2666 6.60742C27.8916 6.60742 28.4206 6.83854 28.8535 7.30078C29.2865 7.76302 29.5029 8.36361 29.5029 9.10254C29.5029 9.84473 29.2881 10.4469 28.8584 10.9092C28.4287 11.3714 27.8981 11.6025 27.2666 11.6025C26.889 11.6025 26.5472 11.5098 26.2412 11.3242C25.9385 11.1387 25.7106 10.8864 25.5576 10.5674L25.5381 11.5H24.7227V4H25.5625L25.5674 7.61816C25.7236 7.30566 25.9515 7.0599 26.251 6.88086C26.5537 6.69857 26.8923 6.60742 27.2666 6.60742ZM27.0811 10.8701C27.527 10.8701 27.9014 10.7074 28.2041 10.3818C28.5068 10.0531 28.6582 9.62663 28.6582 9.10254C28.6582 8.57845 28.5068 8.15365 28.2041 7.82812C27.9014 7.49935 27.527 7.33496 27.0811 7.33496C26.6416 7.33496 26.2705 7.50423 25.9678 7.84277C25.665 8.18132 25.5137 8.60124 25.5137 9.10254C25.5137 9.6071 25.6634 10.0286 25.9629 10.3672C26.2656 10.7025 26.6383 10.8701 27.0811 10.8701ZM35.0352 9.00488L35.0254 9.23438H31.2754C31.2884 9.76823 31.4414 10.1784 31.7344 10.4648C32.0273 10.748 32.3919 10.8896 32.8281 10.8896C33.1211 10.8896 33.3864 10.8132 33.624 10.6602C33.8617 10.5072 34.0439 10.2956 34.1709 10.0254L34.9326 10.1865C34.7601 10.6227 34.4867 10.9661 34.1123 11.2168C33.738 11.4674 33.3132 11.5928 32.8379 11.5928C32.125 11.5928 31.5488 11.3698 31.1094 10.9238C30.6699 10.4779 30.4502 9.86914 30.4502 9.09766C30.4502 8.32943 30.6699 7.72233 31.1094 7.27637C31.5521 6.8304 32.1201 6.60742 32.8135 6.60742C33.484 6.60742 34.0212 6.8125 34.4248 7.22266C34.8317 7.63281 35.0352 8.22689 35.0352 9.00488ZM32.8135 7.25684C32.4163 7.25684 32.0827 7.37077 31.8125 7.59863C31.5456 7.82324 31.3779 8.15202 31.3096 8.58496H34.1855C34.153 8.15202 34.013 7.82324 33.7656 7.59863C33.5182 7.37077 33.2008 7.25684 32.8135 7.25684ZM36.3633 11.5V4H37.2178V11.5H36.3633Z`,fill:`#0B7D38`})]})]})]});I9.propTypes={className:j.string,isLabelAvailable:j.bool},M();var L9=`height ease-in 300ms, opacity ease-in 300ms`,Oue=J(`div`)(()=>({position:`relative`,height:0,overflow:`hidden`,display:`flex`,visibility:`hidden`,width:0,"&.enter":{transition:L9,opacity:1,height:`auto`,width:`auto`,visibility:`visible`,minHeight:`25px`},"&.enter-done":{height:`auto`,visibility:`visible`,width:`auto`,minHeight:`25px`},"&.exit":{transition:L9,opacity:0,height:0,visibility:`visible`,width:0},"&.exit-done":{opacity:0,visibility:`hidden`,height:0,width:0}})),R9=e=>{let{show:t,children:n,className:r}=e,i=(0,W.useRef)(null);return(0,G.jsx)(Xg,{nodeRef:i,in:t,appear:!0,mountOnEnter:!1,timeout:300,classNames:{enter:`enter`,enterDone:`enter-done`,exit:`exit`,exitDone:`exit-done`},children:(0,G.jsx)(Oue,{ref:i,className:r,children:n})})};R9.propTypes={show:j.bool.isRequired,className:j.string,children:j.oneOfType([j.arrayOf(j.node),j.node]).isRequired},M();function z9(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function B9(e,t){return!e||z9(e)?e:z9(e.default)?e.default:t&&z9(e[t])?e[t]:t&&z9(e[t]?.default)?e[t].default:e}var kue=B9(jb,`Readable`)||B9(Aue.Readable,`Readable`),V9=ix,H9=V9.default,Aue=H9&&typeof H9==`object`?H9:V9,{translator:U9}=C9,jue={WebkitTouchCallout:`none`,WebkitUserSelect:`none`,KhtmlUserSelect:`none`,MozUserSelect:`none`,msUserSelect:`none`,userSelect:`none`},Mue=J(`div`)(()=>({width:`100%`,cursor:`pointer`})),Nue=J(`div`)(()=>({margin:`0 auto`,textAlign:`center`,display:`flex`})),Pue=J(`div`)(()=>({width:`fit-content`,minWidth:`140px`,alignSelf:`center`,verticalAlign:`middle`,color:`var(--correct-answer-toggle-label-color, ${iv()})`,fontWeight:`normal`,...jue})),W9=J(`div`)(()=>({position:`absolute`,width:`25px`,"&.enter":{opacity:`0`},"&.enter-active":{opacity:`1`,transition:`opacity 0.3s ease-in`},"&.exit":{opacity:`1`},"&.exit-active":{opacity:`0`,transition:`opacity 0.3s ease-in`}})),Fue=J(`div`)(()=>({width:`25px`,marginRight:`5px`,display:`flex`,alignItems:`center`})),Iue=class e extends W.Component{static propTypes={onToggle:j.func,toggled:j.bool,show:j.bool,hideMessage:j.string,showMessage:j.string,className:j.string,language:j.string};static defaultProps={showMessage:`Show correct answer`,hideMessage:`Hide correct answer`,show:!1,toggled:!1};constructor(t){super(t),this.state={show:t.show},this.openIconRef=W.createRef(),this.closedIconRef=W.createRef(),e.defaultProps={...e.defaultProps,showMessage:U9.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:U9.t(`common:hideCorrectAnswer`,{lng:t.language})}}onClick(){this.props.onToggle(!this.props.toggled)}onTouch(e){e.preventDefault(),this.props.onToggle(!this.props.toggled)}UNSAFE_componentWillReceiveProps(t){this.setState({show:t.show}),t.language!==this.props?.language&&(e.defaultProps={...e.defaultProps,showMessage:U9.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:U9.t(`common:hideCorrectAnswer`,{lng:t.language})})}render(){let{className:e,toggled:t,hideMessage:n,showMessage:r}=this.props;return(0,G.jsx)(Mue,{className:e,children:(0,G.jsx)(R9,{show:this.state.show,children:(0,G.jsxs)(Nue,{onClick:this.onClick.bind(this),onTouchEnd:this.onTouch.bind(this),children:[(0,G.jsxs)(Fue,{children:[(0,G.jsx)(Xg,{nodeRef:this.openIconRef,timeout:400,in:t,exit:!t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,G.jsx)(W9,{ref:this.openIconRef,children:(0,G.jsx)(ng,{open:t},`correct-open`)})}),(0,G.jsx)(Xg,{nodeRef:this.closedIconRef,timeout:5e3,in:!t,exit:t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,G.jsx)(W9,{ref:this.closedIconRef,children:(0,G.jsx)(ng,{open:t},`correct-closed`)})})]}),(0,G.jsx)(kue,{false:!0,children:(0,G.jsx)(Pue,{"aria-hidden":!this.state.show,children:t?n:r})})]})})})}};M();function G9(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function K9(e,t){return!e||G9(e)?e:G9(e.default)?e.default:t&&G9(e[t])?e[t]:t&&G9(e[t]?.default)?e[t].default:e}var Lue=K9(eb,`UiLayout`)||K9(Z9.UiLayout,`UiLayout`),q9=K9(Ab,`PreviewPrompt`)||K9(Z9.PreviewPrompt,`PreviewPrompt`),J9=K9(dy,`Collapsible`)||K9(Z9.Collapsible,`Collapsible`),Y9=ix,X9=Y9.default,Z9=X9&&typeof X9==`object`?X9:Y9,Rue=J(Lue)({color:iv(),backgroundColor:Tv()}),zue=J(J9)(({theme:e})=>({marginBottom:e.spacing(2)})),Q9=J(Tue)(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2)})),Bue=class extends W.Component{static propTypes={model:j.object.isRequired,session:j.object.isRequired,onAnswersChange:j.func};state={showingCorrect:!1};toggleCorrect=e=>this.setState({showingCorrect:e});render(){let{model:e,onAnswersChange:t,session:n}=this.props,{showingCorrect:r}=this.state,{answer:i}=n||{},{answersCorrected:a,arrows:o,backgroundMarks:s,coordinatesOnHover:c,correctResponse:l,defaultTool:u,disabled:d,domain:f,extraCSSRules:p,labels:m,labelsEnabled:h,prompt:g,range:_,rationale:v,showKeyLegend:y,showToggle:b,title:x,titleEnabled:S,teacherInstructions:C,toolbarTools:w,language:T}=e||{},E=e?.size||e?.graph||{},D=a||i||[],O=w?.includes(`label`)||!1,k=e.rationale&&(Fb(e.rationale)||Lb(e.rationale));return(0,G.jsxs)(Rue,{extraCSSRules:p,children:[e.teacherInstructions&&(Fb(e.teacherInstructions)||Lb(e.teacherInstructions))&&(0,G.jsx)(zue,{labels:{hidden:`Show Teacher Instructions`,visible:`Hide Teacher Instructions`},children:(0,G.jsx)(q9,{prompt:C})}),g&&(0,G.jsx)(q9,{className:`prompt`,prompt:g}),(0,G.jsx)(Iue,{show:b,toggled:r,onToggle:this.toggleCorrect,language:T}),r&&b?(0,G.jsx)(Q9,{axesSettings:{includeArrows:o},backgroundMarks:s.filter(e=>!e.building),coordinatesOnHover:c,disabled:!0,disabledLabels:!0,disabledTitle:!0,domain:f,labels:m,marks:l.map(e=>({...e,correctness:`correct`})),onChangeMarks:t,range:_,showLabels:h,showTitle:S,size:E,title:x,toolbarTools:w,language:T}):(0,G.jsx)(Q9,{axesSettings:{includeArrows:o},backgroundMarks:s.filter(e=>!e.building),coordinatesOnHover:c,defaultTool:u,disabled:d,disabledLabels:!0,disabledTitle:!0,domain:f,labels:m,marks:D,onChangeMarks:t,range:_,showLabels:h,showTitle:S,size:E,title:x,toolbarTools:w,language:T,limitLabeling:!0}),y&&!r&&(0,G.jsx)(I9,{isLabelAvailable:O}),k&&(0,G.jsx)(J9,{labels:{hidden:`Show Rationale`,visible:`Hide Rationale`},children:(0,G.jsx)(q9,{prompt:v})})]})}},Vue=v(),$9=class extends HTMLElement{constructor(){super(),this._root=null}set model(e){this._model=e,this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}connectedCallback(){this._render()}isComplete=e=>Array.isArray(e)&&e.length>0;changeAnswers=e=>{this._session.answer=e,this.dispatchEvent(new y(this.tagName.toLowerCase(),this.isComplete(this._session.answer))),this._render()};_render(){if(!this._model||!this._session)return;let e=W.createElement(Bue,{model:this._model,session:this._session,onAnswersChange:this.changeAnswers});this._root||=(0,Vue.createRoot)(this),this._root.render(e),queueMicrotask(()=>{D(this)})}disconnectedCallback(){this._root&&this._root.unmount()}};return typeof window<`u`&&!customElements.get(`graphing-element`)&&customElements.define(`graphing-element`,$9),$9})();