@pie-element/graphing-solution-set 6.4.0-beta.7 → 7.0.0-next.20261002094057

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 (100) hide show
  1. package/author.js +2 -0
  2. package/configure.js +2 -0
  3. package/controller.js +1 -0
  4. package/dist/author/configure.d.ts +26 -0
  5. package/dist/author/configure.js +190 -0
  6. package/dist/author/correct-response.d.ts +33 -0
  7. package/dist/author/correct-response.js +206 -0
  8. package/dist/author/defaults.d.ts +238 -0
  9. package/dist/author/defaults.js +339 -0
  10. package/dist/author/graphing-config.d.ts +33 -0
  11. package/dist/author/graphing-config.js +237 -0
  12. package/dist/author/index.d.ts +63 -0
  13. package/dist/author/index.js +95 -0
  14. package/dist/author/utils.d.ts +46 -0
  15. package/dist/author/utils.js +474 -0
  16. package/dist/browser/alert-dialog-mARgEnYR.js +50672 -0
  17. package/dist/browser/alert-dialog-mARgEnYR.js.map +1 -0
  18. package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
  19. package/dist/browser/author/index.js +3833 -0
  20. package/dist/browser/author/index.js.map +1 -0
  21. package/dist/browser/browser-bbrzkX59.js +352 -0
  22. package/dist/browser/browser-bbrzkX59.js.map +1 -0
  23. package/dist/browser/controller/index.js +193 -0
  24. package/dist/browser/controller/index.js.map +1 -0
  25. package/dist/browser/delivery/index.js +781 -0
  26. package/dist/browser/delivery/index.js.map +1 -0
  27. package/dist/browser/editor-runtime/alert-dialog-1f82g6Ih.js +34263 -0
  28. package/dist/browser/editor-runtime/alert-dialog-1f82g6Ih.js.map +1 -0
  29. package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
  30. package/dist/browser/editor-runtime/author/index.js +3833 -0
  31. package/dist/browser/editor-runtime/author/index.js.map +1 -0
  32. package/dist/browser/editor-runtime/browser-d5JHIrvC.js +352 -0
  33. package/dist/browser/editor-runtime/browser-d5JHIrvC.js.map +1 -0
  34. package/dist/browser/editor-runtime/controller/index.js +193 -0
  35. package/dist/browser/editor-runtime/controller/index.js.map +1 -0
  36. package/dist/browser/editor-runtime/delivery/index.js +781 -0
  37. package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
  38. package/dist/controller/defaults.d.ts +64 -0
  39. package/dist/controller/defaults.js +54 -0
  40. package/dist/controller/index.d.ts +24 -0
  41. package/dist/controller/index.js +110 -0
  42. package/dist/controller/utils.d.ts +20 -0
  43. package/dist/controller/utils.js +39 -0
  44. package/dist/delivery/index.d.ts +22 -0
  45. package/dist/delivery/index.js +62 -0
  46. package/dist/delivery/main.d.ts +31 -0
  47. package/dist/delivery/main.js +198 -0
  48. package/dist/delivery/utils.d.ts +12 -0
  49. package/dist/delivery/utils.js +220 -0
  50. package/dist/graphing-solution-set.css +2 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.iife.d.ts +8 -0
  53. package/dist/index.iife.js +369 -0
  54. package/dist/index.js +2 -0
  55. package/dist/runtime-support.d.ts +12 -0
  56. package/dist/runtime-support.js +12 -0
  57. package/package.json +94 -23
  58. package/CHANGELOG.json +0 -1
  59. package/CHANGELOG.md +0 -899
  60. package/LICENSE.md +0 -5
  61. package/README.md +0 -20
  62. package/configure/CHANGELOG.json +0 -1
  63. package/configure/CHANGELOG.md +0 -859
  64. package/configure/lib/configure.js +0 -312
  65. package/configure/lib/configure.js.map +0 -1
  66. package/configure/lib/correct-response.js +0 -435
  67. package/configure/lib/correct-response.js.map +0 -1
  68. package/configure/lib/defaults.js +0 -357
  69. package/configure/lib/defaults.js.map +0 -1
  70. package/configure/lib/graphing-config.js +0 -408
  71. package/configure/lib/graphing-config.js.map +0 -1
  72. package/configure/lib/index.js +0 -167
  73. package/configure/lib/index.js.map +0 -1
  74. package/configure/lib/utils.js +0 -630
  75. package/configure/lib/utils.js.map +0 -1
  76. package/configure/package.json +0 -29
  77. package/controller/CHANGELOG.json +0 -1
  78. package/controller/CHANGELOG.md +0 -715
  79. package/controller/lib/defaults.js +0 -69
  80. package/controller/lib/defaults.js.map +0 -1
  81. package/controller/lib/index.js +0 -351
  82. package/controller/lib/index.js.map +0 -1
  83. package/controller/lib/utils.js +0 -212
  84. package/controller/lib/utils.js.map +0 -1
  85. package/controller/package.json +0 -22
  86. package/demo-gss.gif +0 -0
  87. package/docs/config-schema.json +0 -1560
  88. package/docs/config-schema.json.md +0 -1114
  89. package/docs/demo/config.js +0 -8
  90. package/docs/demo/generate.js +0 -54
  91. package/docs/demo/index.html +0 -1
  92. package/docs/demo/session.js +0 -6
  93. package/docs/pie-schema.json +0 -1800
  94. package/docs/pie-schema.json.md +0 -952
  95. package/lib/index.js +0 -165
  96. package/lib/index.js.map +0 -1
  97. package/lib/main.js +0 -355
  98. package/lib/main.js.map +0 -1
  99. package/lib/utils.js +0 -515
  100. package/lib/utils.js.map +0 -1
@@ -0,0 +1,369 @@
1
+ this.GraphingSolutionSetElement=(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(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},c=(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},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o((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 ee(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 N={current:null},te={transition:null},ne={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:te,ReactCurrentOwner:C};function re(){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=ne,e.act=re,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:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=te.transition;te.transition={};try{e()}finally{te.transition=t}},e.unstable_act=re,e.useCallback=function(e,t){return N.current.useCallback(e,t)},e.useContext=function(e){return N.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return N.current.useDeferredValue(e)},e.useEffect=function(e,t){return N.current.useEffect(e,t)},e.useId=function(){return N.current.useId()},e.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return N.current.useMemo(e,t)},e.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},e.useRef=function(e){return N.current.useRef(e)},e.useState=function(e){return N.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return N.current.useTransition()},e.version=`18.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o((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&&ee(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&&ee(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 ee(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,ee(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}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d(),n=p();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]*$/,f={},m={};function h(e){return l.call(m,e)?!0:l.call(f,e)?!1:u.test(e)?m[e]=!0:(f[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?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``: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`),ee=Symbol.for(`react.suspense_list`),N=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),ne=Symbol.for(`react.offscreen`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Object.assign,oe;function se(e){if(oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||``}return`
2
+ `+oe+e}var ce=!1;function le(e,t){if(!e||ce)return``;ce=!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{ce=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?se(e):``}function ue(e){switch(e.tag){case 5:return se(e.type);case 16:return se(`Lazy`);case 13:return se(`Suspense`);case 19:return se(`SuspenseList`);case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return``}}function de(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 ee: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 N:return t=e.displayName||null,t===null?de(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}function fe(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 de(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 pe(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function he(e){var t=me(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 ge(e){e._valueTracker||=he(e)}function _e(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=me(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ve(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 ye(e,t){var n=t.checked;return ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function be(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=pe(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 xe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function Se(e,t){xe(e,t);var n=pe(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`)?we(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&we(e,t.type,pe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ce(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 we(e,t,n){(t!==`number`||ve(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Te=Array.isArray;function Ee(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=``+pe(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 De(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return ae({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function Oe(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(Te(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:pe(n)}}function ke(e,t){var n=pe(t.value),r=pe(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 Ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function je(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 Me(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?je(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Ne,Pe=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(Ne||=document.createElement(`div`),Ne.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Ne.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ie={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},Le=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Ie).forEach(function(e){Le.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ie[t]=Ie[e]})});function Re(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Ie.hasOwnProperty(e)&&Ie[e]?(``+t).trim():t+`px`}function ze(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Re(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Be=ae({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 Ve(e,t){if(t){if(Be[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 He(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 Ue=null;function We(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ge=null,Ke=null,qe=null;function Je(e){if(e=Ki(e)){if(typeof Ge!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ji(t),Ge(e.stateNode,e.type,t))}}function Ye(e){Ke?qe?qe.push(e):qe=[e]:Ke=e}function Xe(){if(Ke){var e=Ke,t=qe;if(qe=Ke=null,Je(e),t)for(e=0;e<t.length;e++)Je(t[e])}}function Ze(e,t){return e(t)}function Qe(){}var $e=!1;function et(e,t,n){if($e)return e(t,n);$e=!0;try{return Ze(e,t,n)}finally{$e=!1,(Ke!==null||qe!==null)&&(Qe(),Xe())}}function tt(e,t){var n=e.stateNode;if(n===null)return null;var i=Ji(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 nt=!1;if(c)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){nt=!0}}),window.addEventListener(`test`,rt,rt),window.removeEventListener(`test`,rt,rt)}catch{nt=!1}function P(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 it=!1,at=null,ot=!1,st=null,ct={onError:function(e){it=!0,at=e}};function lt(e,t,n,r,i,a,o,s,c){it=!1,at=null,P.apply(ct,arguments)}function ut(e,t,n,i,a,o,s,c,l){if(lt.apply(this,arguments),it){if(it){var u=at;it=!1,at=null}else throw Error(r(198));ot||(ot=!0,st=u)}}function dt(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 ft(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 pt(e){if(dt(e)!==e)throw Error(r(188))}function mt(e){var t=e.alternate;if(!t){if(t=dt(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 pt(a),e;if(o===i)return pt(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 ht(e){return e=mt(e),e===null?null:gt(e)}function gt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gt(e);if(t!==null)return t;e=e.sibling}return null}var _t=n.unstable_scheduleCallback,vt=n.unstable_cancelCallback,yt=n.unstable_shouldYield,bt=n.unstable_requestPaint,xt=n.unstable_now,St=n.unstable_getCurrentPriorityLevel,Ct=n.unstable_ImmediatePriority,wt=n.unstable_UserBlockingPriority,Tt=n.unstable_NormalPriority,Et=n.unstable_LowPriority,Dt=n.unstable_IdlePriority,Ot=null,kt=null;function At(e){if(kt&&typeof kt.onCommitFiberRoot==`function`)try{kt.onCommitFiberRoot(Ot,e,void 0,(e.current.flags&128)==128)}catch{}}var jt=Math.clz32?Math.clz32:Pt,Mt=Math.log,Nt=Math.LN2;function Pt(e){return e>>>=0,e===0?32:31-(Mt(e)/Nt|0)|0}var Ft=64,It=4194304;function Lt(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 Rt(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=Lt(a))):r=Lt(s)}else o=n&~i,o===0?a!==0&&(r=Lt(a)):r=Lt(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-jt(t),i=1<<n,r|=e[n],t&=~i;return r}function zt(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 Bt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-jt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=zt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Vt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Ht(){var e=Ft;return Ft<<=1,!(Ft&4194240)&&(Ft=64),e}function Ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Wt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function Gt(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-jt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Kt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-jt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var qt=0;function Jt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Yt,Xt,Zt,Qt,$t,en=!1,tn=[],nn=null,rn=null,an=null,on=new Map,sn=new Map,cn=[],ln=`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 un(e,t){switch(e){case`focusin`:case`focusout`:nn=null;break;case`dragenter`:case`dragleave`:rn=null;break;case`mouseover`:case`mouseout`:an=null;break;case`pointerover`:case`pointerout`:on.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:sn.delete(t.pointerId)}}function dn(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=Ki(t),t!==null&&Xt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function fn(e,t,n,r,i){switch(t){case`focusin`:return nn=dn(nn,e,t,n,r,i),!0;case`dragenter`:return rn=dn(rn,e,t,n,r,i),!0;case`mouseover`:return an=dn(an,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return on.set(a,dn(on.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,sn.set(a,dn(sn.get(a)||null,e,t,n,r,i)),!0}return!1}function pn(e){var t=Gi(e.target);if(t!==null){var n=dt(t);if(n!==null){if(t=n.tag,t===13){if(t=ft(n),t!==null){e.blockedOn=t,$t(e.priority,function(){Zt(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 mn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ue=r,n.target.dispatchEvent(r),Ue=null}else return t=Ki(n),t!==null&&Xt(t),e.blockedOn=n,!1;t.shift()}return!0}function hn(e,t,n){mn(e)&&n.delete(t)}function gn(){en=!1,nn!==null&&mn(nn)&&(nn=null),rn!==null&&mn(rn)&&(rn=null),an!==null&&mn(an)&&(an=null),on.forEach(hn),sn.forEach(hn)}function _n(e,t){e.blockedOn===t&&(e.blockedOn=null,en||(en=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,gn)))}function vn(e){function t(t){return _n(t,e)}if(0<tn.length){_n(tn[0],e);for(var n=1;n<tn.length;n++){var r=tn[n];r.blockedOn===e&&(r.blockedOn=null)}}for(nn!==null&&_n(nn,e),rn!==null&&_n(rn,e),an!==null&&_n(an,e),on.forEach(t),sn.forEach(t),n=0;n<cn.length;n++)r=cn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<cn.length&&(n=cn[0],n.blockedOn===null);)pn(n),n.blockedOn===null&&cn.shift()}var yn=C.ReactCurrentBatchConfig,bn=!0;function xn(e,t,n,r){var i=qt,a=yn.transition;yn.transition=null;try{qt=1,Cn(e,t,n,r)}finally{qt=i,yn.transition=a}}function Sn(e,t,n,r){var i=qt,a=yn.transition;yn.transition=null;try{qt=4,Cn(e,t,n,r)}finally{qt=i,yn.transition=a}}function Cn(e,t,n,r){if(bn){var i=Tn(e,t,n,r);if(i===null)_i(e,t,r,wn,n),un(e,r);else if(fn(i,e,t,n,r))r.stopPropagation();else if(un(e,r),t&4&&-1<ln.indexOf(e)){for(;i!==null;){var a=Ki(i);if(a!==null&&Yt(a),a=Tn(e,t,n,r),a===null&&_i(e,t,r,wn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else _i(e,t,r,null,n)}}var wn=null;function Tn(e,t,n,r){if(wn=null,e=We(r),e=Gi(e),e!==null)if(t=dt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ft(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 wn=e,null}function En(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(St()){case Ct:return 1;case wt:return 4;case Tt:case Et:return 16;case Dt:return 536870912;default:return 16}default:return 16}}var Dn=null,On=null,kn=null;function An(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.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 kn=i.slice(e,1<r?1-r:void 0)}function jn(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 Mn(){return!0}function Nn(){return!1}function Pn(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)?Mn:Nn,this.isPropagationStopped=Nn,this}return ae(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=Mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Mn)},persist:function(){},isPersistent:Mn}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},In=Pn(Fn),Ln=ae({},Fn,{view:0,detail:0}),Rn=Pn(Ln),zn,Bn,F,Vn=ae({},Ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qn,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!==F&&(F&&e.type===`mousemove`?(zn=e.screenX-F.screenX,Bn=e.screenY-F.screenY):Bn=zn=0,F=e),zn)},movementY:function(e){return`movementY`in e?e.movementY:Bn}}),Hn=Pn(Vn),Un=Pn(ae({},Vn,{dataTransfer:0})),Wn=Pn(ae({},Ln,{relatedTarget:0})),Gn=Pn(ae({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Pn(ae({},Fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Pn(ae({},Fn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={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`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Qn(){return Zn}var $n=Pn(ae({},Ln,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=jn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qn,charCode:function(e){return e.type===`keypress`?jn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?jn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),er=Pn(ae({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Pn(ae({},Ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),nr=Pn(ae({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Pn(ae({},Vn,{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})),ir=[9,13,27,32],ar=c&&`CompositionEvent`in window,or=null;c&&`documentMode`in document&&(or=document.documentMode);var sr=c&&`TextEvent`in window&&!or,cr=c&&(!ar||or&&8<or&&11>=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function I(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function mr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=An(),kn=On=Dn=null,pr=!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 cr&&t.locale!==`ko`?null:t.data;default:return null}}var hr={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 gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!hr[e.type]:t===`textarea`}function _r(e,t,n,r){Ye(r),t=yi(t,`onChange`),0<t.length&&(n=new In(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var vr=null,yr=null;function br(e){di(e,0)}function xr(e){if(_e(qi(e)))return e}function Sr(e,t){if(e===`change`)return t}var Cr=!1;if(c){var wr;if(c){var Tr=`oninput`in document;if(!Tr){var Er=document.createElement(`div`);Er.setAttribute(`oninput`,`return;`),Tr=typeof Er.oninput==`function`}wr=Tr}else wr=!1;Cr=wr&&(!document.documentMode||9<document.documentMode)}function Dr(){vr&&(vr.detachEvent(`onpropertychange`,Or),yr=vr=null)}function Or(e){if(e.propertyName===`value`&&xr(yr)){var t=[];_r(t,yr,e,We(e)),et(br,t)}}function kr(e,t,n){e===`focusin`?(Dr(),vr=t,yr=n,vr.attachEvent(`onpropertychange`,Or)):e===`focusout`&&Dr()}function Ar(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return xr(yr)}function jr(e,t){if(e===`click`)return xr(t)}function Mr(e,t){if(e===`input`||e===`change`)return xr(t)}function Nr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Pr=typeof Object.is==`function`?Object.is:Nr;function Fr(e,t){if(Pr(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)||!Pr(e[i],t[i]))return!1}return!0}function Ir(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lr(e,t){var n=Ir(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=Ir(n)}}function Rr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zr(){for(var e=window,t=ve();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ve(e.document)}return t}function Br(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 Vr(e){var t=zr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rr(n.ownerDocument.documentElement,n)){if(r!==null&&Br(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=Lr(n,a);var o=Lr(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 Hr=c&&`documentMode`in document&&11>=document.documentMode,Ur=null,Wr=null,Gr=null,Kr=!1;function qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kr||Ur==null||Ur!==ve(r)||(r=Ur,`selectionStart`in r&&Br(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}),Gr&&Fr(Gr,r)||(Gr=r,r=yi(Wr,`onSelect`),0<r.length&&(t=new In(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ur)))}function Jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Yr={animationend:Jr(`Animation`,`AnimationEnd`),animationiteration:Jr(`Animation`,`AnimationIteration`),animationstart:Jr(`Animation`,`AnimationStart`),transitionend:Jr(`Transition`,`TransitionEnd`)},Xr={},Zr={};c&&(Zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),`TransitionEvent`in window||delete Yr.transitionend.transition);function Qr(e){if(Xr[e])return Xr[e];if(!Yr[e])return e;var t=Yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zr)return Xr[e]=t[n];return e}var $r=Qr(`animationend`),ei=Qr(`animationiteration`),ti=Qr(`animationstart`),ni=Qr(`transitionend`),ri=new Map,ii=`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 ai(e,t){ri.set(e,t),o(t,[e])}for(var oi=0;oi<ii.length;oi++){var si=ii[oi];ai(si.toLowerCase(),`on`+(si[0].toUpperCase()+si.slice(1)))}ai($r,`onAnimationEnd`),ai(ei,`onAnimationIteration`),ai(ti,`onAnimationStart`),ai(`dblclick`,`onDoubleClick`),ai(`focusin`,`onFocus`),ai(`focusout`,`onBlur`),ai(ni,`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 ci=`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(` `),li=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ci));function ui(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,ut(r,t,void 0,e),e.currentTarget=null}function di(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;ui(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;ui(i,s,l),a=c}}}if(ot)throw e=st,ot=!1,st=null,e}function fi(e,t){var n=t[Hi];n===void 0&&(n=t[Hi]=new Set);var r=e+`__bubble`;n.has(r)||(gi(t,e,2,!1),n.add(r))}function pi(e,t,n){var r=0;t&&(r|=4),gi(n,e,r,t)}var mi=`_reactListening`+Math.random().toString(36).slice(2);function hi(e){if(!e[mi]){e[mi]=!0,i.forEach(function(t){t!==`selectionchange`&&(li.has(t)||pi(t,!1,e),pi(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mi]||(t[mi]=!0,pi(`selectionchange`,!1,t))}}function gi(e,t,n,r){switch(En(t)){case 1:var i=xn;break;case 4:i=Sn;break;default:i=Cn}n=i.bind(null,t,n,e),i=void 0,!nt||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 _i(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=Gi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}et(function(){var r=a,i=We(n),o=[];a:{var s=ri.get(e);if(s!==void 0){var c=In,l=e;switch(e){case`keypress`:if(jn(n)===0)break a;case`keydown`:case`keyup`:c=$n;break;case`focusin`:l=`focus`,c=Wn;break;case`focusout`:l=`blur`,c=Wn;break;case`beforeblur`:case`afterblur`:c=Wn;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=Hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Un;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=tr;break;case $r:case ei:case ti:c=Gn;break;case ni:c=nr;break;case`scroll`:c=Rn;break;case`wheel`:c=rr;break;case`copy`:case`cut`:case`paste`:c=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=er}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=tt(p,f),h!=null&&u.push(vi(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!==Ue&&(l=n.relatedTarget||n.fromElement)&&(Gi(l)||l[Vi]))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?Gi(l):null,l!==null&&(d=dt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Hn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=er,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:qi(c),m=l==null?s:qi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Gi(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=bi(m))p++;for(m=0,h=f;h;h=bi(h))m++;for(;0<p-m;)u=bi(u),p--;for(;0<m-p;)f=bi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=bi(u),f=bi(f)}u=null}else u=null;c!==null&&xi(o,s,c,u,!1),l!==null&&d!==null&&xi(o,d,l,u,!0)}}a:{if(s=r?qi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=Sr;else if(gr(s))if(Cr)g=Mr;else{g=Ar;var _=kr}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=jr);if(g&&=g(e,r)){_r(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&we(s,`number`,s.value)}switch(_=r?qi(r):window,e){case`focusin`:(gr(_)||_.contentEditable===`true`)&&(Ur=_,Wr=r,Gr=null);break;case`focusout`:Gr=Wr=Ur=null;break;case`mousedown`:Kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Kr=!1,qr(o,n,i);break;case`selectionchange`:if(Hr)break;case`keydown`:case`keyup`:qr(o,n,i)}var v;if(ar)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 pr?dr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(cr&&n.locale!==`ko`&&(pr||y!==`onCompositionStart`?y===`onCompositionEnd`&&pr&&(v=An()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,pr=!0)),_=yi(r,y),0<_.length&&(y=new qn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=fr(n),v!==null&&(y.data=v)))),(v=sr?I(e,n):mr(e,n))&&(r=yi(r,`onBeforeInput`),0<r.length&&(i=new qn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}di(o,t)})}function vi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function yi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=tt(e,n),a!=null&&r.unshift(vi(e,a,i)),a=tt(e,t),a!=null&&r.push(vi(e,a,i))),e=e.return}return r}function bi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xi(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=tt(n,a),c!=null&&o.unshift(vi(n,c,s))):i||(c=tt(n,a),c!=null&&o.push(vi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Si=/\r\n?/g,Ci=/\u0000|\uFFFD/g;function wi(e){return(typeof e==`string`?e:``+e).replace(Si,`
6
+ `).replace(Ci,``)}function Ti(e,t,n){if(t=wi(t),wi(e)!==t&&n)throw Error(r(425))}function Ei(){}var Di=null,Oi=null;function ki(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 Ai=typeof setTimeout==`function`?setTimeout:void 0,ji=typeof clearTimeout==`function`?clearTimeout:void 0,Mi=typeof Promise==`function`?Promise:void 0,Ni=typeof queueMicrotask==`function`?queueMicrotask:Mi===void 0?Ai:function(e){return Mi.resolve(null).then(e).catch(Pi)};function Pi(e){setTimeout(function(){throw e})}function Fi(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),vn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);vn(t)}function Ii(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 Li(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 Ri=Math.random().toString(36).slice(2),zi=`__reactFiber$`+Ri,Bi=`__reactProps$`+Ri,Vi=`__reactContainer$`+Ri,Hi=`__reactEvents$`+Ri,Ui=`__reactListeners$`+Ri,Wi=`__reactHandles$`+Ri;function Gi(e){var t=e[zi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Vi]||n[zi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Li(e);e!==null;){if(n=e[zi])return n;e=Li(e)}return t}e=n,n=e.parentNode}return null}function Ki(e){return e=e[zi]||e[Vi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ji(e){return e[Bi]||null}var Yi=[],Xi=-1;function Zi(e){return{current:e}}function Qi(e){0>Xi||(e.current=Yi[Xi],Yi[Xi]=null,Xi--)}function $i(e,t){Xi++,Yi[Xi]=e.current,e.current=t}var ea={},ta=Zi(ea),na=Zi(!1),ra=ea;function L(e,t){var n=e.type.contextTypes;if(!n)return ea;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 ia(e){return e=e.childContextTypes,e!=null}function aa(){Qi(na),Qi(ta)}function oa(e,t,n){if(ta.current!==ea)throw Error(r(168));$i(ta,t),$i(na,n)}function sa(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,fe(e)||`Unknown`,a));return ae({},n,i)}function ca(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ea,ra=ta.current,$i(ta,e),$i(na,na.current),!0}function la(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=sa(e,t,ra),i.__reactInternalMemoizedMergedChildContext=e,Qi(na),Qi(ta),$i(ta,e)):Qi(na),$i(na,n)}var ua=null,da=!1,fa=!1;function pa(e){ua===null?ua=[e]:ua.push(e)}function ma(e){da=!0,pa(e)}function ha(){if(!fa&&ua!==null){fa=!0;var e=0,t=qt;try{var n=ua;for(qt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ua=null,da=!1}catch(t){throw ua!==null&&(ua=ua.slice(e+1)),_t(Ct,ha),t}finally{qt=t,fa=!1}}return null}var ga=[],_a=0,va=null,ya=0,ba=[],xa=0,Sa=null,Ca=1,wa=``;function Ta(e,t){ga[_a++]=ya,ga[_a++]=va,va=e,ya=t}function Ea(e,t,n){ba[xa++]=Ca,ba[xa++]=wa,ba[xa++]=Sa,Sa=e;var r=Ca;e=wa;var i=32-jt(r)-1;r&=~(1<<i),n+=1;var a=32-jt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ca=1<<32-jt(t)+i|n<<i|r,wa=a+e}else Ca=1<<a|n<<i|r,wa=e}function Da(e){e.return!==null&&(Ta(e,1),Ea(e,1,0))}function Oa(e){for(;e===va;)va=ga[--_a],ga[_a]=null,ya=ga[--_a],ga[_a]=null;for(;e===Sa;)Sa=ba[--xa],ba[xa]=null,wa=ba[--xa],ba[xa]=null,Ca=ba[--xa],ba[xa]=null}var ka=null,Aa=null,ja=!1,Ma=null;function Na(e,t){var n=ou(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 Pa(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,ka=e,Aa=Ii(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,ka=e,Aa=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=Sa===null?null:{id:Ca,overflow:wa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ou(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ka=e,Aa=null,!0);default:return!1}}function Fa(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Ia(e){if(ja){var t=Aa;if(t){var n=t;if(!Pa(e,t)){if(Fa(e))throw Error(r(418));t=Ii(n.nextSibling);var i=ka;t&&Pa(e,t)?Na(i,n):(e.flags=e.flags&-4097|2,ja=!1,ka=e)}}else{if(Fa(e))throw Error(r(418));e.flags=e.flags&-4097|2,ja=!1,ka=e}}}function La(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ka=e}function Ra(e){if(e!==ka)return!1;if(!ja)return La(e),ja=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!ki(e.type,e.memoizedProps)),t&&=Aa){if(Fa(e))throw za(),Error(r(418));for(;t;)Na(e,t),t=Ii(t.nextSibling)}if(La(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){Aa=Ii(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Aa=null}}else Aa=ka?Ii(e.stateNode.nextSibling):null;return!0}function za(){for(var e=Aa;e;)e=Ii(e.nextSibling)}function Ba(){Aa=ka=null,ja=!1}function Va(e){Ma===null?Ma=[e]:Ma.push(e)}var Ha=C.ReactCurrentBatchConfig;function Ua(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 Wa(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Ga(e){var t=e._init;return t(e._payload)}function Ka(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=lu(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=pu(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===te&&Ga(i)===t.type)?(r=a(t,n.props),r.ref=Ua(e,t,n),r.return=e,r):(r=uu(n.type,n.key,n.props,null,e.mode,r),r.ref=Ua(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=mu(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=du(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=pu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=uu(t.type,t.key,t.props,null,e.mode,n),n.ref=Ua(e,null,t),n.return=e,n;case T:return t=mu(t,e.mode,n),t.return=e,t;case te:var r=t._init;return f(e,r(t._payload),n)}if(Te(t)||ie(t))return t=du(t,e.mode,n,null),t.return=e,t;Wa(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 te:return i=n._init,p(e,t,i(n._payload),r)}if(Te(n)||ie(n))return i===null?d(e,t,n,r,null):null;Wa(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 te:var a=r._init;return m(e,t,n,a(r._payload),i)}if(Te(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);Wa(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),ja&&Ta(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 ja&&Ta(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)}),ja&&Ta(r,h),l}function g(a,s,c,l){var u=ie(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),ja&&Ta(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 ja&&Ta(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)}),ja&&Ta(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===te&&Ga(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ua(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=du(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=uu(i.type,i.key,i.props,null,e.mode,o),o.ref=Ua(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=mu(i,e.mode,o),r.return=e,e=r}return s(e);case te:return l=i._init,_(e,r,l(i._payload),o)}if(Te(i))return h(e,r,i,o);if(ie(i))return g(e,r,i,o);Wa(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=pu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var qa=Ka(!0),Ja=Ka(!1),Ya=Zi(null),Xa=null,Za=null,Qa=null;function $a(){Qa=Za=Xa=null}function eo(e){var t=Ya.current;Qi(Ya),e._currentValue=t}function to(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 no(e,t){Xa=e,Qa=Za=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Gs=!0),e.firstContext=null)}function ro(e){var t=e._currentValue;if(Qa!==e)if(e={context:e,memoizedValue:t,next:null},Za===null){if(Xa===null)throw Error(r(308));Za=e,Xa.dependencies={lanes:0,firstContext:e}}else Za=Za.next=e;return t}var io=null;function ao(e){io===null?io=[e]:io.push(e)}function oo(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ao(t)):(n.next=i.next,i.next=n),t.interleaved=n,so(e,r)}function so(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 co=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uo(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 fo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,el&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,so(e,n)}return i=r.interleaved,i===null?(t.next=t,ao(r)):(t.next=i.next,i.next=t),r.interleaved=t,so(e,n)}function mo(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,Kt(e,n)}}function ho(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 go(e,t,n,r){var i=e.updateQueue;co=!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=ae({},d,f);break a;case 2:co=!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);cl|=o,e.lanes=o,e.memoizedState=d}}function _o(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 vo={},yo=Zi(vo),bo=Zi(vo),xo=Zi(vo);function So(e){if(e===vo)throw Error(r(174));return e}function Co(e,t){switch($i(xo,t),$i(bo,e),$i(yo,vo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Me(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Me(t,e)}Qi(yo),$i(yo,t)}function wo(){Qi(yo),Qi(bo),Qi(xo)}function To(e){So(xo.current);var t=So(yo.current),n=Me(t,e.type);t!==n&&($i(bo,e),$i(yo,n))}function Eo(e){bo.current===e&&(Qi(yo),Qi(bo))}var Do=Zi(0);function Oo(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 ko=[];function Ao(){for(var e=0;e<ko.length;e++)ko[e]._workInProgressVersionPrimary=null;ko.length=0}var jo=C.ReactCurrentDispatcher,Mo=C.ReactCurrentBatchConfig,No=0,Po=null,Fo=null,Io=null,Lo=!1,Ro=!1,zo=0,Bo=0;function Vo(){throw Error(r(321))}function Ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function Uo(e,t,n,i,a,o){if(No=o,Po=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,jo.current=e===null||e.memoizedState===null?Ds:Os,e=n(i,a),Ro){o=0;do{if(Ro=!1,zo=0,25<=o)throw Error(r(301));o+=1,Io=Fo=null,t.updateQueue=null,jo.current=ks,e=n(i,a)}while(Ro)}if(jo.current=Es,t=Fo!==null&&Fo.next!==null,No=0,Io=Fo=Po=null,Lo=!1,t)throw Error(r(300));return e}function Wo(){var e=zo!==0;return zo=0,e}function Go(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Po.memoizedState=Io=e:Io=Io.next=e,Io}function Ko(){if(Fo===null){var e=Po.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Po.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Error(r(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Po.memoizedState=Io=e:Io=Io.next=e}return Io}function qo(e,t){return typeof t==`function`?t(e):t}function Jo(e){var t=Ko(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Fo,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((No&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,Po.lanes|=d,cl|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Pr(i,t.memoizedState)||(Gs=!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,Po.lanes|=o,cl|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Yo(e){var t=Ko(),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);Pr(o,t.memoizedState)||(Gs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Xo(){}function Zo(e,t){var n=Po,i=Ko(),a=t(),o=!Pr(i.memoizedState,a);if(o&&(i.memoizedState=a,Gs=!0),i=i.queue,us(es.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Io!==null&&Io.memoizedState.tag&1){if(n.flags|=2048,is(9,$o.bind(null,n,i,a,t),void 0,null),tl===null)throw Error(r(349));No&30||Qo(n,t,a)}return a}function Qo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Po.updateQueue,t===null?(t={lastEffect:null,stores:null},Po.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $o(e,t,n,r){t.value=n,t.getSnapshot=r,ts(t)&&ns(e)}function es(e,t,n){return n(function(){ts(t)&&ns(e)})}function ts(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pr(e,n)}catch{return!0}}function ns(e){var t=so(e,1);t!==null&&Ol(t,e,1,-1)}function rs(e){var t=Go();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:e},t.queue=e,e=e.dispatch=Ss.bind(null,Po,e),[t.memoizedState,e]}function is(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Po.updateQueue,t===null?(t={lastEffect:null,stores:null},Po.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 as(){return Ko().memoizedState}function ss(e,t,n,r){var i=Go();Po.flags|=e,i.memoizedState=is(1|t,n,void 0,r===void 0?null:r)}function cs(e,t,n,r){var i=Ko();r=r===void 0?null:r;var a=void 0;if(Fo!==null){var o=Fo.memoizedState;if(a=o.destroy,r!==null&&Ho(r,o.deps)){i.memoizedState=is(t,n,a,r);return}}Po.flags|=e,i.memoizedState=is(1|t,n,a,r)}function ls(e,t){return ss(8390656,8,e,t)}function us(e,t){return cs(2048,8,e,t)}function ds(e,t){return cs(4,2,e,t)}function fs(e,t){return cs(4,4,e,t)}function ps(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 ms(e,t,n){return n=n==null?null:n.concat([e]),cs(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Ko();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Ko();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ho(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function vs(e,t,n){return No&21?(Pr(n,t)||(n=Ht(),Po.lanes|=n,cl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gs=!0),e.memoizedState=n)}function ys(e,t){var n=qt;qt=n!==0&&4>n?n:4,e(!0);var r=Mo.transition;Mo.transition={};try{e(!1),t()}finally{qt=n,Mo.transition=r}}function bs(){return Ko().memoizedState}function xs(e,t,n){var r=Dl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cs(e))ws(t,n);else if(n=oo(e,t,n,r),n!==null){var i=El();Ol(n,e,r,i),Ts(n,t,r)}}function Ss(e,t,n){var r=Dl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cs(e))ws(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,Pr(s,o)){var c=t.interleaved;c===null?(i.next=i,ao(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=oo(e,t,i,r),n!==null&&(i=El(),Ol(n,e,r,i),Ts(n,t,r))}}function Cs(e){var t=e.alternate;return e===Po||t!==null&&t===Po}function ws(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ts(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kt(e,n)}}var Es={readContext:ro,useCallback:Vo,useContext:Vo,useEffect:Vo,useImperativeHandle:Vo,useInsertionEffect:Vo,useLayoutEffect:Vo,useMemo:Vo,useReducer:Vo,useRef:Vo,useState:Vo,useDebugValue:Vo,useDeferredValue:Vo,useTransition:Vo,useMutableSource:Vo,useSyncExternalStore:Vo,useId:Vo,unstable_isNewReconciler:!1},Ds={readContext:ro,useCallback:function(e,t){return Go().memoizedState=[e,t===void 0?null:t],e},useContext:ro,useEffect:ls,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),ss(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){return ss(4,2,e,t)},useMemo:function(e,t){var n=Go();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Go();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=xs.bind(null,Po,e),[r.memoizedState,e]},useRef:function(e){var t=Go();return e={current:e},t.memoizedState=e},useState:rs,useDebugValue:hs,useDeferredValue:function(e){return Go().memoizedState=e},useTransition:function(){var e=rs(!1),t=e[0];return e=ys.bind(null,e[1]),Go().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Po,a=Go();if(ja){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),tl===null)throw Error(r(349));No&30||Qo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ls(es.bind(null,i,o,e),[e]),i.flags|=2048,is(9,$o.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Go(),t=tl.identifierPrefix;if(ja){var n=wa,r=Ca;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=zo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Bo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},Os={readContext:ro,useCallback:gs,useContext:ro,useEffect:us,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Jo,useRef:as,useState:function(){return Jo(qo)},useDebugValue:hs,useDeferredValue:function(e){return vs(Ko(),Fo.memoizedState,e)},useTransition:function(){return[Jo(qo)[0],Ko().memoizedState]},useMutableSource:Xo,useSyncExternalStore:Zo,useId:bs,unstable_isNewReconciler:!1},ks={readContext:ro,useCallback:gs,useContext:ro,useEffect:us,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Yo,useRef:as,useState:function(){return Yo(qo)},useDebugValue:hs,useDeferredValue:function(e){var t=Ko();return Fo===null?t.memoizedState=e:vs(t,Fo.memoizedState,e)},useTransition:function(){return[Yo(qo)[0],Ko().memoizedState]},useMutableSource:Xo,useSyncExternalStore:Zo,useId:bs,unstable_isNewReconciler:!1};function As(e,t){if(e&&e.defaultProps){for(var n in t=ae({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function R(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var js={isMounted:function(e){return(e=e._reactInternals)?dt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=El(),i=Dl(e),a=fo(r,i);a.payload=t,n!=null&&(a.callback=n),t=po(e,a,i),t!==null&&(Ol(t,e,i,r),mo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=El(),i=Dl(e),a=fo(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=po(e,a,i),t!==null&&(Ol(t,e,i,r),mo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=El(),r=Dl(e),i=fo(n,r);i.tag=2,t!=null&&(i.callback=t),t=po(e,i,r),t!==null&&(Ol(t,e,r,n),mo(t,e,r))}};function Ms(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?!Fr(n,r)||!Fr(i,a):!0}function Ns(e,t,n){var r=!1,i=ea,a=t.contextType;return typeof a==`object`&&a?a=ro(a):(i=ia(t)?ra:ta.current,r=t.contextTypes,a=(r=r!=null)?L(e,i):ea),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=js,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ps(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&&js.enqueueReplaceState(t,t.state,null)}function Fs(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},lo(e);var a=t.contextType;typeof a==`object`&&a?i.context=ro(a):(a=ia(t)?ra:ta.current,i.context=L(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(R(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&&js.enqueueReplaceState(i,i.state,null),go(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Is(e,t){try{var n=``,r=t;do n+=ue(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 Ls(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Rs(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var zs=typeof WeakMap==`function`?WeakMap:Map;function Bs(e,t,n){n=fo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){gl||(gl=!0,_l=r),Rs(e,t)},n}function Vs(e,t,n){n=fo(-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(){Rs(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Rs(e,t),typeof r!=`function`&&(vl===null?vl=new Set([this]):vl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Hs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zs;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=$l.bind(null,e,t,n),t.then(e,e))}function Us(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function z(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=fo(-1,1),t.tag=2,po(n,t,1))),n.lanes|=1),e)}var Ws=C.ReactCurrentOwner,Gs=!1;function Ks(e,t,n,r){t.child=e===null?Ja(t,null,n,r):qa(t,e.child,n,r)}function qs(e,t,n,r,i){n=n.render;var a=t.ref;return no(t,i),r=Uo(e,t,n,r,a,i),n=Wo(),e!==null&&!Gs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,pc(e,t,i)):(ja&&n&&Da(t),t.flags|=1,Ks(e,t,r,i),t.child)}function Js(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!su(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Ys(e,t,a,r,i)):(e=uu(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?Fr:n,n(o,r)&&e.ref===t.ref)return pc(e,t,i)}return t.flags|=1,e=lu(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ys(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Fr(a,r)&&e.ref===t.ref)if(Gs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Gs=!0);else return t.lanes=e.lanes,pc(e,t,i)}return Qs(e,t,n,r,i)}function Xs(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},$i(al,il),il|=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,$i(al,il),il|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,$i(al,il),il|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),$i(al,il),il|=r;return Ks(e,t,i,n),t.child}function Zs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Qs(e,t,n,r,i){var a=ia(n)?ra:ta.current;return a=L(t,a),no(t,i),n=Uo(e,t,n,r,a,i),r=Wo(),e!==null&&!Gs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,pc(e,t,i)):(ja&&r&&Da(t),t.flags|=1,Ks(e,t,n,i),t.child)}function $s(e,t,n,r,i){if(ia(n)){var a=!0;ca(t)}else a=!1;if(no(t,i),t.stateNode===null)fc(e,t),Ns(t,n,r),Fs(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=ro(l):(l=ia(n)?ra:ta.current,l=L(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)&&Ps(t,o,r,l),co=!1;var f=t.memoizedState;o.state=f,go(t,r,o,i),c=t.memoizedState,s!==r||f!==c||na.current||co?(typeof u==`function`&&(R(t,n,u,r),c=t.memoizedState),(s=co||Ms(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,uo(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:As(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=ro(c):(c=ia(n)?ra:ta.current,c=L(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)&&Ps(t,o,r,c),co=!1,f=t.memoizedState,o.state=f,go(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||na.current||co?(typeof p==`function`&&(R(t,n,p,r),m=t.memoizedState),(l=co||Ms(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 ec(e,t,n,r,a,i)}function ec(e,t,n,r,i,a){Zs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&la(t,n,!1),pc(e,t,a);r=t.stateNode,Ws.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=qa(t,e.child,null,a),t.child=qa(t,null,s,a)):Ks(e,t,s,a),t.memoizedState=r.state,i&&la(t,n,!0),t.child}function tc(e){var t=e.stateNode;t.pendingContext?oa(e,t.pendingContext,t.pendingContext!==t.context):t.context&&oa(e,t.context,!1),Co(e,t.containerInfo)}function nc(e,t,n,r,i){return Ba(),Va(i),t.flags|=256,Ks(e,t,n,r),t.child}var rc={dehydrated:null,treeContext:null,retryLane:0};function ic(e){return{baseLanes:e,cachePool:null,transitions:null}}function ac(e,t,n){var r=t.pendingProps,i=Do.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),$i(Do,i&1),e===null)return Ia(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=fu(o,r,0,null),e=du(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ic(n),t.memoizedState=rc,e):oc(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return cc(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=lu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=du(a,o,n,null),a.flags|=2):a=lu(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?ic(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=rc,r}return a=e.child,e=a.sibling,r=lu(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 oc(e,t){return t=fu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function sc(e,t,n,r){return r!==null&&Va(r),qa(t,e.child,null,n),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ls(Error(r(422))),sc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=fu({mode:`visible`,children:i.children},a,0,null),o=du(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&qa(t,e.child,null,s),t.child.memoizedState=ic(s),t.memoizedState=rc,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return sc(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=Ls(o,i,void 0),sc(e,t,s,i)}if(c=(s&e.childLanes)!==0,Gs||c){if(i=tl,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,so(e,a),Ol(i,e,a,-1))}return Hl(),i=Ls(Error(r(421))),sc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=tu.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Aa=Ii(a.nextSibling),ka=t,ja=!0,Ma=null,e!==null&&(ba[xa++]=Ca,ba[xa++]=wa,ba[xa++]=Sa,Ca=e.id,wa=e.overflow,Sa=t),t=oc(t,i.children),t.flags|=4096,t)}function lc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),to(e.return,t,n)}function uc(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 dc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ks(e,t,r.children,n),r=Do.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&&lc(e,n,t);else if(e.tag===19)lc(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($i(Do,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&&Oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),uc(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&&Oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}uc(t,!0,n,null,a);break;case`together`:uc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cl|=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=lu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=lu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mc(e,t,n){switch(t.tag){case 3:tc(t),Ba();break;case 5:To(t);break;case 1:ia(t.type)&&ca(t);break;case 4:Co(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;$i(Ya,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($i(Do,Do.current&1),e=pc(e,t,n),e===null?null:e.sibling):ac(e,t,n):($i(Do,Do.current&1),t.flags|=128,null);$i(Do,Do.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return dc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$i(Do,Do.current),r)break;return null;case 22:case 23:return t.lanes=0,Xs(e,t,n)}return pc(e,t,n)}var hc=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}},gc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,So(yo.current);var o=null;switch(n){case`input`:i=ye(e,i),r=ye(e,r),o=[];break;case`select`:i=ae({},i,{value:void 0}),r=ae({},r,{value:void 0}),o=[];break;case`textarea`:i=De(e,i),r=De(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=Ei)}Ve(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`&&fi(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},_c=function(e,t,n,r){n!==r&&(t.flags|=4)};function vc(e,t){if(!ja)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 yc(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 bc(e,t,n){var i=t.pendingProps;switch(Oa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yc(t),null;case 1:return ia(t.type)&&aa(),yc(t),null;case 3:return i=t.stateNode,wo(),Qi(na),Qi(ta),Ao(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ra(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ma!==null&&(Ml(Ma),Ma=null))),yc(t),null;case 5:Eo(t);var o=So(xo.current);if(n=t.type,e!==null&&t.stateNode!=null)gc(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 yc(t),null}if(e=So(yo.current),Ra(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[zi]=t,i[Bi]=s,e=(t.mode&1)!=0,n){case`dialog`:fi(`cancel`,i),fi(`close`,i);break;case`iframe`:case`object`:case`embed`:fi(`load`,i);break;case`video`:case`audio`:for(o=0;o<ci.length;o++)fi(ci[o],i);break;case`source`:fi(`error`,i);break;case`img`:case`image`:case`link`:fi(`error`,i),fi(`load`,i);break;case`details`:fi(`toggle`,i);break;case`input`:be(i,s),fi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},fi(`invalid`,i);break;case`textarea`:Oe(i,s),fi(`invalid`,i)}for(var c in Ve(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&Ti(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&Ti(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&fi(`scroll`,i)}switch(n){case`input`:ge(i),Ce(i,s,!0);break;case`textarea`:ge(i),Ae(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=Ei)}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=je(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[zi]=t,e[Bi]=i,hc(e,t,!1,!1),t.stateNode=e;a:{switch(c=He(n,i),n){case`dialog`:fi(`cancel`,e),fi(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:fi(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ci.length;o++)fi(ci[o],e);o=i;break;case`source`:fi(`error`,e),o=i;break;case`img`:case`image`:case`link`:fi(`error`,e),fi(`load`,e),o=i;break;case`details`:fi(`toggle`,e),o=i;break;case`input`:be(e,i),o=ye(e,i),fi(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=ae({},i,{value:void 0}),fi(`invalid`,e);break;case`textarea`:Oe(e,i),o=De(e,i),fi(`invalid`,e);break;default:o=i}for(s in Ve(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?ze(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Pe(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Fe(e,u):typeof u==`number`&&Fe(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&fi(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:ge(e),Ce(e,i,!1);break;case`textarea`:ge(e),Ae(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+pe(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&Ee(e,!!i.multiple,i.defaultValue,!0):Ee(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=Ei)}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 yc(t),null;case 6:if(e&&t.stateNode!=null)_c(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=So(xo.current),So(yo.current),Ra(t)){if(i=t.stateNode,n=t.memoizedProps,i[zi]=t,(s=i.nodeValue!==n)&&(e=ka,e!==null))switch(e.tag){case 3:Ti(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Ti(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[zi]=t,t.stateNode=i}return yc(t),null;case 13:if(Qi(Do),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ja&&Aa!==null&&t.mode&1&&!(t.flags&128))za(),Ba(),t.flags|=98560,s=!1;else if(s=Ra(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[zi]=t}else Ba(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yc(t),s=!1}else Ma!==null&&(Ml(Ma),Ma=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||Do.current&1?ol===0&&(ol=3):Hl())),t.updateQueue!==null&&(t.flags|=4),yc(t),null);case 4:return wo(),e===null&&hi(t.stateNode.containerInfo),yc(t),null;case 10:return eo(t.type._context),yc(t),null;case 17:return ia(t.type)&&aa(),yc(t),null;case 19:if(Qi(Do),s=t.memoizedState,s===null)return yc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)vc(s,!1);else{if(ol!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Oo(e),c!==null){for(t.flags|=128,vc(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 $i(Do,Do.current&1|2),t.child}e=e.sibling}s.tail!==null&&xt()>ml&&(t.flags|=128,i=!0,vc(s,!1),t.lanes=4194304)}else{if(!i)if(e=Oo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!ja)return yc(t),null}else 2*xt()-s.renderingStartTime>ml&&n!==1073741824&&(t.flags|=128,i=!0,vc(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?(yc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=xt(),t.sibling=null,n=Do.current,$i(Do,i?n&1|2:n&1),t);case 22:case 23:return Rl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?il&1073741824&&(yc(t),t.subtreeFlags&6&&(t.flags|=8192)):yc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function xc(e,t){switch(Oa(t),t.tag){case 1:return ia(t.type)&&aa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wo(),Qi(na),Qi(ta),Ao(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Eo(t),null;case 13:if(Qi(Do),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qi(Do),null;case 4:return wo(),null;case 10:return eo(t.type._context),null;case 22:case 23:return Rl(),null;case 24:return null;default:return null}}var Sc=!1,Cc=!1,wc=typeof WeakSet==`function`?WeakSet:Set,B=null;function Tc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Ql(e,t,n)}else n.current=null}function Ec(e,t,n){try{n()}catch(n){Ql(e,t,n)}}var Dc=!1;function Oc(e,t){if(Di=bn,e=zr(),Br(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(Oi={focusedElem:e,selectionRange:n},bn=!1,B=t;B!==null;)if(t=B,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;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:As(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){Ql(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return h=Dc,Dc=!1,h}function kc(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&&Ec(t,n,a)}i=i.next}while(i!==r)}}function Ac(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 jc(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 Mc(e){var t=e.alternate;t!==null&&(e.alternate=null,Mc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zi],delete t[Bi],delete t[Hi],delete t[Ui],delete t[Wi])),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 Nc(e){return e.tag===5||e.tag===3||e.tag===4}function Pc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nc(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 Fc(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=Ei));else if(r!==4&&(e=e.child,e!==null))for(Fc(e,t,n),e=e.sibling;e!==null;)Fc(e,t,n),e=e.sibling}function Ic(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(Ic(e,t,n),e=e.sibling;e!==null;)Ic(e,t,n),e=e.sibling}var Lc=null,Rc=!1;function zc(e,t,n){for(n=n.child;n!==null;)Bc(e,t,n),n=n.sibling}function Bc(e,t,n){if(kt&&typeof kt.onCommitFiberUnmount==`function`)try{kt.onCommitFiberUnmount(Ot,n)}catch{}switch(n.tag){case 5:Cc||Tc(n,t);case 6:var r=Lc,i=Rc;Lc=null,zc(e,t,n),Lc=r,Rc=i,Lc!==null&&(Rc?(e=Lc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Lc.removeChild(n.stateNode));break;case 18:Lc!==null&&(Rc?(e=Lc,n=n.stateNode,e.nodeType===8?Fi(e.parentNode,n):e.nodeType===1&&Fi(e,n),vn(e)):Fi(Lc,n.stateNode));break;case 4:r=Lc,i=Rc,Lc=n.stateNode.containerInfo,Rc=!0,zc(e,t,n),Lc=r,Rc=i;break;case 0:case 11:case 14:case 15:if(!Cc&&(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)&&Ec(n,t,o),i=i.next}while(i!==r)}zc(e,t,n);break;case 1:if(!Cc&&(Tc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Ql(n,t,e)}zc(e,t,n);break;case 21:zc(e,t,n);break;case 22:n.mode&1?(Cc=(r=Cc)||n.memoizedState!==null,zc(e,t,n),Cc=r):zc(e,t,n);break;default:zc(e,t,n)}}function Vc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new wc),t.forEach(function(t){var r=nu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Hc(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:Lc=c.stateNode,Rc=!1;break a;case 3:Lc=c.stateNode.containerInfo,Rc=!0;break a;case 4:Lc=c.stateNode.containerInfo,Rc=!0;break a}c=c.return}if(Lc===null)throw Error(r(160));Bc(o,s,a),Lc=null,Rc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Ql(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Uc(t,e),t=t.sibling}function Uc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Hc(t,e),Wc(e),i&4){try{kc(3,e,e.return),Ac(3,e)}catch(t){Ql(e,e.return,t)}try{kc(5,e,e.return)}catch(t){Ql(e,e.return,t)}}break;case 1:Hc(t,e),Wc(e),i&512&&n!==null&&Tc(n,n.return);break;case 5:if(Hc(t,e),Wc(e),i&512&&n!==null&&Tc(n,n.return),e.flags&32){var a=e.stateNode;try{Fe(a,``)}catch(t){Ql(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&&xe(a,o),He(c,s);var u=He(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?ze(a,f):d===`dangerouslySetInnerHTML`?Pe(a,f):d===`children`?Fe(a,f):S(a,d,f,u)}switch(c){case`input`:Se(a,o);break;case`textarea`:ke(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?Ee(a,!!o.multiple,o.multiple?[]:``,!1):Ee(a,!!o.multiple,o.defaultValue,!0)):Ee(a,!!o.multiple,m,!1)}a[Bi]=o}catch(t){Ql(e,e.return,t)}}break;case 6:if(Hc(t,e),Wc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Ql(e,e.return,t)}}break;case 3:if(Hc(t,e),Wc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{vn(t.containerInfo)}catch(t){Ql(e,e.return,t)}break;case 4:Hc(t,e),Wc(e);break;case 13:Hc(t,e),Wc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(pl=xt())),i&4&&Vc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Cc=(u=Cc)||d,Hc(t,e),Cc=u):Hc(t,e),Wc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(B=e,d=e.child;d!==null;){for(f=B=d;B!==null;){switch(p=B,m=p.child,p.tag){case 0:case 11:case 14:case 15:kc(4,p,p.return);break;case 1:Tc(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){Ql(i,n,e)}}break;case 5:Tc(p,p.return);break;case 22:if(p.memoizedState!==null){Jc(f);continue}}m===null?Jc(f):(m.return=p,B=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=Re(`display`,s))}catch(t){Ql(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Ql(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:Hc(t,e),Wc(e),i&4&&Vc(e);break;case 21:break;default:Hc(t,e),Wc(e)}}function Wc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Nc(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&&(Fe(a,``),i.flags&=-33),Ic(e,Pc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Fc(e,Pc(e),o);break;default:throw Error(r(161))}}catch(t){Ql(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gc(e,t,n){B=e,Kc(e,t,n)}function Kc(e,t,n){for(var r=(e.mode&1)!=0;B!==null;){var i=B,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Sc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||Cc;s=Sc;var l=Cc;if(Sc=o,(Cc=c)&&!l)for(B=i;B!==null;)o=B,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Yc(i):(c.return=o,B=c);for(;a!==null;)B=a,Kc(a,t,n),a=a.sibling;B=i,Sc=s,Cc=l}qc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,B=a):qc(e,t,n)}}function qc(e){for(;B!==null;){var t=B;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Cc||Ac(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Cc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:As(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&_o(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}_o(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&&vn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Cc||t.flags&512&&jc(t)}catch(e){Ql(t,t.return,e)}}if(t===e){B=null;break}if(n=t.sibling,n!==null){n.return=t.return,B=n;break}B=t.return}}function Jc(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var n=t.sibling;if(n!==null){n.return=t.return,B=n;break}B=t.return}}function Yc(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ac(4,t)}catch(e){Ql(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Ql(t,i,e)}}var a=t.return;try{jc(t)}catch(e){Ql(t,a,e)}break;case 5:var o=t.return;try{jc(t)}catch(e){Ql(t,o,e)}}}catch(e){Ql(t,t.return,e)}if(t===e){B=null;break}var s=t.sibling;if(s!==null){s.return=t.return,B=s;break}B=t.return}}var Xc=Math.ceil,Zc=C.ReactCurrentDispatcher,Qc=C.ReactCurrentOwner,$c=C.ReactCurrentBatchConfig,el=0,tl=null,nl=null,rl=0,il=0,al=Zi(0),ol=0,sl=null,cl=0,ll=0,ul=0,dl=null,fl=null,pl=0,ml=1/0,hl=null,gl=!1,_l=null,vl=null,yl=!1,bl=null,xl=0,Sl=0,Cl=null,wl=-1,Tl=0;function El(){return el&6?xt():wl===-1?wl=xt():wl}function Dl(e){return e.mode&1?el&2&&rl!==0?rl&-rl:Ha.transition===null?(e=qt,e===0?(e=window.event,e=e===void 0?16:En(e.type),e):e):(Tl===0&&(Tl=Ht()),Tl):1}function Ol(e,t,n,i){if(50<Sl)throw Sl=0,Cl=null,Error(r(185));Wt(e,n,i),(!(el&2)||e!==tl)&&(e===tl&&(!(el&2)&&(ll|=n),ol===4&&Pl(e,rl)),kl(e,i),n===1&&el===0&&!(t.mode&1)&&(ml=xt()+500,da&&ha()))}function kl(e,t){var n=e.callbackNode;Bt(e,t);var r=Rt(e,e===tl?rl:0);if(r===0)n!==null&&vt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&vt(n),t===1)e.tag===0?ma(Fl.bind(null,e)):pa(Fl.bind(null,e)),Ni(function(){!(el&6)&&ha()}),n=null;else{switch(Jt(r)){case 1:n=Ct;break;case 4:n=wt;break;case 16:n=Tt;break;case 536870912:n=Dt;break;default:n=Tt}n=iu(n,Al.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Al(e,t){if(wl=-1,Tl=0,el&6)throw Error(r(327));var n=e.callbackNode;if(Xl()&&e.callbackNode!==n)return null;var i=Rt(e,e===tl?rl:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Ul(e,i);else{t=i;var a=el;el|=2;var o=Vl();(tl!==e||rl!==t)&&(hl=null,ml=xt()+500,zl(e,t));do try{Gl();break}catch(t){Bl(e,t)}while(1);$a(),Zc.current=o,el=a,nl===null?(tl=null,rl=0,t=ol):t=0}if(t!==0){if(t===2&&(a=Vt(e),a!==0&&(i=a,t=jl(e,a))),t===1)throw n=sl,zl(e,0),Pl(e,i),kl(e,xt()),n;if(t===6)Pl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Nl(a)&&(t=Ul(e,i),t===2&&(o=Vt(e),o!==0&&(i=o,t=jl(e,o))),t===1))throw n=sl,zl(e,0),Pl(e,i),kl(e,xt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Jl(e,fl,hl);break;case 3:if(Pl(e,i),(i&130023424)===i&&(t=pl+500-xt(),10<t)){if(Rt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){El(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ai(Jl.bind(null,e,fl,hl),t);break}Jl(e,fl,hl);break;case 4:if(Pl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-jt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=xt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Xc(i/1960))-i,10<i){e.timeoutHandle=Ai(Jl.bind(null,e,fl,hl),i);break}Jl(e,fl,hl);break;case 5:Jl(e,fl,hl);break;default:throw Error(r(329))}}}return kl(e,xt()),e.callbackNode===n?Al.bind(null,e):null}function jl(e,t){var n=dl;return e.current.memoizedState.isDehydrated&&(zl(e,t).flags|=256),e=Ul(e,t),e!==2&&(t=fl,fl=n,t!==null&&Ml(t)),e}function Ml(e){fl===null?fl=e:fl.push.apply(fl,e)}function Nl(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(!Pr(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 Pl(e,t){for(t&=~ul,t&=~ll,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-jt(t),r=1<<n;e[n]=-1,t&=~r}}function Fl(e){if(el&6)throw Error(r(327));Xl();var t=Rt(e,0);if(!(t&1))return kl(e,xt()),null;var n=Ul(e,t);if(e.tag!==0&&n===2){var i=Vt(e);i!==0&&(t=i,n=jl(e,i))}if(n===1)throw n=sl,zl(e,0),Pl(e,t),kl(e,xt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jl(e,fl,hl),kl(e,xt()),null}function Il(e,t){var n=el;el|=1;try{return e(t)}finally{el=n,el===0&&(ml=xt()+500,da&&ha())}}function Ll(e){bl!==null&&bl.tag===0&&!(el&6)&&Xl();var t=el;el|=1;var n=$c.transition,r=qt;try{if($c.transition=null,qt=1,e)return e()}finally{qt=r,$c.transition=n,el=t,!(el&6)&&ha()}}function Rl(){il=al.current,Qi(al)}function zl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ji(n)),nl!==null)for(n=nl.return;n!==null;){var r=n;switch(Oa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&aa();break;case 3:wo(),Qi(na),Qi(ta),Ao();break;case 5:Eo(r);break;case 4:wo();break;case 13:Qi(Do);break;case 19:Qi(Do);break;case 10:eo(r.type._context);break;case 22:case 23:Rl()}n=n.return}if(tl=e,nl=e=lu(e.current,null),rl=il=t,ol=0,sl=null,ul=ll=cl=0,fl=dl=null,io!==null){for(t=0;t<io.length;t++)if(n=io[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}io=null}return e}function Bl(e,t){do{var n=nl;try{if($a(),jo.current=Es,Lo){for(var i=Po.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Lo=!1}if(No=0,Io=Fo=Po=null,Ro=!1,zo=0,Qc.current=null,n===null||n.return===null){ol=1,sl=t,nl=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=rl,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=Us(s);if(m!==null){m.flags&=-257,z(m,s,c,o,t),m.mode&1&&Hs(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)){Hs(o,u,t),Hl();break a}l=Error(r(426))}}else if(ja&&c.mode&1){var _=Us(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),z(_,s,c,o,t),Va(Is(l,c));break a}}o=l=Is(l,c),ol!==4&&(ol=2),dl===null?dl=[o]:dl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Bs(o,l,t);ho(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`&&(vl===null||!vl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Vs(o,c,t);ho(o,x);break a}}o=o.return}while(o!==null)}ql(n)}catch(e){t=e,nl===n&&n!==null&&(nl=n=n.return);continue}break}while(1)}function Vl(){var e=Zc.current;return Zc.current=Es,e===null?Es:e}function Hl(){(ol===0||ol===3||ol===2)&&(ol=4),tl===null||!(cl&268435455)&&!(ll&268435455)||Pl(tl,rl)}function Ul(e,t){var n=el;el|=2;var i=Vl();(tl!==e||rl!==t)&&(hl=null,zl(e,t));do try{Wl();break}catch(t){Bl(e,t)}while(1);if($a(),el=n,Zc.current=i,nl!==null)throw Error(r(261));return tl=null,rl=0,ol}function Wl(){for(;nl!==null;)Kl(nl)}function Gl(){for(;nl!==null&&!yt();)Kl(nl)}function Kl(e){var t=ru(e.alternate,e,il);e.memoizedProps=e.pendingProps,t===null?ql(e):nl=t,Qc.current=null}function ql(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=xc(n,t),n!==null){n.flags&=32767,nl=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ol=6,nl=null;return}}else if(n=bc(n,t,il),n!==null){nl=n;return}if(t=t.sibling,t!==null){nl=t;return}nl=t=e}while(t!==null);ol===0&&(ol=5)}function Jl(e,t,n){var r=qt,i=$c.transition;try{$c.transition=null,qt=1,Yl(e,t,n,r)}finally{$c.transition=i,qt=r}return null}function Yl(e,t,n,i){do Xl();while(bl!==null);if(el&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(Gt(e,o),e===tl&&(nl=tl=null,rl=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||yl||(yl=!0,iu(Tt,function(){return Xl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=$c.transition,$c.transition=null;var s=qt;qt=1;var c=el;el|=4,Qc.current=null,Oc(e,n),Uc(n,e),Vr(Oi),bn=!!Di,Oi=Di=null,e.current=n,Gc(n,e,a),bt(),el=c,qt=s,$c.transition=o}else e.current=n;if(yl&&(yl=!1,bl=e,xl=a),o=e.pendingLanes,o===0&&(vl=null),At(n.stateNode,i),kl(e,xt()),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(gl)throw gl=!1,e=_l,_l=null,e;return xl&1&&e.tag!==0&&Xl(),o=e.pendingLanes,o&1?e===Cl?Sl++:(Sl=0,Cl=e):Sl=0,ha(),null}function Xl(){if(bl!==null){var e=Jt(xl),t=$c.transition,n=qt;try{if($c.transition=null,qt=16>e?16:e,bl===null)var i=!1;else{if(e=bl,bl=null,xl=0,el&6)throw Error(r(331));var a=el;for(el|=4,B=e.current;B!==null;){var o=B,s=o.child;if(B.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(B=u;B!==null;){var d=B;switch(d.tag){case 0:case 11:case 15:kc(8,d,o)}var f=d.child;if(f!==null)f.return=d,B=f;else for(;B!==null;){d=B;var p=d.sibling,m=d.return;if(Mc(d),d===u){B=null;break}if(p!==null){p.return=m,B=p;break}B=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)}}B=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,B=s;else b:for(;B!==null;){if(o=B,o.flags&2048)switch(o.tag){case 0:case 11:case 15:kc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,B=v;break b}B=o.return}}var y=e.current;for(B=y;B!==null;){s=B;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,B=b;else b:for(s=y;B!==null;){if(c=B,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Ac(9,c)}}catch(e){Ql(c,c.return,e)}if(c===s){B=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,B=x;break b}B=c.return}}if(el=a,ha(),kt&&typeof kt.onPostCommitFiberRoot==`function`)try{kt.onPostCommitFiberRoot(Ot,e)}catch{}i=!0}return i}finally{qt=n,$c.transition=t}}return!1}function Zl(e,t,n){t=Is(n,t),t=Bs(e,t,1),e=po(e,t,1),t=El(),e!==null&&(Wt(e,1,t),kl(e,t))}function Ql(e,t,n){if(e.tag===3)Zl(e,e,n);else for(;t!==null;){if(t.tag===3){Zl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vl===null||!vl.has(r))){e=Is(n,e),e=Vs(t,e,1),t=po(t,e,1),e=El(),t!==null&&(Wt(t,1,e),kl(t,e));break}}t=t.return}}function $l(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=El(),e.pingedLanes|=e.suspendedLanes&n,tl===e&&(rl&n)===n&&(ol===4||ol===3&&(rl&130023424)===rl&&500>xt()-pl?zl(e,0):ul|=n),kl(e,t)}function eu(e,t){t===0&&(e.mode&1?(t=It,It<<=1,!(It&130023424)&&(It=4194304)):t=1);var n=El();e=so(e,t),e!==null&&(Wt(e,t,n),kl(e,n))}function tu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),eu(e,n)}function nu(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),eu(e,n)}var ru=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||na.current)Gs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Gs=!1,mc(e,t,n);Gs=!!(e.flags&131072)}else Gs=!1,ja&&t.flags&1048576&&Ea(t,ya,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;fc(e,t),e=t.pendingProps;var a=L(t,ta.current);no(t,n),a=Uo(null,t,i,e,a,n);var o=Wo();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,ia(i)?(o=!0,ca(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,lo(t),a.updater=js,t.stateNode=a,a._reactInternals=t,Fs(t,i,e,n),t=ec(null,t,i,!0,o,n)):(t.tag=0,ja&&o&&Da(t),Ks(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(fc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=cu(i),e=As(i,e),a){case 0:t=Qs(null,t,i,e,n);break a;case 1:t=$s(null,t,i,e,n);break a;case 11:t=qs(null,t,i,e,n);break a;case 14:t=Js(null,t,i,As(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:As(i,a),Qs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:As(i,a),$s(e,t,i,a,n);case 3:a:{if(tc(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,uo(e,t),go(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=Is(Error(r(423)),t),t=nc(e,t,i,n,a);break a}else if(i!==a){a=Is(Error(r(424)),t),t=nc(e,t,i,n,a);break a}else for(Aa=Ii(t.stateNode.containerInfo.firstChild),ka=t,ja=!0,Ma=null,n=Ja(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ba(),i===a){t=pc(e,t,n);break a}Ks(e,t,i,n)}t=t.child}return t;case 5:return To(t),e===null&&Ia(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,ki(i,a)?s=null:o!==null&&ki(i,o)&&(t.flags|=32),Zs(e,t),Ks(e,t,s,n),t.child;case 6:return e===null&&Ia(t),null;case 13:return ac(e,t,n);case 4:return Co(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=qa(t,null,i,n):Ks(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:As(i,a),qs(e,t,i,a,n);case 7:return Ks(e,t,t.pendingProps,n),t.child;case 8:return Ks(e,t,t.pendingProps.children,n),t.child;case 12:return Ks(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,$i(Ya,i._currentValue),i._currentValue=s,o!==null)if(Pr(o.value,s)){if(o.children===a.children&&!na.current){t=pc(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=fo(-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),to(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),to(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}Ks(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,no(t,n),a=ro(a),i=i(a),t.flags|=1,Ks(e,t,i,n),t.child;case 14:return i=t.type,a=As(i,t.pendingProps),a=As(i.type,a),Js(e,t,i,a,n);case 15:return Ys(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:As(i,a),fc(e,t),t.tag=1,ia(i)?(e=!0,ca(t)):e=!1,no(t,n),Ns(t,i,a),Fs(t,i,a,n),ec(null,t,i,!0,e,n);case 19:return dc(e,t,n);case 22:return Xs(e,t,n)}throw Error(r(156,t.tag))};function iu(e,t){return _t(e,t)}function au(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 ou(e,t,n,r){return new au(e,t,n,r)}function su(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cu(e){if(typeof e==`function`)return+!!su(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===N)return 14}return 2}function lu(e,t){var n=e.alternate;return n===null?(n=ou(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 uu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)su(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return du(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=ou(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=ou(13,n,t,a),e.elementType=M,e.lanes=o,e;case ee:return e=ou(19,n,t,a),e.elementType=ee,e.lanes=o,e;case ne:return fu(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 N:s=14;break a;case te:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=ou(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function du(e,t,n,r){return e=ou(7,e,r,t),e.lanes=n,e}function fu(e,t,n,r){return e=ou(22,e,r,t),e.elementType=ne,e.lanes=n,e.stateNode={isHidden:!1},e}function pu(e,t,n){return e=ou(6,e,null,t),e.lanes=n,e}function mu(e,t,n){return t=ou(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hu(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=Ut(0),this.expirationTimes=Ut(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function gu(e,t,n,r,i,a,o,s,c){return e=new hu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=ou(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},lo(a),e}function _u(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 vu(e){if(!e)return ea;e=e._reactInternals;a:{if(dt(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(ia(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(ia(n))return sa(e,n,t)}return t}function yu(e,t,n,r,i,a,o,s,c){return e=gu(n,r,!0,e,i,a,o,s,c),e.context=vu(null),n=e.current,r=El(),i=Dl(n),a=fo(r,i),a.callback=t??null,po(n,a,i),e.current.lanes=i,Wt(e,i,r),kl(e,r),e}function bu(e,t,n,r){var i=t.current,a=El(),o=Dl(i);return n=vu(n),t.context===null?t.context=n:t.pendingContext=n,t=fo(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=po(i,t,o),e!==null&&(Ol(e,i,o,a),mo(e,i,o)),o}function xu(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 Su(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Cu(e,t){Su(e,t),(e=e.alternate)&&Su(e,t)}function wu(){return null}var Tu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Eu(e){this._internalRoot=e}Du.prototype.render=Eu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));bu(e,t,null,null)},Du.prototype.unmount=Eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ll(function(){bu(null,e,null,null)}),t[Vi]=null}};function Du(e){this._internalRoot=e}Du.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cn.length&&t!==0&&t<cn[n].priority;n++);cn.splice(n,0,e),n===0&&pn(e)}};function Ou(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ku(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function Au(){}function ju(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=xu(o);a.call(e)}}var o=yu(t,r,e,0,null,!1,!1,``,Au);return e._reactRootContainer=o,e[Vi]=o.current,hi(e.nodeType===8?e.parentNode:e),Ll(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=xu(c);s.call(e)}}var c=gu(e,0,!1,null,null,!1,!1,``,Au);return e._reactRootContainer=c,e[Vi]=c.current,hi(e.nodeType===8?e.parentNode:e),Ll(function(){bu(t,c,n,r)}),c}function Mu(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=xu(o);s.call(e)}}bu(t,o,e,i)}else o=ju(n,t,e,i,r);return xu(o)}Yt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Lt(t.pendingLanes);n!==0&&(Kt(t,n|1),kl(t,xt()),!(el&6)&&(ml=xt()+500,ha()))}break;case 13:Ll(function(){var t=so(e,1);t!==null&&Ol(t,e,1,El())}),Cu(e,1)}},Xt=function(e){if(e.tag===13){var t=so(e,134217728);t!==null&&Ol(t,e,134217728,El()),Cu(e,134217728)}},Zt=function(e){if(e.tag===13){var t=Dl(e),n=so(e,t);n!==null&&Ol(n,e,t,El()),Cu(e,t)}},Qt=function(){return qt},$t=function(e,t){var n=qt;try{return qt=e,t()}finally{qt=n}},Ge=function(e,t,n){switch(t){case`input`:if(Se(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=Ji(i);if(!a)throw Error(r(90));_e(i),Se(i,a)}}}break;case`textarea`:ke(e,n);break;case`select`:t=n.value,t!=null&&Ee(e,!!n.multiple,t,!1)}},Ze=Il,Qe=Ll;var Nu={usingClientEntryPoint:!1,Events:[Ki,qi,Ji,Ye,Xe,Il]},Pu={findFiberByHostInstance:Gi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Fu={bundleType:Pu.bundleType,version:Pu.version,rendererPackageName:Pu.rendererPackageName,rendererConfig:Pu.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=ht(e),e===null?null:e.stateNode},findFiberByHostInstance:Pu.findFiberByHostInstance||wu,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 Iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Iu.isDisabled&&Iu.supportsFiber)try{Ot=Iu.inject(Fu),kt=Iu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ou(t))throw Error(r(200));return _u(e,t,null,n)},e.createRoot=function(e,t){if(!Ou(e))throw Error(r(299));var n=!1,i=``,a=Tu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=gu(e,1,!1,null,null,n,!1,i,a),e[Vi]=t.current,hi(e.nodeType===8?e.parentNode:e),new Eu(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=ht(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Ll(e)},e.hydrate=function(e,t,n){if(!ku(t))throw Error(r(200));return Mu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!Ou(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=Tu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=yu(t,null,e,1,n??null,a,!1,o,s),e[Vi]=t.current,hi(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 Du(t)},e.render=function(e,t,n){if(!ku(t))throw Error(r(200));return Mu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!ku(e))throw Error(r(40));return e._reactRootContainer?(Ll(function(){Mu(null,null,e,!1,function(){e._reactRootContainer=null,e[Vi]=null})}),!0):!1},e.unstable_batchedUpdates=Il,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!ku(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Mu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),h=o(((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=m()})),g=o((e=>{var t=h();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 _=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}},v=`https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page`,y=`pie-mathjax-version-conflict`,b=Symbol.for(`@pie-element/shared-math-rendering-mathjax/unsupported-page`);function x(e,t){if(typeof window>`u`)return;let n=globalThis;n[b]??={logged:!1,conditions:[]};let r=n[b];if(r.conditions.includes(e))return;r.conditions.push(e);let i=`[math-rendering] Unsupported page (${e}): ${t}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${v}`;r.logged||(r.logged=!0,console.error(i)),window.dispatchEvent(new CustomEvent(y,{detail:{condition:e,message:i,docsUrl:v}}))}function S(){let e=window.MathJax?.version;return typeof e==`string`&&e.startsWith(`3.`)?e:void 0}var C=`https://cdn.jsdelivr.net/npm/mathjax@4.1.3/tex-mml-chtml.js`,w={parallelogram:`\\lower.2em{\\Huge\\unicode{x25B1}}`,overarc:`\\overparen`,napprox:`\\not\\approx`,longdiv:`\\enclose{longdiv}`,abs:[`\\left|#1\\right|`,1]},T=`[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)`,E=/\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/,D=/\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/,O=/\\embed\{newLine\}\[\]/g,k=[[`$$`,`$$`],[`$`,`$`],[`\\[`,`\\]`],[`\\(`,`\\)`]],A=Symbol.for(`@pie-element/shared-math-rendering-mathjax/loading`),j=`PIE-MJX-CHTML-styles`,M=`MJX-CHTML-styles`,ee=[M,`MJX-SVG-styles`],N=201;function te(e){let t=[...e.matches(`mjx-container`)?[e]:[],...e.querySelectorAll(`mjx-container`)];for(let e of t)for(let t of[e,...e.querySelectorAll(`[data-latex],[data-latex-item]`)])t.removeAttribute(`data-latex`),t.removeAttribute(`data-latex-item`)}function ne(){return window.MathJax}function re(e){for(let[t,n]of k)if(e.startsWith(t)&&e.endsWith(n))return e.substring(t.length,e.length-n.length);return e}function ie(e){return re(e.includes(`\\displaystyle`)?e.replace(`\\displaystyle`,``).trim():e)}var ae=`mathjax_ignore`,oe=`mathjax_process`;function se(e,t){let n=e.closest(`.${ae}, .${oe}`);return n!==null&&t.contains(n)&&!n.classList.contains(oe)}function ce(e){for(let t of e.querySelectorAll(`[data-latex]`)){if(t.dataset.mathHandled||t.closest(`mjx-container`)||se(t,e))continue;let n=t.textContent;n&&(t.textContent=`\\(${ie(n)}\\)`.replace(O,`\\newline `),t.dataset.mathHandled=`true`)}}function le(e,t){for(let t of e.querySelectorAll(`math`))if(!t.closest(`mjx-assistive-mml`))return!0;return(t?D:E).test(e.textContent??``)}function ue(e){return new Promise((t,n)=>{let{useSingleDollar:r=!1,accessibility:i=!0,loadFonts:a=!0,srcUrl:o}=e,s={loader:{load:i?[`a11y/assistive-mml`]:[],failed:e=>n(e)},startup:{typeset:!1,ready:()=>{let e=ne(),r=e?.startup,i=!!e?.version?.startsWith(`4.`);i&&de(e),r?.defaultReady?.(),i&&fe(r?.document),Promise.resolve(r?.promise).then(()=>t(),n)}},tex:{macros:{...w}},options:{enableMenu:i,menuOptions:{settings:{assistiveMml:i,enrich:!1,inTabOrder:!1}}}};r&&s.tex&&(console.warn(T),s.tex.inlineMath=[[`$`,`$`],[`\\(`,`\\)`]],s.tex.processEscapes=!0),a||(s.chtml={fontURL:``}),window.MathJax=s;let c=document.createElement(`script`);c.src=o||C,c.async=!0,c.onerror=()=>n(Error(`Failed to load MathJax`)),document.head.appendChild(c)})}function de(e){let t=e?._?.output?.chtml_ts?.CHTML;t&&(t.STYLESHEETID=j)}function fe(e){if(!e)return;let t=new WeakSet,n=e=>{let n=e.typesetRoot;!n||t.has(n)||(te(n),t.add(n))};e.addRenderAction?.(`pie-strip-latex`,N,e=>{for(let t of e.math??[])n(t);return!1},e=>{let t=e.typesetRoot;return t&&te(t),!1});let r=e.outputJax?.chtmlStyles;r?.id===M&&(r.id=j),he()}function pe(e){return e instanceof HTMLStyleElement&&ee.includes(e.id)}function me(e){x(`foreign-output-stylesheet`,`another MathJax added <style id="${e.id}"> to <head>`)}function he(){let e=document.head,t=[...e.children].find(pe);if(t){me(t);return}let n=new MutationObserver(e=>{for(let t of e){let e=[...t.addedNodes].find(pe);if(e){me(e),n.disconnect();return}}});n.observe(e,{childList:!0})}function ge(e){return new Promise((t,n)=>{let r=e.startup??{};e.startup=r;let i=r.ready;r.ready=()=>{let e=ne()?.startup;i?i.call(r):e?.defaultReady?.(),Promise.resolve(e?.promise).then(()=>t(),n)}})}function _e(e){let t=ne();return t?t.version?t.startup?.promise?Promise.resolve(t.startup.promise).then(()=>void 0):Promise.resolve():ge(t):ue(e)}function ve(e){return _e(e).then(()=>{typeof ne()?.typesetPromise!=`function`&&console.warn(`[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.`)})}function ye(e){let t=globalThis,n=t[A];return n||(n=ve(e),t[A]=n),n}function be(e={}){let t=e.useSingleDollar??!1;return async n=>{if(typeof window>`u`)return;let r=S();r&&x(`mathjax-3-global`,`window.MathJax is MathJax ${r}`),ce(n);let i=ye(e);if(!le(n,t)){i.catch(()=>{});return}await i;let a=ne();await a?.startup?.promise,typeof a?.typesetPromise==`function`&&(await a.typesetPromise([n]),te(n))}}var xe=`@pie-lib/math-rendering`,Se=`@pie-lib/math-rendering@2`,Ce=`pie-print`,we=50,Te=1e4,Ee=null;function De(){return!!window[Se]?.opts?.useSingleDollar}function Oe(){return Ee||=be({useSingleDollar:De()}),Ee}function ke(){if(typeof window>`u`)return null;let e=window[xe];return typeof e?.renderMath==`function`&&e.renderMath!==Ne?e:null}function Ae(e){let t=e;for(;t;){if(t instanceof Element&&t.localName===Ce)return t;t=t instanceof ShadowRoot?t.host:t.parentNode}return null}function je(){let e=window.renderMath;return typeof e==`function`?e:null}async function Me(e){let t=Ae(e);if(!t)return null;let n=je();if(n||t.mathRenderingModuleUrlImported!==!0)return n;let r=Date.now()+Te;for(;Date.now()<r;){await new Promise(e=>setTimeout(e,we));let e=je();if(e)return e}return null}var Ne=async e=>{if(typeof window>`u`)return;let t=typeof e==`string`,n;t?(n=document.createElement(`div`),n.innerHTML=e):n=e||document.body;let r=ke(),i=r||t?null:await Me(n);return r?await r.renderMath?.(n):i&&i!==Ne?await i(n):await Oe()(n),t?n.innerHTML:void 0},Pe=(e,t)=>{let n=ke()?.wrapMath?.(e,t);if(n!=null)return n;let[r,i]=t===`dollar`||t===`double_dollar`?[`$`,`$`]:[`\\(`,`\\)`];return`${r}${re(e)}${i}`},Fe=e=>{let t=e.trim();return t.startsWith(`\\[`)&&t.endsWith(`\\]`)?{unwrapped:t.slice(2,-2).trim(),wrapper:{open:`\\[`,close:`\\]`}}:t.startsWith(`\\(`)&&t.endsWith(`\\)`)?{unwrapped:t.slice(2,-2).trim(),wrapper:{open:`\\(`,close:`\\)`}}:t.startsWith(`$$`)&&t.endsWith(`$$`)?{unwrapped:t.slice(2,-2).trim(),wrapper:{open:`$$`,close:`$$`}}:t.startsWith(`$`)&&t.endsWith(`$`)?{unwrapped:t.slice(1,-1).trim(),wrapper:{open:`$`,close:`$`}}:{unwrapped:t}},Ie={line:e=>e&&Ie.point(e.from)&&Ie.point(e.to),point:e=>e&&Number.isFinite(e.x)&&Number.isFinite(e.y)},Le=(e,t)=>Number(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2).toFixed(3)),Re=(e,t)=>{let n=e,r=!1,i=[...t];i.push(t[0]);for(let e=0;e<i.length-1;e++){let t=i[e],a=i[e+1];if(Le(t,n)+Le(n,a)===Le(t,a)){r=!0;break}}return r},ze=(e,t,n,r,i,a,o,s)=>{let c,l=(s-a)*(n-e)-(o-i)*(r-t);return l===0?null:(c=((o-i)*(t-a)-(s-a)*(e-i))/l,{x:Number((e+c*(n-e)).toFixed(3)),y:Number((t+c*(r-t)).toFixed(3))})},Be=(e,t,n)=>e.x>t.min&&e.x<t.max&&e.y>n.min&&e.y<n.max,Ve=(e,t,n)=>e.x>=t.min&&e.x<=t.max&&e.y>=n.min&&e.y<=n.max,He=(e,t,n)=>{let r=[],i=[[t.max,n.max,t.max,n.min],[t.min,n.max,t.min,n.min],[t.min,n.max,t.max,n.max],[t.min,n.min,t.max,n.min]];for(let a=0;a<i.length;a++){let o=ze(e.from.x,e.from.y,e.to.x,e.to.y,i[a][0],i[a][1],i[a][2],i[a][3]);o&&Ve(o,t,n)&&r.push(o)}return r},Ue=e=>{e.sort((e,t)=>e.y-t.y);let t=(e[0].y+e[e.length-1].y)/2;e.sort((e,t)=>t.x-e.x);let n={x:(e[0].x+e[e.length-1].x)/2,y:t},r;e.forEach(e=>{let t=Math.atan2(e.y-n.y,e.x-n.x);r?t<r&&(t+=Math.PI*2):r=t,e.angle=t}),e.sort((e,t)=>e.angle-t.angle);let i=e.reverse();return i.unshift(i.pop()),i.map(({angle:e,...t})=>t)},We=(e,t)=>e.x*t.x+e.y*t.y,Ge=e=>Math.sqrt(e.x*e.x+e.y*e.y),Ke=(e,t)=>{let n=We(e,t),r=Ge(e),i=Ge(t);return Math.acos(n/(r*i))},qe=(e,t,n,r)=>{let i={x:t.x-e.x,y:t.y-e.y},a={x:n.x-e.x,y:n.y-e.y},o={x:r.x-e.x,y:r.y-e.y},s=Ke(i,o)+Ke(a,o);return Math.abs(s-Ke(i,a))<1e-4},Je=e=>e.filter((t,n)=>n===e.findIndex(e=>t.x===e.x&&t.y===e.y)),Ye=e=>{for(let t=0;t<e.length;t++)e[t]=e[t].filter((n,r)=>r===e[t].findIndex(e=>n.x===e.x&&n.y===e.y));e=e.filter(e=>e.length>2);for(let t=0;t<e.length;t++)e[t]=Ue(e[t]);return e},Xe=(e,t,n)=>{let r=[];return r.push([].concat(e)),r.push([].concat(e)),e[0].x===t.max&&e[1].y===n.max||e[1].x===t.max&&e[0].y===n.max?(r[0].push({x:t.max,y:n.max}),r[1].push({x:t.min,y:n.max},{x:t.min,y:n.min},{x:t.max,y:n.min})):e[0].x===t.min&&e[1].y===n.max||e[1].x===t.min&&e[0].y===n.max?(r[0].push({x:t.min,y:n.max}),r[1].push({x:t.max,y:n.max},{x:t.max,y:n.min},{x:t.min,y:n.min})):e[0].x===t.min&&e[1].y===n.min||e[1].x===t.min&&e[0].y===n.min?(r[0].push({x:t.min,y:n.min}),r[1].push({x:t.max,y:n.min},{x:t.max,y:n.max},{x:t.min,y:n.max})):e[0].x===t.max&&e[1].y===n.min||e[1].x===t.max&&e[0].y===n.min?(r[0].push({x:t.max,y:n.min}),r[1].push({x:t.min,y:n.min},{x:t.min,y:n.max},{x:t.max,y:n.max})):e[0].x===t.min&&e[1].x===t.max||e[0].x===t.max&&e[1].x===t.min?(r[0].push({x:t.min,y:n.max},{x:t.max,y:n.max}),r[1].push({x:t.min,y:n.min},{x:t.max,y:n.min})):(e[0].y===n.min&&e[1].y===n.max||e[0].y===n.max&&e[1].y===n.min)&&(r[0].push({x:t.min,y:n.min},{x:t.min,y:n.max}),r[1].push({x:t.max,y:n.min},{x:t.max,y:n.max})),Ye(r)},Ze=(e,t,n,r)=>{let i=t[0],a=t[1],o=[{x:n.min,y:r.min},{x:n.min,y:r.max},{x:n.max,y:r.min},{x:n.max,y:r.max}],s=ze(i.from.x,i.from.y,i.to.x,i.to.y,a.from.x,a.from.y,a.to.x,a.to.y),c=[],l=He(i,n,r);l=Je(l);let u=He(a,n,r);if(u=Je(u),s&&Be(s,n,r))for(let e=0;e<l.length;e++)for(let t=0;t<u.length;t++){let n=[],r=[];n.push(s),n.push(l[e]),n.push(u[t]);for(let i=0;i<o.length;i++)qe(s,l[e],u[t],o[i])?n.push(o[i]):r.push(o[i]);o=r,c.push(n)}else{let e=Xe(l,n,r),t=Xe(u,n,r);for(let t=0;t<e.length;t++)Re(u[0],e[t])&&Re(u[1],e[t])||c.push(e[t]);for(let e=0;e<t.length;e++)Re(l[0],t[e])&&Re(l[1],t[e])||c.push(t[e]);for(let e=0;e<c.length;e++)o=o.filter(function(t){return!c[e].some(function(e){return t.x===e.x&&t.y===e.y})});let i=o.concat(l,u);c.push(i)}return Ye(c)},Qe=(e,t,n,r)=>(e.numberOfLines===1?e.sections=Xe(He(t[0],n,r),n,r):e.sections=Ze(e,t,n,r),e),$e=(e,t)=>{let n=t.length,r=e.x,i=e.y,a=!1,o=t[0],s;for(let e=1;e<=n;e++){if(s=t[e%n],i>Math.min(o.y,s.y)&&i<=Math.max(o.y,s.y)&&r<=Math.max(o.x,s.x)){let e=(i-o.y)*(s.x-o.x)/(s.y-o.y)+o.x;(o.x===s.x||r<=e)&&(a=!a)}o=s}return a},et=(e,t)=>{if(t.length===0)return!1;if(e.numberOfLines===1){if(t.length===1)return!t[0].building}else if(t.length!==2)return!1;else return!t[1].building},tt=e=>e?(e||[]).filter(({type:e,...t})=>Ie[e]?Ie[e](t):!1):[],nt=function(){return null};nt.isRequired=nt;var rt=()=>nt,P={array:nt,bigint:nt,bool:nt,func:nt,number:nt,object:nt,string:nt,symbol:nt,any:nt,element:nt,elementType:nt,node:nt,arrayOf:rt,instanceOf:rt,objectOf:rt,oneOf:rt,oneOfType:rt,shape:rt,exact:rt,checkPropTypes:()=>{},resetWarningCache:()=>{}};P.PropTypes=P;function it(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 at=`$$material`;function ot(){return ot=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},ot.apply(null,arguments)}function st(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 ct(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 lt=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||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(ct(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=st(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}(),ut=`-ms-`,dt=`-moz-`,ft=`-webkit-`,pt=`comm`,mt=`rule`,ht=`decl`,gt=`@import`,_t=`@keyframes`,vt=`@layer`,yt=Math.abs,bt=String.fromCharCode,xt=Object.assign;function St(e,t){return Dt(e,0)^45?(((t<<2^Dt(e,0))<<2^Dt(e,1))<<2^Dt(e,2))<<2^Dt(e,3):0}function Ct(e){return e.trim()}function wt(e,t){return(e=t.exec(e))?e[0]:e}function Tt(e,t,n){return e.replace(t,n)}function Et(e,t){return e.indexOf(t)}function Dt(e,t){return e.charCodeAt(t)|0}function Ot(e,t,n){return e.slice(t,n)}function kt(e){return e.length}function At(e){return e.length}function jt(e,t){return t.push(e),e}function Mt(e,t){return e.map(t).join(``)}var Nt=1,Pt=1,Ft=0,It=0,Lt=0,Rt=``;function zt(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Nt,column:Pt,length:o,return:``}}function Bt(e,t){return xt(zt(``,null,null,``,null,null,0),e,{length:-e.length},t)}function Vt(){return Lt}function Ht(){return Lt=It>0?Dt(Rt,--It):0,Pt--,Lt===10&&(Pt=1,Nt--),Lt}function Ut(){return Lt=It<Ft?Dt(Rt,It++):0,Pt++,Lt===10&&(Pt=1,Nt++),Lt}function Wt(){return Dt(Rt,It)}function Gt(){return It}function Kt(e,t){return Ot(Rt,e,t)}function qt(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 Jt(e){return Nt=Pt=1,Ft=kt(Rt=e),It=0,[]}function Yt(e){return Rt=``,e}function Xt(e){return Ct(Kt(It-1,$t(e===91?e+2:e===40?e+1:e)))}function Zt(e){for(;(Lt=Wt())&&Lt<33;)Ut();return qt(e)>2||qt(Lt)>3?``:` `}function Qt(e,t){for(;--t&&Ut()&&!(Lt<48||Lt>102||Lt>57&&Lt<65||Lt>70&&Lt<97););return Kt(e,Gt()+(t<6&&Wt()==32&&Ut()==32))}function $t(e){for(;Ut();)switch(Lt){case e:return It;case 34:case 39:e!==34&&e!==39&&$t(Lt);break;case 40:e===41&&$t(e);break;case 92:Ut();break}return It}function en(e,t){for(;Ut()&&e+Lt!==57&&!(e+Lt===84&&Wt()===47););return`/*`+Kt(t,It-1)+`*`+bt(e===47?e:Ut())}function tn(e){for(;!qt(Wt());)Ut();return Kt(e,It)}function nn(e){return Yt(rn(``,null,null,null,[``],e=Jt(e),0,[0],e))}function rn(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=Ut()){case 40:if(m!=108&&Dt(C,d-1)==58){Et(C+=Tt(Xt(v),`&`,`&\f`),`&\f`)!=-1&&(_=-1);break}case 34:case 39:case 91:C+=Xt(v);break;case 9:case 10:case 13:case 32:C+=Zt(m);break;case 92:C+=Qt(Gt()-1,7);continue;case 47:switch(Wt()){case 42:case 47:jt(on(en(Ut(),Gt()),t,n),c);break;default:C+=`/`}break;case 123*h:s[l++]=kt(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=Tt(C,/\f/g,``)),p>0&&kt(C)-d&&jt(p>32?sn(C+`;`,r,n,d-1):sn(Tt(C,` `,``)+`;`,r,n,d-2),c);break;case 59:C+=`;`;default:if(jt(S=an(C,t,n,l,u,i,s,y,b=[],x=[],d),a),v===123)if(u===0)rn(C,t,S,S,b,a,d,s,x);else switch(f===99&&Dt(C,3)===110?100:f){case 100:case 108:case 109:case 115:rn(e,S,S,r&&jt(an(e,S,S,0,0,i,s,y,i,b=[],d),x),i,x,d,s,r?b:x);break;default:rn(C,S,S,S,[``],x,0,s,x)}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+kt(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&Ht()==125)continue}switch(C+=bt(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(kt(C)-1)*_,_=1;break;case 64:Wt()===45&&(C+=Xt(Ut())),f=Wt(),u=d=kt(y=C+=tn(Gt())),v++;break;case 45:m===45&&kt(C)==2&&(h=0)}}return a}function an(e,t,n,r,i,a,o,s,c,l,u){for(var d=i-1,f=i===0?a:[``],p=At(f),m=0,h=0,g=0;m<r;++m)for(var _=0,v=Ot(e,d+1,d=yt(h=o[m])),y=e;_<p;++_)(y=Ct(h>0?f[_]+` `+v:Tt(v,/&\f/g,f[_])))&&(c[g++]=y);return zt(e,t,n,i===0?mt:s,c,l,u)}function on(e,t,n){return zt(e,t,n,pt,bt(Vt()),Ot(e,2,-2),0)}function sn(e,t,n,r){return zt(e,t,n,ht,Ot(e,0,r),Ot(e,r+1,-1),r)}function cn(e,t){for(var n=``,r=At(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||``;return n}function ln(e,t,n,r){switch(e.type){case vt:if(e.children.length)break;case gt:case ht:return e.return=e.return||e.value;case pt:return``;case _t:return e.return=e.value+`{`+cn(e.children,r)+`}`;case mt:e.value=e.props.join(`,`)}return kt(n=cn(e.children,r))?e.return=e.value+`{`+n+`}`:``}function un(e){var t=At(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 dn(e){return function(t){t.root||(t=t.return)&&e(t)}}function fn(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var pn=function(e,t,n){for(var r=0,i=0;r=i,i=Wt(),r===38&&i===12&&(t[n]=1),!qt(i);)Ut();return Kt(e,It)},mn=function(e,t){var n=-1,r=44;do switch(qt(r)){case 0:r===38&&Wt()===12&&(t[n]=1),e[n]+=pn(It-1,t,n);break;case 2:e[n]+=Xt(r);break;case 4:if(r===44){e[++n]=Wt()===58?`&\f`:``,t[n]=e[n].length;break}default:e[n]+=bt(r)}while(r=Ut());return e},hn=function(e,t){return Yt(mn(Jt(e),t))},gn=new WeakMap,_n=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&&!gn.get(n))&&!r){gn.set(e,!0);for(var i=[],a=hn(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]}}},vn=function(e){if(e.type===`decl`){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return=``,e.value=``)}};function yn(e,t){switch(St(e,t)){case 5103:return ft+`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 ft+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ft+e+dt+e+ut+e+e;case 6828:case 4268:return ft+e+ut+e+e;case 6165:return ft+e+ut+`flex-`+e+e;case 5187:return ft+e+Tt(e,/(\w+).+(:[^]+)/,ft+`box-$1$2`+ut+`flex-$1$2`)+e;case 5443:return ft+e+ut+`flex-item-`+Tt(e,/flex-|-self/,``)+e;case 4675:return ft+e+ut+`flex-line-pack`+Tt(e,/align-content|flex-|-self/,``)+e;case 5548:return ft+e+ut+Tt(e,`shrink`,`negative`)+e;case 5292:return ft+e+ut+Tt(e,`basis`,`preferred-size`)+e;case 6060:return ft+`box-`+Tt(e,`-grow`,``)+ft+e+ut+Tt(e,`grow`,`positive`)+e;case 4554:return ft+Tt(e,/([^-])(transform)/g,`$1`+ft+`$2`)+e;case 6187:return Tt(Tt(Tt(e,/(zoom-|grab)/,ft+`$1`),/(image-set)/,ft+`$1`),e,``)+e;case 5495:case 3959:return Tt(e,/(image-set\([^]*)/,ft+"$1$`$1");case 4968:return Tt(Tt(e,/(.+:)(flex-)?(.*)/,ft+`box-pack:$3`+ut+`flex-pack:$3`),/s.+-b[^;]+/,`justify`)+ft+e+e;case 4095:case 3583:case 4068:case 2532:return Tt(e,/(.+)-inline(.+)/,ft+`$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(kt(e)-1-t>6)switch(Dt(e,t+1)){case 109:if(Dt(e,t+4)!==45)break;case 102:return Tt(e,/(.+:)(.+)-([^]+)/,`$1`+ft+`$2-$3$1`+dt+(Dt(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~Et(e,`stretch`)?yn(Tt(e,`stretch`,`fill-available`),t)+e:e}break;case 4949:if(Dt(e,t+1)!==115)break;case 6444:switch(Dt(e,kt(e)-3-(~Et(e,`!important`)&&10))){case 107:return Tt(e,`:`,`:`+ft)+e;case 101:return Tt(e,/(.+:)([^;!]+)(;|!.+)?/,`$1`+ft+(Dt(e,14)===45?`inline-`:``)+`box$3$1`+ft+`$2$3$1`+ut+`$2box$3`)+e}break;case 5936:switch(Dt(e,t+11)){case 114:return ft+e+ut+Tt(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return ft+e+ut+Tt(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return ft+e+ut+Tt(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}return ft+e+ut+e+e}return e}var bn=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case ht:e.return=yn(e.value,e.length);break;case _t:return cn([Bt(e,{value:Tt(e.value,`@`,`@`+ft)})],r);case mt:if(e.length)return Mt(e.props,function(t){switch(wt(t,/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:return cn([Bt(e,{props:[Tt(t,/:(read-\w+)/,`:`+dt+`$1`)]})],r);case`::placeholder`:return cn([Bt(e,{props:[Tt(t,/:(plac\w+)/,`:`+ft+`input-$1`)]}),Bt(e,{props:[Tt(t,/:(plac\w+)/,`:`+dt+`$1`)]}),Bt(e,{props:[Tt(t,/:(plac\w+)/,ut+`input-$1`)]})],r)}return``})}}],xn=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||bn,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=[_n,vn],l,u=[ln,dn(function(e){l.insert(e)})],d=un(c.concat(r,u)),f=function(e){return cn(nn(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 lt({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},Sn=o((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})),Cn=o(((e,t)=>{t.exports=Sn()})),wn=o(((e,t)=>{var n=Cn(),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}));function Tn(e,t,n){var r=``;return n.split(` `).forEach(function(n){e[n]===void 0?n&&(r+=n+` `):t.push(e[n]+`;`)}),r}var En=function(e,t,n){var r=e.key+`-`+t.name;n===!1&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},Dn=function(e,t,n){En(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 On(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 kn={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},An=/[A-Z]|^ms/g,jn=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Mn=function(e){return e.charCodeAt(1)===45},Nn=function(e){return e!=null&&typeof e!=`boolean`},Pn=fn(function(e){return Mn(e)?e:e.replace(An,`-$&`).toLowerCase()}),Fn=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(jn,function(e,t,n){return zn={name:t,styles:n,next:zn},t})}return kn[e]!==1&&!Mn(e)&&typeof t==`number`&&t!==0?t+`px`:t};function In(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 zn={name:i.name,styles:i.styles,next:zn},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)zn={name:o.name,styles:o.styles,next:zn},o=o.next;return a.styles+`;`}return Ln(e,t,n);case`function`:if(e!==void 0){var s=zn,c=n(e);return zn=s,In(e,t,c)}break}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function Ln(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=In(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]+`}`:Nn(s)&&(r+=Pn(a)+`:`+Fn(a,s)+`;`)}else if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)Nn(o[c])&&(r+=Pn(a)+`:`+Fn(a,o[c])+`;`);else{var l=In(e,t,o);switch(a){case`animation`:case`animationName`:r+=Pn(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}return r}var Rn=/label:\s*([^\s;{]+)\s*(;|$)/g,zn;function Bn(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=``;zn=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=In(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=In(n,t,e[o]),r&&(i+=a[o]);Rn.lastIndex=0;for(var s=``,c;(c=Rn.exec(i))!==null;)s+=`-`+c[1];return{name:On(i)+s,styles:i,next:zn}}var F=l(d()),Vn=function(e){return e()},Hn=F.useInsertionEffect?F.useInsertionEffect:!1,Un=Hn||Vn,Wn=Hn||F.useLayoutEffect,Gn=F.createContext(typeof HTMLElement<`u`?xn({key:`css`}):null),Kn=Gn.Provider,qn=function(e){return(0,F.forwardRef)(function(t,n){return e(t,(0,F.useContext)(Gn),n)})},Jn=F.createContext({}),Yn={}.hasOwnProperty,Xn=`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`,Zn=function(e,t){var n={};for(var r in t)Yn.call(t,r)&&(n[r]=t[r]);return n[Xn]=e,n},Qn=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return En(t,n,r),Un(function(){return Dn(t,n,r)}),null},$n=qn(function(e,t,n){var r=e.css;typeof r==`string`&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[Xn],a=[r],o=``;typeof e.className==`string`?o=Tn(t.registered,a,e.className):e.className!=null&&(o=e.className+` `);var s=Bn(a,void 0,F.useContext(Jn));o+=t.key+`-`+s.name;var c={};for(var l in e)Yn.call(e,l)&&l!==`css`&&l!==Xn&&(c[l]=e[l]);return c.className=o,n&&(c.ref=n),F.createElement(F.Fragment,null,F.createElement(Qn,{cache:t,serialized:s,isStringTag:typeof i==`string`}),F.createElement(i,c))});wn();var er=function(e,t){var n=arguments;if(t==null||!Yn.call(t,`css`))return F.createElement.apply(void 0,n);var r=n.length,i=Array(r);i[0]=$n,i[1]=Zn(e,t);for(var a=2;a<r;a++)i[a]=n[a];return F.createElement.apply(null,i)};(function(e){var t;t||=e.JSX||={}})(er||={});var tr=qn(function(e,t){var n=e.styles,r=Bn([n],void 0,F.useContext(Jn)),i=F.useRef();return Wn(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]),Wn(function(){var e=i.current,n=e[0];if(e[1]){e[1]=!1;return}r.next!==void 0&&Dn(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 nr(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Bn(t)}function rr(){var e=nr.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 ir=/^((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)-.*))$/,ar=fn(function(e){return ir.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),or=function(e){return e!==`theme`},sr=function(e){return typeof e==`string`&&e.charCodeAt(0)>96?ar:or},cr=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},lr=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return En(t,n,r),Un(function(){return Dn(t,n,r)}),null},ur=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=cr(t,n,r),c=s||sr(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=qn(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=F.useContext(Jn)}typeof e.className==`string`?a=Tn(t.registered,u,e.className):e.className!=null&&(a=e.className+` `);var m=Bn(d.concat(u),t.registered,f);a+=t.key+`-`+m.name,o!==void 0&&(a+=` `+o);var h=l&&s===void 0?sr(r):c,g={};for(var _ in e)l&&_===`as`||h(_)&&(g[_]=e[_]);return g.className=a,n&&(g.ref=n),F.createElement(F.Fragment,null,F.createElement(lr,{cache:t,serialized:m,isStringTag:typeof r==`string`}),F.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}}),h.withComponent=function(t,r){return e(t,ot({},n,r,{shouldForwardProp:cr(h,r,!0)})).apply(void 0,d)},h}},dr=`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(`.`),fr=ur.bind(null);dr.forEach(function(e){fr[e]=fr(e)});var pr=o((e=>{var t=d(),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})),I=o(((e,t)=>{t.exports=pr()}))(),mr=new Map,hr={insert:void 0},gr=(e,t)=>{let n=xn(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},_r;if(typeof document==`object`&&(_r=document.querySelector(`[name="emotion-insertion-point"]`),!_r)){_r=document.createElement(`meta`),_r.setAttribute(`name`,`emotion-insertion-point`),_r.setAttribute(`content`,``);let e=document.querySelector(`head`);e&&e.prepend(_r)}function vr(e,t){if(e||t){class n extends lt{insert(e,t){return hr.insert?hr.insert(e,t):(this.key&&this.key.endsWith(`global`)&&(this.before=_r),super.insert(e,t))}}let r=gr({key:`css`,insertionPoint:e?_r: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 yr(e){let{injectFirst:t,enableCssLayer:n,children:r}=e,i=F.useMemo(()=>{let e=`${t}-${n}`;if(typeof document==`object`&&mr.has(e))return mr.get(e);let r=vr(t,n);return mr.set(e,r),r},[t,n]);return i?(0,I.jsx)(Kn,{value:i,children:r}):r}function br(e){return e==null||Object.keys(e).length===0}function xr(e){let{styles:t,defaultTheme:n={}}=e;return(0,I.jsx)(tr,{styles:typeof t==`function`?e=>t(br(e)?n:e):t})}function Sr(e,t){return fr(e,t)}function Cr(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}var wr=[];function Tr(e){return wr[0]=e,Bn(wr)}var Er=o((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))}})),Dr=o(((e,t)=>{t.exports=Er()}))();function Or(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 kr(e){if(F.isValidElement(e)||(0,Dr.isValidElementType)(e)||!Or(e))return e;let t={};return Object.keys(e).forEach(n=>{t[n]=kr(e[n])}),t}function Ar(e,t,n={clone:!0}){let r=n.clone?{...e}:e;return Or(e)&&Or(t)&&Object.keys(t).forEach(i=>{F.isValidElement(t[i])||(0,Dr.isValidElementType)(t[i])?r[i]=t[i]:Or(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Or(e[i])?r[i]=Ar(e[i],t[i],n):n.clone?r[i]=Or(t[i])?kr(t[i]):t[i]:r[i]=t[i]}),r}var jr=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 Mr(e){let{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n=`px`,step:r=5,...i}=e,a=jr(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 Nr(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 Pr(e,t){return t===`@`||t.startsWith(`@`)&&(e.some(e=>t.startsWith(`@${e}`))||!!t.match(/^@\d/))}function Fr(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 Ir(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 Lr={borderRadius:4};function Rr(e,t){return t?Ar(e,t,{clone:!1}):e}var zr={xs:0,sm:600,md:900,lg:1200,xl:1536},Br={keys:[`xs`,`sm`,`md`,`lg`,`xl`],up:e=>`@media (min-width:${zr[e]}px)`},Vr={containerQueries:e=>({up:t=>{let n=typeof t==`number`?t:zr[t]||t;return typeof n==`number`&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Hr(e,t,n){let r=e.theme||{};if(Array.isArray(t)){let e=r.breakpoints||Br;return t.reduce((r,i,a)=>(r[e.up(e.keys[a])]=n(t[a]),r),{})}if(typeof t==`object`){let e=r.breakpoints||Br;return Object.keys(t).reduce((i,a)=>{if(Pr(e.keys,a)){let e=Fr(r.containerQueries?r:Vr,a);e&&(i[e]=n(t[a],a))}else if(Object.keys(e.values||zr).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 Ur(e={}){return e.keys?.reduce((t,n)=>{let r=e.up(n);return t[r]={},t},{})||{}}function Wr(e,t){return e.reduce((e,t)=>{let n=e[t];return(!n||Object.keys(n).length===0)&&delete e[t],e},t)}function Gr(e){if(typeof e!=`string`)throw Error(it(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Kr(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 qr(e,t,n,r=n){let i;return i=typeof e==`function`?e(n):Array.isArray(e)?e[n]||r:Kr(e,n)||r,t&&(i=t(i,r,e)),i}function Jr(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=Kr(o,r)||{};return Hr(e,a,e=>{let r=qr(s,i,e);return e===r&&typeof e==`string`&&(r=qr(s,i,`${t}${e==="default"?``:Gr(e)}`,e)),n===!1?r:{[n]:r}})};return a.propTypes={},a.filterProps=[t],a}function Yr(e){let t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}var Xr={m:`margin`,p:`padding`},Zr={t:`Top`,r:`Right`,b:`Bottom`,l:`Left`,x:[`Left`,`Right`],y:[`Top`,`Bottom`]},Qr={marginX:`mx`,marginY:`my`,paddingX:`px`,paddingY:`py`},$r=Yr(e=>{if(e.length>2)if(Qr[e])e=Qr[e];else return[e];let[t,n]=e.split(``),r=Xr[t],i=Zr[n]||``;return Array.isArray(i)?i.map(e=>r+e):[r+i]}),ei=[`m`,`mt`,`mr`,`mb`,`ml`,`mx`,`my`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginX`,`marginY`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`],ti=[`p`,`pt`,`pr`,`pb`,`pl`,`px`,`py`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingX`,`paddingY`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`],ni=[...ei,...ti];function ri(e,t,n,r){let i=Kr(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 ii(e){return ri(e,`spacing`,8,`spacing`)}function ai(e,t){return typeof t==`string`||t==null?t:e(t)}function oi(e,t){return n=>e.reduce((e,r)=>(e[r]=ai(t,n),e),{})}function si(e,t,n,r){if(!t.includes(n))return null;let i=oi($r(n),r),a=e[n];return Hr(e,a,i)}function ci(e,t){let n=ii(e.theme);return Object.keys(e).map(r=>si(e,t,r,n)).reduce(Rr,{})}function li(e){return ci(e,ei)}li.propTypes={},li.filterProps=ei;function ui(e){return ci(e,ti)}ui.propTypes={},ui.filterProps=ti;function di(e){return ci(e,ni)}di.propTypes={},di.filterProps=ni;function fi(e=8,t=ii({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 pi(...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]?Rr(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function mi(e){return typeof e==`number`?`${e}px solid`:e}function hi(e,t){return Jr({prop:e,themeKey:`borders`,transform:t})}var gi=hi(`border`,mi),_i=hi(`borderTop`,mi),vi=hi(`borderRight`,mi),yi=hi(`borderBottom`,mi),bi=hi(`borderLeft`,mi),xi=hi(`borderColor`),Si=hi(`borderTopColor`),Ci=hi(`borderRightColor`),wi=hi(`borderBottomColor`),Ti=hi(`borderLeftColor`),Ei=hi(`outline`,mi),Di=hi(`outlineColor`),Oi=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){let t=ri(e.theme,`shape.borderRadius`,4,`borderRadius`);return Hr(e,e.borderRadius,e=>({borderRadius:ai(t,e)}))}return null};Oi.propTypes={},Oi.filterProps=[`borderRadius`],pi(gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Oi,Ei,Di);var ki=e=>{if(e.gap!==void 0&&e.gap!==null){let t=ri(e.theme,`spacing`,8,`gap`);return Hr(e,e.gap,e=>({gap:ai(t,e)}))}return null};ki.propTypes={},ki.filterProps=[`gap`];var Ai=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){let t=ri(e.theme,`spacing`,8,`columnGap`);return Hr(e,e.columnGap,e=>({columnGap:ai(t,e)}))}return null};Ai.propTypes={},Ai.filterProps=[`columnGap`];var ji=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){let t=ri(e.theme,`spacing`,8,`rowGap`);return Hr(e,e.rowGap,e=>({rowGap:ai(t,e)}))}return null};ji.propTypes={},ji.filterProps=[`rowGap`],pi(ki,Ai,ji,Jr({prop:`gridColumn`}),Jr({prop:`gridRow`}),Jr({prop:`gridAutoFlow`}),Jr({prop:`gridAutoColumns`}),Jr({prop:`gridAutoRows`}),Jr({prop:`gridTemplateColumns`}),Jr({prop:`gridTemplateRows`}),Jr({prop:`gridTemplateAreas`}),Jr({prop:`gridArea`}));function Mi(e,t){return t===`grey`?t:e}pi(Jr({prop:`color`,themeKey:`palette`,transform:Mi}),Jr({prop:`bgcolor`,cssProperty:`backgroundColor`,themeKey:`palette`,transform:Mi}),Jr({prop:`backgroundColor`,themeKey:`palette`,transform:Mi}));function Ni(e){return e<=1&&e!==0?`${e*100}%`:e}var Pi=Jr({prop:`width`,transform:Ni}),Fi=e=>e.maxWidth!==void 0&&e.maxWidth!==null?Hr(e,e.maxWidth,t=>{let n=e.theme?.breakpoints?.values?.[t]||zr[t];return n?e.theme?.breakpoints?.unit===`px`?{maxWidth:n}:{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:Ni(t)}}):null;Fi.filterProps=[`maxWidth`];var Ii=Jr({prop:`minWidth`,transform:Ni}),Li=Jr({prop:`height`,transform:Ni}),Ri=Jr({prop:`maxHeight`,transform:Ni}),zi=Jr({prop:`minHeight`,transform:Ni});Jr({prop:`size`,cssProperty:`width`,transform:Ni}),Jr({prop:`size`,cssProperty:`height`,transform:Ni}),pi(Pi,Fi,Ii,Li,Ri,zi,Jr({prop:`boxSizing`}));var Bi={border:{themeKey:`borders`,transform:mi},borderTop:{themeKey:`borders`,transform:mi},borderRight:{themeKey:`borders`,transform:mi},borderBottom:{themeKey:`borders`,transform:mi},borderLeft:{themeKey:`borders`,transform:mi},borderColor:{themeKey:`palette`},borderTopColor:{themeKey:`palette`},borderRightColor:{themeKey:`palette`},borderBottomColor:{themeKey:`palette`},borderLeftColor:{themeKey:`palette`},outline:{themeKey:`borders`,transform:mi},outlineColor:{themeKey:`palette`},borderRadius:{themeKey:`shape.borderRadius`,style:Oi},color:{themeKey:`palette`,transform:Mi},bgcolor:{themeKey:`palette`,cssProperty:`backgroundColor`,transform:Mi},backgroundColor:{themeKey:`palette`,transform:Mi},p:{style:ui},pt:{style:ui},pr:{style:ui},pb:{style:ui},pl:{style:ui},px:{style:ui},py:{style:ui},padding:{style:ui},paddingTop:{style:ui},paddingRight:{style:ui},paddingBottom:{style:ui},paddingLeft:{style:ui},paddingX:{style:ui},paddingY:{style:ui},paddingInline:{style:ui},paddingInlineStart:{style:ui},paddingInlineEnd:{style:ui},paddingBlock:{style:ui},paddingBlockStart:{style:ui},paddingBlockEnd:{style:ui},m:{style:li},mt:{style:li},mr:{style:li},mb:{style:li},ml:{style:li},mx:{style:li},my:{style:li},margin:{style:li},marginTop:{style:li},marginRight:{style:li},marginBottom:{style:li},marginLeft:{style:li},marginX:{style:li},marginY:{style:li},marginInline:{style:li},marginInlineStart:{style:li},marginInlineEnd:{style:li},marginBlock:{style:li},marginBlockStart:{style:li},marginBlockEnd:{style:li},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:ki},rowGap:{style:ji},columnGap:{style:Ai},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:`zIndex`},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:`shadows`},width:{transform:Ni},maxWidth:{style:Fi},minWidth:{transform:Ni},height:{transform:Ni},maxHeight:{transform:Ni},minHeight:{transform:Ni},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 Vi(...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 Hi(e,t){return typeof e==`function`?e(t):e}function Ui(){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=Kr(n,s)||{};return l?l(i):Hr(i,t,t=>{let n=qr(u,c,t);return t===n&&typeof t==`string`&&(n=qr(u,c,`${e}${t==="default"?``:Gr(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??Bi;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=Ur(i.breakpoints),c=Object.keys(s),l=s;return Object.keys(r).forEach(n=>{let a=Hi(r[n],i);if(a!=null)if(typeof a==`object`)if(o[n])l=Rr(l,e(n,a,i,o));else{let e=Hr({theme:i},a,e=>({[n]:e}));Vi(e,a)?l[n]=t({sx:a,theme:i,nested:!0}):l=Rr(l,e)}else l=Rr(l,e(n,a,i,o))}),!a&&i.modularCssLayers?{"@layer sx":Nr(i,Wr(c,l))}:Nr(i,Wr(c,l))}return Array.isArray(r)?r.map(s):s(r)}return t}var Wi=Ui();Wi.filterProps=[`sx`];function Gi(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 Ki(e={},...t){let{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,s=Mr(n),c=fi(i),l=Ar({breakpoints:s,direction:`ltr`,components:{},palette:{mode:`light`,...r},spacing:c,shape:{...Lr,...a}},o);return l=Ir(l),l.applyStyles=Gi,l=t.reduce((e,t)=>Ar(e,t),l),l.unstable_sxConfig={...Bi,...o?.unstable_sxConfig},l.unstable_sx=function(e){return Wi({sx:e,theme:this})},l}function qi(e){return Object.keys(e).length===0}function Ji(e=null){let t=F.useContext(Jn);return!t||qi(t)?e:t}var Yi=Ki();function Xi(e=Yi){return Ji(e)}function Zi(e){let t=Tr(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Qi({styles:e,themeId:t,defaultTheme:n={}}){let r=Xi(n),i=t&&r[t]||r,a=typeof e==`function`?e(i):e;return i.modularCssLayers&&(a=Array.isArray(a)?a.map(e=>Zi(typeof e==`function`?e(i):e)):Zi(a)),(0,I.jsx)(xr,{styles:a})}var $i=e=>{let t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Bi;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function ea(e){let{sx:t,...n}=e,{systemProps:r,otherProps:i}=$i(n),a;return a=Array.isArray(t)?[r,...t]:typeof t==`function`?(...e)=>{let n=t(...e);return Or(n)?{...r,...n}:r}:{...r,...t},{...i,sx:a}}var ta=e=>e,na=(()=>{let e=ta;return{configure(t){e=t},generate(t){return e(t)},reset(){e=ta}}})();function ra(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=ra(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function L(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ra(e))&&(r&&(r+=` `),r+=t);return r}var ia={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 aa(e,t,n=`Mui`){let r=ia[t];return r?`${n}-${r}`:`${na.generate(e)}-${t}`}function oa(e,t,n=`Mui`){let r={};return t.forEach(t=>{r[t]=aa(e,t,n)}),r}function sa(e){let{variants:t,...n}=e,r={variants:t,style:Tr(n),isProcessed:!0};return r.style===n||t&&t.forEach(e=>{typeof e.style!=`function`&&(e.style=Tr(e.style))}),r}var ca=Ki();function la(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}function ua(e,t){return t&&e&&typeof e==`object`&&e.styles&&!e.styles.startsWith(`@layer`)&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function da(e){return e?(t,n)=>n[e]:null}function fa(e,t,n){e.theme=ga(e.theme)?n:e.theme[t]||e.theme}function pa(e,t,n){let r=typeof t==`function`?t(e):t;if(Array.isArray(r))return r.flatMap(t=>pa(e,t,n));if(Array.isArray(r?.variants)){let t;if(r.isProcessed)t=n?ua(r.style,n):r.style;else{let{variants:e,...i}=r;t=n?ua(Tr(i),n):i}return ma(e,r.variants,[t],n)}return r?.isProcessed?n?ua(Tr(r.style),n):r.style:n?ua(Tr(r),n):r}function ma(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?ua(Tr(o.style(i)),r):o.style(i))):n.push(r?ua(Tr(o.style),r):o.style)}return n}function ha(e={}){let{themeId:t,defaultTheme:n=ca,rootShouldForwardProp:r=la,slotShouldForwardProp:i=la}=e;function a(e){fa(e,t,n)}return(e,t={})=>{Cr(e,e=>e.filter(e=>e!==Wi));let{name:n,slot:o,skipVariantsResolver:s,skipSx:c,overridesResolver:l=da(va(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=la;o===`Root`||o===`root`?m=r:o?m=i:_a(e)&&(m=void 0);let h=Sr(e,{shouldForwardProp:m,label:void 0,...u}),g=e=>{if(e.__emotion_real===e)return e;if(typeof e==`function`)return function(t){return pa(t,e,t.theme.modularCssLayers?d:void 0)};if(Or(e)){let t=sa(e);return function(e){return t.variants?pa(e,t,e.theme.modularCssLayers?d:void 0):e.theme.modularCssLayers?ua(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]=pa(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?ma(e,t,[],e.theme.modularCssLayers?`theme`:void 0):null}),p||o.push(Wi),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=[...r,...i,...o],c=h(...s);return e.muiName&&(c.muiName=e.muiName),c};return h.withConfig&&(_.withConfig=h.withConfig),_}}function ga(e){for(let t in e)return!1;return!0}function _a(e){return typeof e==`string`&&e.charCodeAt(0)>96}function va(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function ya(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]=ya(i[t],o[t],n)}}}else a===`className`&&n&&t.className?r.className=L(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 ba=typeof window<`u`?F.useLayoutEffect:F.useEffect;function xa(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Sa(e,t=0,n=1){return xa(e,t,n)}function Ca(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 wa(e){if(e.type)return e;if(e.charAt(0)===`#`)return wa(Ca(e));let t=e.indexOf(`(`),n=e.substring(0,t);if(![`rgb`,`rgba`,`hsl`,`hsla`,`color`].includes(n))throw Error(it(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(it(10,i))}else r=r.split(`,`);return r=r.map(e=>parseFloat(e)),{type:n,values:r,colorSpace:i}}var Ta=e=>{let t=wa(e);return t.values.slice(0,3).map((e,n)=>t.type.includes(`hsl`)&&n!==0?`${e}%`:e).join(` `)},Ea=(e,t)=>{try{return Ta(e)}catch{return e}};function Da(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 Oa(e){e=wa(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])),Da({type:s,values:c})}function ka(e){e=wa(e);let t=e.type===`hsl`||e.type===`hsla`?wa(Oa(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 Aa(e,t){let n=ka(e),r=ka(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ja(e,t){return e=wa(e),t=Sa(t),(e.type===`rgb`||e.type===`hsl`)&&(e.type+=`a`),e.type===`color`?e.values[3]=`/${t}`:e.values[3]=t,Da(e)}function Ma(e,t,n){try{return ja(e,t)}catch{return e}}function Na(e,t){if(e=wa(e),t=Sa(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 Da(e)}function Pa(e,t,n){try{return Na(e,t)}catch{return e}}function Fa(e,t){if(e=wa(e),t=Sa(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 Da(e)}function Ia(e,t,n){try{return Fa(e,t)}catch{return e}}function La(e,t=.15){return ka(e)>.5?Na(e,t):Fa(e,t)}function Ra(e,t,n){try{return La(e,t)}catch{return e}}var za=F.createContext(null);function Ba(){return F.useContext(za)}var Va=typeof Symbol==`function`&&Symbol.for?Symbol.for(`mui.nested`):`__THEME_NESTED__`;function Ha(e,t){return typeof t==`function`?t(e):{...e,...t}}function Ua(e){let{children:t,theme:n}=e,r=Ba(),i=F.useMemo(()=>{let e=r===null?{...n}:Ha(r,n);return e!=null&&(e[Va]=r!==null),e},[n,r]);return(0,I.jsx)(za.Provider,{value:i,children:t})}var Wa=F.createContext();function Ga({value:e,...t}){return(0,I.jsx)(Wa.Provider,{value:e??!0,...t})}var Ka=()=>F.useContext(Wa)??!1,qa=F.createContext(void 0);function Ja({value:e,children:t}){return(0,I.jsx)(qa.Provider,{value:e,children:t})}function Ya(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?ya(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?ya(i,r,t.components.mergeClassNameAndStyle):r}function Xa({props:e,name:t}){return Ya({props:e,name:t,theme:{components:F.useContext(qa)}})}var Za=0;function Qa(e){let[t,n]=F.useState(e),r=e||t;return F.useEffect(()=>{t??(Za+=1,n(`mui-${Za}`))},[t]),r}var $a={...F}.useId;function eo(e){if($a!==void 0){let t=$a();return e??t}return Qa(e)}function to(e){let t=Ji(),n=eo()||``,{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};`,ba(()=>{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,I.jsx)(Qi,{styles:i}):null}var no={};function ro(e,t,n,r=!1){return F.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 io(e){let{children:t,theme:n,themeId:r}=e,i=Ji(no),a=Ba()||no,o=ro(r,i,n),s=ro(r,a,n,!0),c=(r?o[r]:o).direction===`rtl`,l=to(o);return(0,I.jsx)(Ua,{theme:s,children:(0,I.jsx)(Jn.Provider,{value:o,children:(0,I.jsx)(Ga,{value:c,children:(0,I.jsxs)(Ja,{value:r?o[r].components:o.components,children:[l,t]})})})})}var ao={theme:void 0};function oo(e){let t,n;return function(r){let i=t;return(i===void 0||r.theme!==n)&&(ao.theme=r.theme,i=sa(e(ao)),t=i,n=r.theme),i}}var so=`mode`,co=`color-scheme`,lo=`data-color-scheme`;function uo(e){let{defaultMode:t=`system`,defaultLightColorScheme:n=`light`,defaultDarkColorScheme:r=`dark`,modeStorageKey:i=so,colorSchemeStorageKey:a=co,attribute:o=lo,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,I.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 fo(){}var po=({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 fo;let r=t=>{let r=t.newValue;t.key===e&&n(r)};return t.addEventListener(`storage`,r),()=>{t.removeEventListener(`storage`,r)}}});function mo(){}function ho(e){if(typeof window<`u`&&typeof window.matchMedia==`function`&&e===`system`)return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function go(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 _o(e){return go(e,t=>{if(t===`light`)return e.lightColorScheme;if(t===`dark`)return e.darkColorScheme})}function vo(e){let{defaultMode:t=`light`,defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:a=so,colorSchemeStorageKey:o=co,storageWindow:s=typeof window>`u`?void 0:window,storageManager:c=po,noSsr:l=!1}=e,u=i.join(`,`),d=i.length>1,f=F.useMemo(()=>c?.({key:a,storageWindow:s}),[c,a,s]),p=F.useMemo(()=>c?.({key:`${o}-light`,storageWindow:s}),[c,o,s]),m=F.useMemo(()=>c?.({key:`${o}-dark`,storageWindow:s}),[c,o,s]),[h,g]=F.useState(()=>{let e=f?.get(t)||t,i=p?.get(n)||n,a=m?.get(r)||r;return{mode:e,systemMode:ho(e),lightColorScheme:i,darkColorScheme:a}}),[_,v]=F.useState(l||!d);F.useEffect(()=>{v(!0)},[]);let y=_o(h),b=F.useCallback(e=>{g(n=>{if(e===n.mode)return n;let r=e??t;return f?.set(r),{...n,mode:r,systemMode:ho(r)}})},[f,t]),x=F.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 go(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=F.useCallback(e=>{h.mode===`system`&&g(t=>{let n=e?.matches?`dark`:`light`;return t.systemMode===n?t:{...t,systemMode:n}})},[h.mode]),C=F.useRef(S);return C.current=S,F.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]),F.useEffect(()=>{if(d){let e=f?.subscribe(e=>{(!e||[`light`,`dark`,`system`].includes(e))&&b(e||t)})||mo,n=p?.subscribe(e=>{(!e||u.match(e))&&x({light:e})})||mo,r=m?.subscribe(e=>{(!e||u.match(e))&&x({dark:e})})||mo;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}}var yo=`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function bo(e){let{themeId:t,theme:n={},modeStorageKey:r=so,colorSchemeStorageKey:i=co,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=F.createContext(void 0),u=()=>F.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=F.useRef(!1),E=Ba(),D=F.useContext(l),O=!!D&&!b,k=F.useMemo(()=>u||(typeof n==`function`?n():n),[u]),A=k[t],j=A||k,{colorSchemes:M=d,components:ee=f,cssVarPrefix:N}=j,te=Object.keys(M).filter(e=>!!M[e]).join(`,`),ne=F.useMemo(()=>te.split(`,`),[te]),re=typeof o==`string`?o:o.light,ie=typeof o==`string`?o:o.dark,{mode:ae,setMode:oe,systemMode:se,lightColorScheme:ce,darkColorScheme:le,colorScheme:ue,setColorScheme:de}=vo({supportedColorSchemes:ne,defaultLightColorScheme:re,defaultDarkColorScheme:ie,modeStorageKey:p,colorSchemeStorageKey:m,defaultMode:M[re]&&M[ie]?S:M[j.defaultColorScheme]?.palette?.mode||j.palette?.mode,storageManager:g,storageWindow:_,noSsr:w}),fe=ae,pe=ue;O&&(fe=D.mode,pe=D.colorScheme);let me=pe||j.defaultColorScheme;j.vars&&!C&&(me=j.defaultColorScheme);let he=F.useMemo(()=>{let e=j.generateThemeVars?.()||j.vars,t={...j,components:ee,colorSchemes:M,cssVarPrefix:N,vars:e};if(typeof t.generateSpacing==`function`&&(t.spacing=t.generateSpacing()),me){let e=M[me];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,me,ee,M,N]),ge=j.colorSchemeSelector;ba(()=>{if(pe&&y&&ge&&ge!==`media`){let e=ge,t=ge;if(e===`class`&&(t=`.%s`),e===`data`&&(t=`[data-%s]`),e?.startsWith(`data-`)&&!e.includes(`%s`)&&(t=`[${e}="%s"]`),t.startsWith(`.`))y.classList.remove(...ne.map(e=>t.substring(1).replace(`%s`,e))),y.classList.add(t.substring(1).replace(`%s`,pe));else{let e=t.replace(`%s`,pe).match(/\[([^\]]+)\]/);if(e){let[t,n]=e[1].split(`=`);n||ne.forEach(e=>{y.removeAttribute(t.replace(pe,e))}),y.setAttribute(t,n?n.replace(/"|'/g,``):``)}else y.setAttribute(t,pe)}}},[pe,ge,y,ne]),F.useEffect(()=>{let e;if(h&&T.current&&v){let t=v.createElement(`style`);t.appendChild(v.createTextNode(yo)),v.head.appendChild(t),window.getComputedStyle(v.body),e=setTimeout(()=>{v.head.removeChild(t)},1)}return()=>{clearTimeout(e)}},[pe,h,v]),F.useEffect(()=>(T.current=!0,()=>{T.current=!1}),[]);let _e=F.useMemo(()=>({allColorSchemes:ne,colorScheme:pe,darkColorScheme:le,lightColorScheme:ce,mode:fe,setColorScheme:de,setMode:oe,systemMode:se}),[ne,pe,le,ce,fe,de,oe,se,he.colorSchemeSelector]),ve=!0;(x||j.cssVariables===!1||O&&E?.cssVarPrefix===N)&&(ve=!1);let ye=(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(io,{themeId:A?t:void 0,theme:he,children:c}),ve&&(0,I.jsx)(xr,{styles:he.generateStyleSheets?.()||[]})]});return O?ye:(0,I.jsx)(l.Provider,{value:_e,children:ye})}let m=typeof o==`string`?o:o.light,h=typeof o==`string`?o:o.dark;return{CssVarsProvider:p,useColorScheme:u,getInitColorSchemeScript:e=>uo({colorSchemeStorageKey:i,defaultLightColorScheme:m,defaultDarkColorScheme:h,modeStorageKey:r,...e})}}function xo(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 So=(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])})},Co=(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)},wo=(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 To(e,t){let{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return Co(e,(e,t,s)=>{if((typeof t==`string`||typeof t==`number`)&&(!r||!r(e,t))){let r=`--${n?`${n}-`:``}${e.join(`-`)}`,c=wo(e,t);Object.assign(i,{[r]:c}),So(a,e,`var(${r})`,s),So(o,e,`var(${r}, ${c})`,s)}},e=>e[0]===`vars`),{css:i,vars:a,varsWithDefaults:o}}function Eo(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}=To(l,t),p=f,m={},{[c]:h,...g}=o;if(Object.entries(g||{}).forEach(([e,n])=>{let{vars:r,css:i,varsWithDefaults:a}=To(n,t);p=Ar(p,a),m[e]={css:i,vars:r}}),h){let{css:e,vars:n,varsWithDefaults:r}=To(h,t);p=Ar(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=Ar(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 Do(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 Oo(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 ko(e,t){return F.isValidElement(e)&&t.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)!==-1}var Ao={black:`#000`,white:`#fff`},jo={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`},Mo={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`},No={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`},Po={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`},Fo={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`},Io={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`},Lo={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 Ro(){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:Ao.white,default:Ao.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 zo=Ro();function Bo(){return{text:{primary:Ao.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:Ao.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 Vo=Bo();function Ho(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=Fa(e.main,i):t===`dark`&&(e.dark=Na(e.main,a)))}function Uo(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 Wo(e=`light`){return e===`dark`?{main:Fo[200],light:Fo[50],dark:Fo[400]}:{main:Fo[700],light:Fo[400],dark:Fo[800]}}function Go(e=`light`){return e===`dark`?{main:Mo[200],light:Mo[50],dark:Mo[400]}:{main:Mo[500],light:Mo[300],dark:Mo[700]}}function Ko(e=`light`){return e===`dark`?{main:No[500],light:No[300],dark:No[700]}:{main:No[700],light:No[400],dark:No[800]}}function qo(e=`light`){return e===`dark`?{main:Io[400],light:Io[300],dark:Io[700]}:{main:Io[700],light:Io[500],dark:Io[900]}}function Jo(e=`light`){return e===`dark`?{main:Lo[400],light:Lo[300],dark:Lo[700]}:{main:Lo[800],light:Lo[500],dark:Lo[900]}}function Yo(e=`light`){return e===`dark`?{main:Po[400],light:Po[300],dark:Po[700]}:{main:`#ed6c02`,light:Po[500],dark:Po[900]}}function Xo(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Zo(e){let{mode:t=`light`,contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||Wo(t),s=e.secondary||Go(t),c=e.error||Ko(t),l=e.info||qo(t),u=e.success||Jo(t),d=e.warning||Yo(t);function f(e){return i?Xo(e):Aa(e,Vo.text.primary)>=n?Vo.text.primary:zo.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(it(11,t?` (${t})`:``,n));if(typeof e.main!=`string`)throw Error(it(12,t?` (${t})`:``,JSON.stringify(e.main)));return i?(Uo(i,e,`light`,a,r),Uo(i,e,`dark`,o,r)):(Ho(e,`light`,a,r),Ho(e,`dark`,o,r)),e.contrastText||=f(e.main),e},m;return t===`light`?m=Ro():t===`dark`&&(m=Bo()),Ar({common:{...Ao},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:jo,contrastThreshold:n,getContrastText:f,augmentColor:p,tonalOffset:r,...m},a)}function Qo(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 $o(e,t){return{toolbar:{minHeight:56,[e.up(`xs`)]:{"@media (orientation: landscape)":{minHeight:48}},[e.up(`sm`)]:{minHeight:64}},...t}}function es(e){return Math.round(e*1e5)/1e5}var ts={textTransform:`uppercase`},ns=`"Roboto", "Helvetica", "Arial", sans-serif`;function rs(e,t){let{fontFamily:n=ns,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===ns?{letterSpacing:`${es(i/t)}em`}:{},...a,...l});return Ar({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,ts),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,ts),inherit:{fontFamily:`inherit`,fontWeight:`inherit`,fontSize:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},d,{clone:!1})}var is=.2,as=.14,ss=.12;function cs(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${is})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${as})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${ss})`].join(`,`)}var ls=[`none`,cs(0,2,1,-1,0,1,1,0,0,1,3,0),cs(0,3,1,-2,0,2,2,0,0,1,5,0),cs(0,3,3,-2,0,3,4,0,0,1,8,0),cs(0,2,4,-1,0,4,5,0,0,1,10,0),cs(0,3,5,-1,0,5,8,0,0,1,14,0),cs(0,3,5,-1,0,6,10,0,0,1,18,0),cs(0,4,5,-2,0,7,10,1,0,2,16,1),cs(0,5,5,-3,0,8,10,1,0,3,14,2),cs(0,5,6,-3,0,9,12,1,0,3,16,2),cs(0,6,6,-3,0,10,14,1,0,4,18,3),cs(0,6,7,-4,0,11,15,1,0,4,20,3),cs(0,7,8,-4,0,12,17,2,0,5,22,4),cs(0,7,8,-4,0,13,19,2,0,5,24,4),cs(0,7,9,-4,0,14,21,2,0,5,26,4),cs(0,8,9,-5,0,15,22,2,0,6,28,5),cs(0,8,10,-5,0,16,24,2,0,6,30,5),cs(0,8,11,-5,0,17,26,2,0,6,32,5),cs(0,9,11,-5,0,18,28,2,0,7,34,6),cs(0,9,12,-6,0,19,29,2,0,7,36,6),cs(0,10,13,-6,0,20,31,3,0,8,38,7),cs(0,10,13,-6,0,21,33,3,0,8,40,7),cs(0,10,14,-6,0,22,35,3,0,8,42,7),cs(0,11,14,-7,0,23,36,3,0,9,44,8),cs(0,11,15,-7,0,24,38,3,0,9,46,8)],us={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)`},ds={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function fs(e){return`${Math.round(e)}ms`}function ps(e){if(!e)return 0;let t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function ms(e){let t={...us,...e.easing},n={...ds,...e.duration};return{getAutoHeightDuration:ps,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:fs(i)} ${a} ${typeof o==`string`?o:fs(o)}`).join(`,`)},...e,easing:t,duration:n}}var hs={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function gs(e){return Or(e)||e===void 0||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||Array.isArray(e)}function _s(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];!gs(a)||i.startsWith(`unstable_`)?delete e[i]:Or(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 vs(e){return typeof e==`number`?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}var ys=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 bs(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})`:ja(t,ys(n))},lighten(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${vs(n)})`:Fa(t,n)},darken(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${vs(n)})`:Na(t,n)}})}function xs(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(it(20));let d=Zo({...a,colorSpace:l}),f=Ki(e),p=Ar(f,{mixins:$o(f.breakpoints,r),palette:d,shadows:ls.slice(),typography:rs(d,s),transitions:ms(o),zIndex:{...hs}});return p=Ar(p,u),p=t.reduce((e,t)=>Ar(e,t),p),p.unstable_sxConfig={...Bi,...u?.unstable_sxConfig},p.unstable_sx=function(e){return Wi({sx:e,theme:this})},p.toRuntimeSource=_s,bs(p),p}function Ss(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}var Cs=[...Array(25)].map((e,t)=>{if(t===0)return`none`;let n=Ss(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function ws(e){return{inputPlaceholder:e===`dark`?.5:.42,inputUnderline:e===`dark`?.7:.42,switchTrackDisabled:e===`dark`?.2:.12,switchTrack:e===`dark`?.3:.38}}function Ts(e){return e===`dark`?Cs:[]}function Es(e){let{palette:t={mode:`light`},opacity:n,overlays:r,colorSpace:i,...a}=e,o=Zo({...t,colorSpace:i});return{palette:o,opacity:{...ws(o.mode),...n},overlays:r||Ts(o.mode),...a}}function Ds(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 Os=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:``}overlays-${n}`),`--${e?`${e}-`:``}palette-AppBar-darkBg`,`--${e?`${e}-`:``}palette-AppBar-darkColor`],ks=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 Os(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 As(e,t){t.forEach(t=>{e[t]||(e[t]={})})}function R(e,t,n){!e[t]&&n&&(e[t]=n)}function js(e){return typeof e!=`string`||!e.startsWith(`hsl`)?e:Oa(e)}function Ms(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Ea(js(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 Ns(e){return typeof e==`number`?`${e}px`:typeof e==`string`||typeof e==`function`||Array.isArray(e)?e:`8px`}var Ps=e=>{try{return e()}catch{}},Fs=(e=`mui`)=>xo(e);function Is(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;let a=i===`dark`?`dark`:`light`;if(!r){t[i]=Es({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}let{palette:o,...s}=xs({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...ws(a),...n?.opacity},overlays:n?.overlays||Ts(a)},s}function Ls(e={},...t){let{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a=`mui`,nativeColor:o=!1,shouldSkipGeneratingVar:s=Ds,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=Fs(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(it(21,f));let b;o&&(b=`oklch`);let x=Is(b,v,y,u,f);h&&!v.light&&Is(b,v,h,void 0,`light`),g&&!v.dark&&Is(b,v,g,void 0,`dark`);let S={defaultColorScheme:f,...x,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:l,getCssVar:p,colorSchemes:v,font:{...Qo(x.typography),...x.font},spacing:Ns(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`&&(R(t.common,`background`,`#fff`),R(t.common,`onBackground`,`#000`)),t.mode===`dark`&&(R(t.common,`background`,`#000`),R(t.common,`onBackground`,`#fff`));function r(e,t,n){if(b){let r;return e===Ma&&(r=`transparent ${((1-n)*100).toFixed(0)}%`),e===Pa&&(r=`#000 ${(n*100).toFixed(0)}%`),e===Ia&&(r=`#fff ${(n*100).toFixed(0)}%`),`color-mix(in ${b}, ${t}, ${r})`}return e(t,n)}if(As(t,[`Alert`,`AppBar`,`Avatar`,`Button`,`Chip`,`FilledInput`,`LinearProgress`,`Skeleton`,`Slider`,`SnackbarContent`,`SpeedDialAction`,`StepConnector`,`StepContent`,`Switch`,`TableCell`,`Tooltip`]),t.mode===`light`){R(t.Alert,`errorColor`,r(Pa,o?p(`palette-error-light`):t.error.light,.6)),R(t.Alert,`infoColor`,r(Pa,o?p(`palette-info-light`):t.info.light,.6)),R(t.Alert,`successColor`,r(Pa,o?p(`palette-success-light`):t.success.light,.6)),R(t.Alert,`warningColor`,r(Pa,o?p(`palette-warning-light`):t.warning.light,.6)),R(t.Alert,`errorFilledBg`,n(`palette-error-main`)),R(t.Alert,`infoFilledBg`,n(`palette-info-main`)),R(t.Alert,`successFilledBg`,n(`palette-success-main`)),R(t.Alert,`warningFilledBg`,n(`palette-warning-main`)),R(t.Alert,`errorFilledColor`,Ps(()=>t.getContrastText(t.error.main))),R(t.Alert,`infoFilledColor`,Ps(()=>t.getContrastText(t.info.main))),R(t.Alert,`successFilledColor`,Ps(()=>t.getContrastText(t.success.main))),R(t.Alert,`warningFilledColor`,Ps(()=>t.getContrastText(t.warning.main))),R(t.Alert,`errorStandardBg`,r(Ia,o?p(`palette-error-light`):t.error.light,.9)),R(t.Alert,`infoStandardBg`,r(Ia,o?p(`palette-info-light`):t.info.light,.9)),R(t.Alert,`successStandardBg`,r(Ia,o?p(`palette-success-light`):t.success.light,.9)),R(t.Alert,`warningStandardBg`,r(Ia,o?p(`palette-warning-light`):t.warning.light,.9)),R(t.Alert,`errorIconColor`,n(`palette-error-main`)),R(t.Alert,`infoIconColor`,n(`palette-info-main`)),R(t.Alert,`successIconColor`,n(`palette-success-main`)),R(t.Alert,`warningIconColor`,n(`palette-warning-main`)),R(t.AppBar,`defaultBg`,n(`palette-grey-100`)),R(t.Avatar,`defaultBg`,n(`palette-grey-400`)),R(t.Button,`inheritContainedBg`,n(`palette-grey-300`)),R(t.Button,`inheritContainedHoverBg`,n(`palette-grey-A100`)),R(t.Chip,`defaultBorder`,n(`palette-grey-400`)),R(t.Chip,`defaultAvatarColor`,n(`palette-grey-700`)),R(t.Chip,`defaultIconColor`,n(`palette-grey-700`)),R(t.FilledInput,`bg`,`rgba(0, 0, 0, 0.06)`),R(t.FilledInput,`hoverBg`,`rgba(0, 0, 0, 0.09)`),R(t.FilledInput,`disabledBg`,`rgba(0, 0, 0, 0.12)`),R(t.LinearProgress,`primaryBg`,r(Ia,o?p(`palette-primary-main`):t.primary.main,.62)),R(t.LinearProgress,`secondaryBg`,r(Ia,o?p(`palette-secondary-main`):t.secondary.main,.62)),R(t.LinearProgress,`errorBg`,r(Ia,o?p(`palette-error-main`):t.error.main,.62)),R(t.LinearProgress,`infoBg`,r(Ia,o?p(`palette-info-main`):t.info.main,.62)),R(t.LinearProgress,`successBg`,r(Ia,o?p(`palette-success-main`):t.success.main,.62)),R(t.LinearProgress,`warningBg`,r(Ia,o?p(`palette-warning-light`):t.warning.main,.62)),R(t.Skeleton,`bg`,b?r(Ma,o?p(`palette-text-primary`):t.text.primary,.11):`rgba(${n(`palette-text-primaryChannel`)} / 0.11)`),R(t.Slider,`primaryTrack`,r(Ia,o?p(`palette-primary-main`):t.primary.main,.62)),R(t.Slider,`secondaryTrack`,r(Ia,o?p(`palette-secondary-main`):t.secondary.main,.62)),R(t.Slider,`errorTrack`,r(Ia,o?p(`palette-error-main`):t.error.main,.62)),R(t.Slider,`infoTrack`,r(Ia,o?p(`palette-info-main`):t.info.main,.62)),R(t.Slider,`successTrack`,r(Ia,o?p(`palette-success-main`):t.success.main,.62)),R(t.Slider,`warningTrack`,r(Ia,o?p(`palette-warning-main`):t.warning.main,.62));let e=b?r(Pa,o?p(`palette-background-default`):t.background.default,.6825):Ra(t.background.default,.8);R(t.SnackbarContent,`bg`,e),R(t.SnackbarContent,`color`,Ps(()=>b?Vo.text.primary:t.getContrastText(e))),R(t.SpeedDialAction,`fabHoverBg`,Ra(t.background.paper,.15)),R(t.StepConnector,`border`,n(`palette-grey-400`)),R(t.StepContent,`border`,n(`palette-grey-400`)),R(t.Switch,`defaultColor`,n(`palette-common-white`)),R(t.Switch,`defaultDisabledColor`,n(`palette-grey-100`)),R(t.Switch,`primaryDisabledColor`,r(Ia,o?p(`palette-primary-main`):t.primary.main,.62)),R(t.Switch,`secondaryDisabledColor`,r(Ia,o?p(`palette-secondary-main`):t.secondary.main,.62)),R(t.Switch,`errorDisabledColor`,r(Ia,o?p(`palette-error-main`):t.error.main,.62)),R(t.Switch,`infoDisabledColor`,r(Ia,o?p(`palette-info-main`):t.info.main,.62)),R(t.Switch,`successDisabledColor`,r(Ia,o?p(`palette-success-main`):t.success.main,.62)),R(t.Switch,`warningDisabledColor`,r(Ia,o?p(`palette-warning-main`):t.warning.main,.62)),R(t.TableCell,`border`,r(Ia,Ma(o?p(`palette-divider`):t.divider,1),.88)),R(t.Tooltip,`bg`,r(Ma,o?p(`palette-grey-700`):t.grey[700],.92))}if(t.mode===`dark`){R(t.Alert,`errorColor`,r(Ia,o?p(`palette-error-light`):t.error.light,.6)),R(t.Alert,`infoColor`,r(Ia,o?p(`palette-info-light`):t.info.light,.6)),R(t.Alert,`successColor`,r(Ia,o?p(`palette-success-light`):t.success.light,.6)),R(t.Alert,`warningColor`,r(Ia,o?p(`palette-warning-light`):t.warning.light,.6)),R(t.Alert,`errorFilledBg`,n(`palette-error-dark`)),R(t.Alert,`infoFilledBg`,n(`palette-info-dark`)),R(t.Alert,`successFilledBg`,n(`palette-success-dark`)),R(t.Alert,`warningFilledBg`,n(`palette-warning-dark`)),R(t.Alert,`errorFilledColor`,Ps(()=>t.getContrastText(t.error.dark))),R(t.Alert,`infoFilledColor`,Ps(()=>t.getContrastText(t.info.dark))),R(t.Alert,`successFilledColor`,Ps(()=>t.getContrastText(t.success.dark))),R(t.Alert,`warningFilledColor`,Ps(()=>t.getContrastText(t.warning.dark))),R(t.Alert,`errorStandardBg`,r(Pa,o?p(`palette-error-light`):t.error.light,.9)),R(t.Alert,`infoStandardBg`,r(Pa,o?p(`palette-info-light`):t.info.light,.9)),R(t.Alert,`successStandardBg`,r(Pa,o?p(`palette-success-light`):t.success.light,.9)),R(t.Alert,`warningStandardBg`,r(Pa,o?p(`palette-warning-light`):t.warning.light,.9)),R(t.Alert,`errorIconColor`,n(`palette-error-main`)),R(t.Alert,`infoIconColor`,n(`palette-info-main`)),R(t.Alert,`successIconColor`,n(`palette-success-main`)),R(t.Alert,`warningIconColor`,n(`palette-warning-main`)),R(t.AppBar,`defaultBg`,n(`palette-grey-900`)),R(t.AppBar,`darkBg`,n(`palette-background-paper`)),R(t.AppBar,`darkColor`,n(`palette-text-primary`)),R(t.Avatar,`defaultBg`,n(`palette-grey-600`)),R(t.Button,`inheritContainedBg`,n(`palette-grey-800`)),R(t.Button,`inheritContainedHoverBg`,n(`palette-grey-700`)),R(t.Chip,`defaultBorder`,n(`palette-grey-700`)),R(t.Chip,`defaultAvatarColor`,n(`palette-grey-300`)),R(t.Chip,`defaultIconColor`,n(`palette-grey-300`)),R(t.FilledInput,`bg`,`rgba(255, 255, 255, 0.09)`),R(t.FilledInput,`hoverBg`,`rgba(255, 255, 255, 0.13)`),R(t.FilledInput,`disabledBg`,`rgba(255, 255, 255, 0.12)`),R(t.LinearProgress,`primaryBg`,r(Pa,o?p(`palette-primary-main`):t.primary.main,.5)),R(t.LinearProgress,`secondaryBg`,r(Pa,o?p(`palette-secondary-main`):t.secondary.main,.5)),R(t.LinearProgress,`errorBg`,r(Pa,o?p(`palette-error-main`):t.error.main,.5)),R(t.LinearProgress,`infoBg`,r(Pa,o?p(`palette-info-main`):t.info.main,.5)),R(t.LinearProgress,`successBg`,r(Pa,o?p(`palette-success-main`):t.success.main,.5)),R(t.LinearProgress,`warningBg`,r(Pa,o?p(`palette-warning-main`):t.warning.main,.5)),R(t.Skeleton,`bg`,b?r(Ma,o?p(`palette-text-primary`):t.text.primary,.13):`rgba(${n(`palette-text-primaryChannel`)} / 0.13)`),R(t.Slider,`primaryTrack`,r(Pa,o?p(`palette-primary-main`):t.primary.main,.5)),R(t.Slider,`secondaryTrack`,r(Pa,o?p(`palette-secondary-main`):t.secondary.main,.5)),R(t.Slider,`errorTrack`,r(Pa,o?p(`palette-error-main`):t.error.main,.5)),R(t.Slider,`infoTrack`,r(Pa,o?p(`palette-info-main`):t.info.main,.5)),R(t.Slider,`successTrack`,r(Pa,o?p(`palette-success-main`):t.success.main,.5)),R(t.Slider,`warningTrack`,r(Pa,o?p(`palette-warning-light`):t.warning.main,.5));let e=b?r(Ia,o?p(`palette-background-default`):t.background.default,.985):Ra(t.background.default,.98);R(t.SnackbarContent,`bg`,e),R(t.SnackbarContent,`color`,Ps(()=>b?zo.text.primary:t.getContrastText(e))),R(t.SpeedDialAction,`fabHoverBg`,Ra(t.background.paper,.15)),R(t.StepConnector,`border`,n(`palette-grey-600`)),R(t.StepContent,`border`,n(`palette-grey-600`)),R(t.Switch,`defaultColor`,n(`palette-grey-300`)),R(t.Switch,`defaultDisabledColor`,n(`palette-grey-600`)),R(t.Switch,`primaryDisabledColor`,r(Pa,o?p(`palette-primary-main`):t.primary.main,.55)),R(t.Switch,`secondaryDisabledColor`,r(Pa,o?p(`palette-secondary-main`):t.secondary.main,.55)),R(t.Switch,`errorDisabledColor`,r(Pa,o?p(`palette-error-main`):t.error.main,.55)),R(t.Switch,`infoDisabledColor`,r(Pa,o?p(`palette-info-main`):t.info.main,.55)),R(t.Switch,`successDisabledColor`,r(Pa,o?p(`palette-success-main`):t.success.main,.55)),R(t.Switch,`warningDisabledColor`,r(Pa,o?p(`palette-warning-light`):t.warning.main,.55)),R(t.TableCell,`border`,r(Pa,Ma(o?p(`palette-divider`):t.divider,1),.68)),R(t.Tooltip,`bg`,r(Ma,o?p(`palette-grey-700`):t.grey[700],.92))}o||(Ms(t.background,`default`),Ms(t.background,`paper`),Ms(t.common,`background`),Ms(t.common,`onBackground`),Ms(t,`divider`)),Object.keys(t).forEach(e=>{let n=t[e];e!==`tonalOffset`&&!o&&n&&typeof n==`object`&&(n.main&&R(t[e],`mainChannel`,Ea(js(n.main))),n.light&&R(t[e],`lightChannel`,Ea(js(n.light))),n.dark&&R(t[e],`darkChannel`,Ea(js(n.dark))),n.contrastText&&R(t[e],`contrastTextChannel`,Ea(js(n.contrastText))),e===`text`&&(Ms(t[e],`primary`),Ms(t[e],`secondary`)),e===`action`&&(n.active&&Ms(t[e],`active`),n.selected&&Ms(t[e],`selected`)))})}),S=t.reduce((e,t)=>Ar(e,t),S);let C={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:ks(S),enableContrastVars:o},{vars:w,generateThemeVars:T,generateStyleSheets:E}=Eo(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 fi(u.spacing,ii(this))},S.getColorSchemeSelector=Do(c),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=s,S.unstable_sxConfig={...Bi,...u?.unstable_sxConfig},S.unstable_sx=function(e){return Wi({sx:e,theme:this})},S.toRuntimeSource=_s,S}function Rs(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Zo({...n===!0?{}:n.palette,mode:t})})}function zs(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 xs(e,...t);let r=n;`palette`in e||l[s]&&(l[s]===!0?s===`dark`&&(r={mode:`dark`}):r=l[s].palette);let i=xs({...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},Rs(i,`dark`,l.dark)),i.palette.mode===`dark`&&(i.colorSchemes.dark={...l.dark!==!0&&l.dark,palette:i.palette},Rs(i,`light`,l.light)),i}return!n&&!(`light`in l)&&s===`light`&&(l.light=!0),Ls({...o,colorSchemes:l,defaultColorScheme:s,...typeof r!=`boolean`&&r},...t)}var Bs=zs();function Vs(){let e=Xi(Bs);return e.$$material||e}function Hs(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}var Us=e=>Hs(e)&&e!==`classes`,z=ha({themeId:at,defaultTheme:Bs,rootShouldForwardProp:Us});function Ws({theme:e,...t}){let n=`$$material`in e?e[at]:void 0;return(0,I.jsx)(io,{...t,themeId:n?at:void 0,theme:n||e})}var Gs={attribute:`data-mui-color-scheme`,colorSchemeStorageKey:`mui-color-scheme`,defaultLightColorScheme:`light`,defaultDarkColorScheme:`dark`,modeStorageKey:`mui-mode`},{CssVarsProvider:Ks,useColorScheme:qs,getInitColorSchemeScript:Js}=bo({themeId:at,theme:()=>zs({cssVariables:!0}),colorSchemeStorageKey:Gs.colorSchemeStorageKey,modeStorageKey:Gs.modeStorageKey,defaultColorScheme:{light:Gs.defaultLightColorScheme,dark:Gs.defaultDarkColorScheme},resolveTheme:e=>{let t={...e,typography:rs(e.palette,e.typography)};return t.unstable_sx=function(e){return Wi({sx:e,theme:this})},t}}),Ys=Ks;function Xs({theme:e,...t}){let n=F.useMemo(()=>{if(typeof e==`function`)return e;let t=`$$material`in e?e[at]:e;return`colorSchemes`in t?null:`vars`in t?e:{...e,vars:null}},[e]);return n?(0,I.jsx)(Ws,{theme:n,...t}):(0,I.jsx)(Ys,{theme:e,...t})}var Zs=Object.prototype;function Qs(e){return typeof e==`object`&&!!e}function $s(e){return Array.isArray(e)?e:typeof e==`number`?[e]:e.replace(/\[(\d+)\]/g,`.$1`).split(`.`).filter(Boolean)}function ec(e,t=1){if(!e?.length||t<1)return[];let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function tc(e){if(!Qs(e))return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>tc(e));let t={};for(let[n,r]of Object.entries(e))t[n]=tc(r);return t}function nc(e){return(e??[]).filter(Boolean)}function rc(e,t=0,n={}){let r,i,a,o,s,c=n.leading===!0,l=n.trailing!==!1,u=()=>{if(!a)return s;let t=a,n=o;return a=void 0,o=void 0,s=e.apply(n,t),s},d=()=>{r&&clearTimeout(r),i&&clearTimeout(i),r=void 0,i=void 0,a=void 0,o=void 0},f=function(...e){let d=c&&!r;return a=e,o=this,d&&u(),r&&clearTimeout(r),r=setTimeout(()=>{r=void 0,i&&=(clearTimeout(i),void 0),l?u():(a=void 0,o=void 0)},t),n.maxWait!==void 0&&!i&&(i=setTimeout(()=>{r&&clearTimeout(r),r=void 0,i=void 0,l||!c?u():(a=void 0,o=void 0)},n.maxWait)),s};return f.cancel=d,f.flush=()=>(r&&=(clearTimeout(r),void 0),i&&=(clearTimeout(i),void 0),u()),f}function ic(e){let t=[];for(let n of e??[])Array.isArray(n)?t.push(...n):t.push(n);return t}function ac(e,t,n){if(!Array.isArray(t)&&e!=null&&Object.prototype.hasOwnProperty.call(Object(e),t)){let r=e[t];return r===void 0?n:r}let r=e;for(let e of $s(t)){if(r==null)return n;r=r[e]}return r===void 0?n:r}function oc(e){return e?.[0]}function sc(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:!Qs(e)||Object.keys(e).length===0}function cc(e,t,n){let r=n?.(e,t);if(r!==void 0)return!!r;if(Object.is(e,t))return!0;if(!Qs(e)||!Qs(t))return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,r)=>cc(e,t[r],n));let i=Object.keys(e),a=Object.keys(t);return i.length===a.length&&i.every(r=>Zs.hasOwnProperty.call(t,r)&&cc(e[r],t[r],n))}function lc(e,t){return cc(e,t)}function uc(e){return typeof e==`function`}function dc(e){return typeof e==`string`||e instanceof String}function fc(e,t){let n={...e??{}};for(let e of Array.isArray(t)?t:[t])delete n[e];return n}function pc(e,t,n=1){let r=t??e,i=t===void 0?0:e;if(n===0)return[];let a=[],o=n>0;for(let e=i;o?e<r:e>r;e+=n)a.push(e);return a}function mc(e){return(e??[]).slice(1)}function hc(e,t){let n=t??(e=>e);return Array.from({length:Math.max(0,e)},(e,t)=>n(t))}function gc(e){return e!=null&&e.length?Array.from(new Set(Array.from(e))):[]}function _c(...e){let t=Math.max(0,...e.map(e=>e.length));return Array.from({length:t},(t,n)=>e.map(e=>e[n]))}var vc={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 yc(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),vc.hasOwnProperty(t)?{space:vc[t],local:e}:e}function bc(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 xc(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Sc(e){var t=yc(e);return(t.local?xc:bc)(t)}function Cc(){}function wc(e){return e==null?Cc:function(){return this.querySelector(e)}}function B(e){typeof e!=`function`&&(e=wc(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 fu(r,this._parents)}function Tc(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ec(){return[]}function Dc(e){return e==null?Ec:function(){return this.querySelectorAll(e)}}function Oc(e){return function(){return Tc(e.apply(this,arguments))}}function kc(e){e=typeof e==`function`?Oc(e):Dc(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 fu(r,i)}function Ac(e){return function(){return this.matches(e)}}function jc(e){return function(t){return t.matches(e)}}var Mc=Array.prototype.find;function Nc(e){return function(){return Mc.call(this.children,e)}}function Pc(){return this.firstElementChild}function Fc(e){return this.select(e==null?Pc:Nc(typeof e==`function`?e:jc(e)))}var Ic=Array.prototype.filter;function Lc(){return Array.from(this.children)}function Rc(e){return function(){return Ic.call(this.children,e)}}function zc(e){return this.selectAll(e==null?Lc:Rc(typeof e==`function`?e:jc(e)))}function Bc(e){typeof e!=`function`&&(e=Ac(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 fu(r,this._parents)}function Vc(e){return Array(e.length)}function Hc(){return new fu(this._enter||this._groups.map(Vc),this._parents)}function Uc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Uc.prototype={constructor:Uc,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 Wc(e){return function(){return e}}function Gc(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 Uc(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Kc(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 Uc(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function qc(e){return e.__data__}function Jc(e,t){if(!arguments.length)return Array.from(this,qc);var n=t?Kc:Gc,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Wc(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=Yc(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 fu(o,r),o._enter=s,o._exit=c,o}function Yc(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Xc(){return new fu(this._exit||this._groups.map(Vc),this._parents)}function Zc(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 Qc(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 fu(s,this._parents)}function $c(){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 el(e){e||=tl;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 fu(i,this._parents).order()}function tl(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function nl(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function rl(){return Array.from(this)}function il(){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 al(){let e=0;for(let t of this)++e;return e}function ol(){return!this.node()}function sl(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 cl(e){return function(){this.removeAttribute(e)}}function ll(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ul(e,t){return function(){this.setAttribute(e,t)}}function dl(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function fl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function pl(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 ml(e,t){var n=yc(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?ll:cl:typeof t==`function`?n.local?pl:fl:n.local?dl:ul)(n,t))}function hl(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function gl(e){return function(){this.style.removeProperty(e)}}function _l(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vl(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function yl(e,t,n){return arguments.length>1?this.each((t==null?gl:typeof t==`function`?vl:_l)(e,t,n??``)):bl(this.node(),e)}function bl(e,t){return e.style.getPropertyValue(t)||hl(e).getComputedStyle(e,null).getPropertyValue(t)}function xl(e){return function(){delete this[e]}}function Sl(e,t){return function(){this[e]=t}}function Cl(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function wl(e,t){return arguments.length>1?this.each((t==null?xl:typeof t==`function`?Cl:Sl)(e,t)):this.node()[e]}function Tl(e){return e.trim().split(/^|\s+/)}function El(e){return e.classList||new Dl(e)}function Dl(e){this._node=e,this._names=Tl(e.getAttribute(`class`)||``)}Dl.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 Ol(e,t){for(var n=El(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function kl(e,t){for(var n=El(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Al(e){return function(){Ol(this,e)}}function jl(e){return function(){kl(this,e)}}function Ml(e,t){return function(){(t.apply(this,arguments)?Ol:kl)(this,e)}}function Nl(e,t){var n=Tl(e+``);if(arguments.length<2){for(var r=El(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Ml:t?Al:jl)(n,t))}function Pl(){this.textContent=``}function Fl(e){return function(){this.textContent=e}}function Il(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Ll(e){return arguments.length?this.each(e==null?Pl:(typeof e==`function`?Il:Fl)(e)):this.node().textContent}function Rl(){this.innerHTML=``}function zl(e){return function(){this.innerHTML=e}}function Bl(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Vl(e){return arguments.length?this.each(e==null?Rl:(typeof e==`function`?Bl:zl)(e)):this.node().innerHTML}function Hl(){this.nextSibling&&this.parentNode.appendChild(this)}function Ul(){return this.each(Hl)}function Wl(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Gl(){return this.each(Wl)}function Kl(e){var t=typeof e==`function`?e:Sc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ql(){return null}function Jl(e,t){var n=typeof e==`function`?e:Sc(e),r=t==null?ql:typeof t==`function`?t:wc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Yl(){var e=this.parentNode;e&&e.removeChild(this)}function Xl(){return this.each(Yl)}function Zl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ql(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $l(e){return this.select(e?Ql:Zl)}function eu(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function tu(e){return function(t){e.call(this,t,this.__data__)}}function nu(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 ru(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 iu(e,t,n){return function(){var r=this.__on,i,a=tu(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 au(e,t,n){var r=nu(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?iu:ru,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function ou(e,t,n){var r=hl(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 su(e,t){return function(){return ou(this,e,t)}}function cu(e,t){return function(){return ou(this,e,t.apply(this,arguments))}}function lu(e,t){return this.each((typeof t==`function`?cu:su)(e,t))}function*uu(){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 du=[null];function fu(e,t){this._groups=e,this._parents=t}function pu(){return new fu([[document.documentElement]],du)}function mu(){return this}fu.prototype=pu.prototype={constructor:fu,select:B,selectAll:kc,selectChild:Fc,selectChildren:zc,filter:Bc,data:Jc,enter:Hc,exit:Xc,join:Zc,merge:Qc,selection:mu,order:$c,sort:el,call:nl,nodes:rl,node:il,size:al,empty:ol,each:sl,attr:ml,style:yl,property:wl,classed:Nl,text:Ll,html:Vl,raise:Ul,lower:Gl,append:Kl,insert:Jl,remove:Xl,clone:$l,datum:eu,on:au,dispatch:lu,[Symbol.iterator]:uu};function hu(e){return typeof e==`string`?new fu([[document.querySelector(e)]],[document.documentElement]):new fu([[e]],du)}function gu(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _u(e,t){if(e=gu(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]}var vu=e=>typeof e==`string`?e:typeof e==`number`?`${e}px`:`30px`,yu=({size:e,children:t})=>(e=vu(e),(0,I.jsx)(`div`,{style:{height:e,width:e,display:`inline-block`,position:`relative`},children:t}));yu.propTypes={size:P.number,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired};var bu=({size:e,children:t,sx:n})=>(0,I.jsx)(yu,{size:e,children:(0,I.jsx)(`svg`,{preserveAspectRatio:`xMinYMin meet`,viewBox:`0 0 44 40`,style:{enableBackground:`new 0 0 44 40`,...n},children:t})});bu.propTypes={size:P.oneOfType([P.string,P.number]),children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,sx:P.object};var xu=({fill:e})=>(0,I.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});xu.propTypes={fill:P.string.isRequired};var Su=({fill:e})=>(0,I.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});Su.propTypes={fill:P.string.isRequired};var Cu=({fill:e})=>(0,I.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});Cu.propTypes={fill:P.string.isRequired};var wu=({fill:e})=>(0,I.jsx)(`circle`,{transform:`translate(-3,0)`,cx:`23`,cy:`20.4`,r:`16`,fill:e});wu.propTypes={fill:P.string.isRequired};var Tu=({fill:e})=>(0,I.jsx)(`rect`,{x:`3.6`,y:`4.1`,width:`32`,height:`32`,fill:e});Tu.propTypes={fill:P.string.isRequired};var Eu=(e,t)=>{class n extends F.Component{static propTypes={iconSet:P.oneOf([`emoji`,`check`]),shape:P.oneOf([`round`,`square`]),category:P.oneOf([`feedback`,void 0]),open:P.bool,size:P.oneOfType([P.number,P.string]),fg:P.string,bg:P.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,I.jsx)(e,{fill:s}):(0,I.jsx)(t,{fill:s}),u=n===`check`?(0,I.jsx)(e,{fill:c}):(0,I.jsx)(t,{fill:c});return a?(0,I.jsx)(bu,{size:o,children:u}):(0,I.jsxs)(bu,{size:o,children:[i===`feedback`?r===`round`?(0,I.jsx)(Cu,{fill:c}):(0,I.jsx)(Su,{fill:c}):r===`round`?(0,I.jsx)(wu,{fill:c}):(0,I.jsx)(Tu,{fill:c}),l]})}}return n},Du=({fill:e})=>(0,I.jsxs)(`g`,{transform:`translate(1, 0)`,children:[(0,I.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,I.jsx)(`rect`,{x:`21.1`,y:`13.1`,width:`3.7`,height:`4.7`,fill:e}),(0,I.jsx)(`rect`,{x:`12.7`,y:`13.1`,width:`3.7`,height:`4.7`,fill:e})]});Du.propTypes={fill:P.string.isRequired};var Ou=({fill:e,x:t=0,y:n=0})=>(0,I.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});Ou.propTypes={fill:P.string.isRequired,x:P.number,y:P.number};var ku=Eu(Ou,Du);ku.propTypes={iconSet:P.oneOf([`emoji`,`check`]),shape:P.oneOf([`round`,`square`]),category:P.oneOf([`feedback`,void 0]),open:P.bool,fg:P.string,bg:P.string,size:P.oneOfType([P.string,P.number])},ku.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#4aaf46`,bg:`#f8ffe2`,size:30};var Au=({bgFill:e,fgFill:t})=>(0,I.jsxs)(`svg`,{preserveAspectRatio:`xMinYMin meet`,version:`1.1`,viewBox:`-283 359 34 35`,style:{enableBackground:`new -283 359 34 35`},children:[(0,I.jsx)(`circle`,{cx:`-266`,cy:`375.9`,r:`14`,fill:e}),(0,I.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,I.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})]});Au.propTypes={bgFill:P.string.isRequired,fgFill:P.string.isRequired};var ju=({bgFill:e,fgFill:t,borderFill:n})=>(0,I.jsxs)(`svg`,{preserveAspectRatio:`xMinYMin meet`,version:`1.1`,viewBox:`-129.5 127 34 35`,style:{enableBackground:`new -129.5 127 34 35`},children:[(0,I.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,I.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,I.jsx)(`circle`,{cx:`-114.2`,cy:`143.5`,r:`14`,fill:e}),(0,I.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,I.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})]});ju.propTypes={bgFill:P.string.isRequired,fgFill:P.string.isRequired,borderFill:P.string.isRequired};var Mu=z(`div`)(({size:e})=>({width:e||`25px`,height:e||`25px`})),Nu=({open:e,size:t})=>(0,I.jsx)(Mu,{size:t,children:e?(0,I.jsx)(Au,{bgFill:`#bce2ff`,fgFill:`#1a9cff`}):(0,I.jsx)(ju,{bgFill:`white`,fgFill:`#1a9cff`,borderFill:`#bce2ff`})});Nu.propTypes={open:P.bool,size:P.string},Nu.defaultProps={open:!1};var Pu=({fill:e})=>(0,I.jsxs)(`g`,{transform:`translate(0.5, 0.5)`,children:[(0,I.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,I.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})]});Pu.propTypes={fill:P.string.isRequired};var Fu=({fill:e})=>(0,I.jsxs)(`g`,{transform:`translate(1,0)`,children:[(0,I.jsx)(`rect`,{x:`21`,y:`12.9`,width:`3.7`,height:`4.7`,fill:e}),(0,I.jsx)(`rect`,{x:`12.7`,y:`12.9`,width:`3.7`,height:`4.7`,fill:e}),(0,I.jsx)(`rect`,{x:`12.2`,y:`22.5`,width:`13`,height:`3.3`,fill:e})]});Fu.propTypes={fill:P.string.isRequired};var Iu=Eu(Pu,Fu);Iu.propTypes={iconSet:P.oneOf([`emoji`,`check`]),shape:P.oneOf([`round`,`square`]),category:P.oneOf([`feedback`,void 0]),open:P.bool,fg:P.string,bg:P.string,size:P.oneOfType([P.string,P.number])},Iu.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#fcb733`,bg:`#fbf2e3`,size:30};var Lu=({fill:e})=>(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`rect`,{x:`19.3`,y:`10.3`,width:`4.5`,height:`12.7`,fill:e}),(0,I.jsx)(`rect`,{x:`19.3`,y:`26.2`,width:`4.5`,height:`4.5`,fill:e})]});Lu.propTypes={fill:P.string.isRequired};var Ru=({fill:e})=>(0,I.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});Ru.propTypes={fill:P.string.isRequired};var zu=({fill:e})=>(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`rect`,{x:`23.8`,y:`15`,width:`3.5`,height:`4.4`,fill:e}),(0,I.jsx)(`rect`,{x:`16`,y:`15`,width:`3.5`,height:`4.4`,fill:e}),(0,I.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})]});zu.propTypes={fill:P.string.isRequired};var Bu=class extends F.Component{constructor(e){super(e);let{fg:t=`#464146`,bg:n=`white`}=this.props;this.icons={check:(0,I.jsxs)(bu,{children:[(0,I.jsx)(Ru,{fill:n}),(0,I.jsx)(Lu,{fill:t})]}),emoji:(0,I.jsxs)(bu,{children:[(0,I.jsx)(Ru,{fill:n}),(0,I.jsx)(zu,{fill:t})]}),feedback:{check:(0,I.jsxs)(bu,{children:[(0,I.jsx)(Ru,{fill:n}),(0,I.jsx)(zu,{fill:t})]}),emoji:(0,I.jsxs)(bu,{children:[(0,I.jsx)(Ru,{fill:n}),(0,I.jsx)(zu,{fill:t})]}),square:{check:(0,I.jsxs)(bu,{children:[(0,I.jsx)(Ru,{fill:n}),(0,I.jsx)(Lu,{fill:t})]}),emoji:(0,I.jsxs)(bu,{children:[(0,I.jsx)(Ru,{fill:n}),(0,I.jsx)(zu,{fill:t})]}),open:{check:(0,I.jsx)(bu,{children:(0,I.jsx)(Lu,{fill:n})}),emoji:(0,I.jsx)(bu,{children:(0,I.jsx)(zu,{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]}};Bu.propTypes={iconSet:P.oneOf([`emoji`,`check`,void 0]),shape:P.oneOf([`square`,void 0]),category:P.oneOf([`feedback`,void 0]),open:P.bool,fg:P.string,bg:P.string},Bu.defaultProps={iconSet:`check`,shape:void 0,category:void 0,open:!1,fg:`#464146`,bg:`white`};var Vu=({fill:e})=>(0,I.jsxs)(`g`,{transform:`translate(0, 0)`,children:[(0,I.jsx)(`polygon`,{points:`27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6`,fill:e}),(0,I.jsx)(`polygon`,{points:`16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3`,fill:e})]});Vu.propTypes={fill:P.string.isRequired};var Hu=({fill:e})=>(0,I.jsxs)(`g`,{transform:`translate(2, 0)`,children:[(0,I.jsx)(`rect`,{x:`20.6`,y:`11.8`,width:`4`,height:`5`,fill:e}),(0,I.jsx)(`rect`,{x:`11.5`,y:`11.8`,width:`4`,height:`5`,fill:e}),(0,I.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})]});Hu.propTypes={fill:P.string.isRequired};var Uu=Eu(Vu,Hu);Uu.propTypes={iconSet:P.oneOf([`emoji`,`check`]),shape:P.oneOf([`round`,`square`]),category:P.oneOf([`feedback`,void 0]),open:P.bool,fg:P.string,bg:P.string,size:P.oneOfType([P.string,P.number])},Uu.defaultProps={iconSet:`check`,shape:`round`,category:void 0,open:!1,fg:`#4aaf46`,bg:`#c1e1ac`,size:30};function Wu(e){return typeof e==`string`}function Gu(e){return(0,I.jsx)(Qi,{...e,defaultTheme:Bs,themeId:at})}function Ku(e){return function(t){return(0,I.jsx)(Gu,{styles:typeof e==`function`?n=>e({theme:n,...t}):e})}}function qu(){return ea}function Ju(e){return Xa(e)}function Yu(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}var Xu=Yu;function Zu(e){return e&&e.ownerDocument||document}var Qu=Zu;function $u(e){return Zu(e).defaultView||window}var ed=$u,td={};function nd(e,t){let n=F.useRef(td);return n.current===td&&(n.current=e(t)),n}var rd=[];function id(e){F.useEffect(e,rd)}var eee=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 ad(){let e=nd(eee.create).current;return id(e.disposeEffect),e}function od(e){return e?.ref||null}function sd(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 cd(e,t){return cd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cd(e,t)}function ld(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cd(e,t)}function tee(e,t){return e.classList?!!t&&e.classList.contains(t):(` `+(e.className.baseVal||e.className)+` `).indexOf(` `+t+` `)!==-1}function ud(e,t){e.classList?e.classList.add(t):tee(e,t)||(typeof e.className==`string`?e.className=e.className+` `+t:e.setAttribute(`class`,(e.className&&e.className.baseVal||``)+` `+t))}function dd(e,t){return e.replace(RegExp(`(^|\\s)`+t+`(?:\\s|$)`,`g`),`$1`).replace(/\s+/g,` `).replace(/^\s*|\s*$/g,``)}function fd(e,t){e.classList?e.classList.remove(t):typeof e.className==`string`?e.className=dd(e.className,t):e.setAttribute(`class`,dd(e.className&&e.className.baseVal||``,t))}var pd={disabled:!1},md=F.createContext(null),hd=function(e){return e.scrollTop},gd=l(h()),_d=`unmounted`,vd=`exited`,yd=`entering`,bd=`entered`,xd=`exiting`,Sd=function(e){ld(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=vd,r.appearStatus=yd):o=bd:o=t.unmountOnExit||t.mountOnEnter?_d:vd,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:vd}: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=yd):(n===`entering`||n===`entered`)&&(t=xd)}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:gd.findDOMNode(this);n&&hd(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:_d})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[gd.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||pd.disabled){this.safeSetState({status:bd},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:yd},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:bd},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:gd.findDOMNode(this);if(!t||pd.disabled){this.safeSetState({status:vd},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:xd},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:vd},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:gd.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=sd(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return F.createElement(md.Provider,{value:null},typeof n==`function`?n(e,r):F.cloneElement(F.Children.only(n),r))},t}(F.Component);Sd.contextType=md,Sd.propTypes={};function Cd(){}Sd.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Cd,onEntering:Cd,onEntered:Cd,onExit:Cd,onExiting:Cd,onExited:Cd},Sd.UNMOUNTED=_d,Sd.EXITED=vd,Sd.ENTERING=yd,Sd.ENTERED=bd,Sd.EXITING=xd;var wd=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return ud(e,t)})},Td=function(e,t){return e&&t&&t.split(` `).forEach(function(t){return fd(e,t)})},Ed=function(e){ld(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&&hd(e),r&&(this.appliedClasses[t][n]=r,wd(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&&Td(e,r),i&&Td(e,i),a&&Td(e,a)},n.render=function(){var e=this.props;e.classNames;var t=sd(e,[`classNames`]);return F.createElement(Sd,ot({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(F.Component);Ed.defaultProps={classNames:``},Ed.propTypes={};function Dd(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Od(e,t){var n=function(e){return t&&(0,F.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&F.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function kd(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 Ad(e,t,n){return n[t]==null?e.props[t]:n[t]}function jd(e,t){return Od(e.children,function(n){return(0,F.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:Ad(n,`appear`,e),enter:Ad(n,`enter`,e),exit:Ad(n,`exit`,e)})})}function Md(e,t,n){var r=Od(e.children),i=kd(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,F.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,F.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,F.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:Ad(o,`exit`,e),enter:Ad(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,F.cloneElement)(o,{in:!1}):c&&s&&(0,F.isValidElement)(l)&&(i[a]=(0,F.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:Ad(o,`exit`,e),enter:Ad(o,`enter`,e)}))}}),i}var Nd=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Pd={component:`div`,childFactory:function(e){return e}},Fd=function(e){ld(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(Dd(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?jd(e,r):Md(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=Od(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=ot({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=sd(e,[`component`,`childFactory`]),i=this.state.contextValue,a=Nd(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?F.createElement(md.Provider,{value:i},a):F.createElement(md.Provider,{value:i},F.createElement(t,r,a))},t}(F.Component);Fd.propTypes={},Fd.defaultProps=Pd;var Id=e=>e.scrollTop;function Ld(e,t){return n=>{if(t){let r=e.current;n===void 0?t(r):t(r,n)}}}function Rd(e,t,n,r,i,a){let o=e===`exited`&&!t?r:n[e]||n.exited;return i||a?{...o,...i,...a}:o}function zd(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 Bd(...e){let t=F.useRef(void 0),n=F.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 F.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Vd=Bd;function Hd(e){return`scale(${e}, ${e**2})`}var Ud={entering:{opacity:1,transform:Hd(1)},entered:{opacity:1,transform:`none`},exiting:{opacity:0,transform:Hd(.75)},exited:{opacity:0,transform:Hd(.75)}},Wd={opacity:0,transform:Hd(.75),visibility:`hidden`},Gd=F.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=ad(),_=F.useRef(),v=Vs(),y=F.useRef(null),b=Vd(y,od(i),t),x=Ld(y,l),S=Ld(y,(e,t)=>{Id(e);let{duration:n,delay:r,easing:i}=zd({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=Ld(y,c),w=Ld(y,f),T=Ld(y,e=>{let{duration:t,delay:n,easing:r}=zd({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=Hd(.75),u&&u(e)}),E=Ld(y,e=>{e.style.transition=``,d&&d(e)});return(0,I.jsx)(Sd,{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=Rd(e,o,Ud,Wd,p,i.props.style);return F.cloneElement(i,{style:r,ref:b,...n})}})});Gd&&(Gd.muiSupportAuto=!0);function Kd(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}function qd(e){let t=Zu(e);return t.body===e?$u(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Jd(e,t){t?e.setAttribute(`aria-hidden`,`true`):e.removeAttribute(`aria-hidden`)}function Yd(e){return parseFloat($u(e).getComputedStyle(e).paddingRight)||0}function Xd(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 Zd(e,t,n,r,i){let a=[t,n,...r];[].forEach.call(e.children,e=>{let t=!a.includes(e),n=!Xd(e);t&&n&&Jd(e,i)})}function Qd(e,t){let n=-1;return e.some((e,r)=>t(e)?(n=r,!0):!1),n}function $d(e,t){let n=[],r=e.container;if(!t.disableScrollLock){if(qd(r)){let e=Kd($u(r));n.push({value:r.style.paddingRight,property:`padding-right`,el:r}),r.style.paddingRight=`${Yd(r)+e}px`;let t=Zu(r).querySelectorAll(`.mui-fixed`);[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:`padding-right`,el:t}),t.style.paddingRight=`${Yd(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=Zu(r).body;else{let t=r.parentElement,n=$u(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 ef(e){let t=[];return[].forEach.call(e.children,e=>{e.getAttribute(`aria-hidden`)===`true`&&t.push(e)}),t}var nee=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&&Jd(e.modalRef,!1);let r=ef(t);Zd(t,e.mount,e.modalRef,r,!0);let i=Qd(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=Qd(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||=$d(r,t)}remove(e,t=!0){let n=this.modals.indexOf(e);if(n===-1)return n;let r=Qd(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&&Jd(e.modalRef,t),Zd(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&&Jd(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function tf(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 nf=tf;function rf(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}var af=rf,of=`data-mui-focusable`;function sf(e){return e?e.hasAttribute(`data-mui-focusable`)?e:e.querySelector(`[${of}]`):null}var cf=[`input`,`select`,`textarea`,`a[href]`,`button`,`[tabindex]`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function lf(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 uf(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 df(e){return!(e.disabled||e.tagName===`INPUT`&&e.type===`hidden`||uf(e))}function ff(e){let t=[],n=[];return Array.from(e.querySelectorAll(cf)).forEach((e,r)=>{let i=lf(e);i===-1||!df(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 pf(){return!0}function mf(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=ff,isEnabled:o=pf,open:s}=e,c=F.useRef(!1),l=F.useRef(null),u=F.useRef(null),d=F.useRef(null),f=F.useRef(null),p=F.useRef(!1),m=F.useRef(null),h=Bd(od(t),m),g=F.useRef(null);F.useEffect(()=>{!s||!m.current||(p.current=!n)},[n,s]),F.useEffect(()=>{if(c.current=!1,!s||!m.current)return;let e=af(Zu(m.current)),t=sf(m.current)??m.current;return nf(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]),F.useEffect(()=>{if(!s||!m.current)return;let e=Zu(m.current),t=t=>{g.current=t,!(r||!o()||t.key!==`Tab`)&&af(e)===m.current&&t.shiftKey&&(c.current=!0,u.current&&u.current.focus())},n=()=>{let t=m.current;if(t===null)return;let n=af(e);if(!e.hasFocus()||!o()||c.current){c.current=!1;return}if(nf(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=af(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,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(`div`,{tabIndex:s?0:-1,onFocus:v,ref:l,"data-testid":`sentinelStart`}),F.cloneElement(t,{ref:h,onFocus:_}),(0,I.jsx)(`div`,{tabIndex:s?0:-1,onFocus:v,ref:u,"data-testid":`sentinelEnd`})]})}function hf(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function gf(e){return typeof e==`function`?e():e}var _f=F.forwardRef(function(e,t){let{children:n,container:r,disablePortal:i=!1}=e,[a,o]=F.useState(null),s=Bd(F.isValidElement(n)?od(n):null,t);if(ba(()=>{i||o(gf(r)||document.body)},[r,i]),ba(()=>{if(a&&!i)return hf(t,a),()=>{hf(t,null)}},[t,a,i]),i){if(F.isValidElement(n)){let e={ref:s};return F.cloneElement(n,e)}return n}return a&&gd.createPortal(n,a)}),vf=oo;function yf(e,t,n){return e===void 0||Wu(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function bf(e,t,n){return typeof e==`function`?e(t,n):e}function xf(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 Sf(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 Cf(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){let e=L(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=xf({...i,...r}),s=Sf(r),c=Sf(i),l=t(o),u=L(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 wf(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=bf(d[e],i),{props:{component:h,...g},internalRef:_}=Cf({className:n,...c,externalForwardedProps:e===`root`?f:void 0,externalSlotProps:m}),v=Bd(_,m?.ref,t.ref),y=e===`root`?h||l:h;return[p,yf(p,{...e===`root`&&!l&&!u[e]&&o,...e!==`root`&&!u[e]&&o,...g,...y&&!s&&{as:y},...y&&s&&{component:y},ref:v},i)]}var Tf={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0}},Ef={opacity:0,visibility:`hidden`},Df=F.forwardRef(function(e,t){let n=Vs(),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=F.useRef(null),y=Vd(v,od(o),t),b=Ld(v,d),x=Ld(v,(e,t)=>{Id(e);let r=zd({style:h,timeout:g,easing:s},{mode:`enter`});e.style.transition=n.transitions.create(`opacity`,r),l&&l(e,t)}),S=Ld(v,u),C=Ld(v,m),w=Ld(v,e=>{let t=zd({style:h,timeout:g,easing:s},{mode:`exit`});e.style.transition=n.transitions.create(`opacity`,t),f&&f(e)}),T=Ld(v,e=>{e.style.transition=``,p&&p(e)});return(0,I.jsx)(Sd,{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=Rd(e,c,Tf,Ef,h,o.props.style);return F.cloneElement(o,{style:r,ref:y,...n})}})});function Of(e){return aa(`MuiBackdrop`,e)}oa(`MuiBackdrop`,[`root`,`invisible`]);var kf=e=>{let{classes:t,invisible:n}=e;return Oo({root:[`root`,n&&`invisible`]},Of,t)},Af=z(`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`}}]}),jf=F.forwardRef(function(e,t){let n=Ju({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=kf(h),_={component:a,slots:{transition:f,root:c.Root,...d},slotProps:{...l,...u}},[v,y]=wf(`root`,{elementType:Af,externalForwardedProps:_,className:L(g.root,i),ownerState:h}),[b,x]=wf(`transition`,{elementType:Df,externalForwardedProps:_,ownerState:h});return(0,I.jsx)(b,{in:s,timeout:p,...m,...x,children:(0,I.jsx)(v,{"aria-hidden":!0,...y,ref:t,children:r})})});function Mf(e){let t=F.useRef(e);return ba(()=>{t.current=e}),F.useRef((...e)=>(0,t.current)(...e)).current}function Nf(...e){return e.reduce((e,t)=>t==null?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function Pf(e){return typeof e==`function`?e():e}function Ff(e){return e?e.props.hasOwnProperty(`in`):!1}var If=()=>{},Lf=new nee;function Rf(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=F.useRef({}),f=F.useRef(null),p=F.useRef(null),m=Bd(p,u),[h,g]=F.useState(!l),_=Ff(s),v=!0;(e[`aria-hidden`]===`false`||e[`aria-hidden`]===!1)&&(v=!1);let y=()=>Zu(f.current),b=()=>(d.current.modalRef=p.current,d.current.mount=f.current,d.current),x=()=>{Lf.mount(b(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},S=Mf(()=>{let e=Pf(t)||y().body;Lf.add(b(),e),p.current&&x()}),C=()=>Lf.isTopModal(b()),w=Mf(e=>{f.current=e,e&&(l&&C()?x():p.current&&Jd(p.current,v))}),T=F.useCallback(()=>{Lf.remove(b(),v)},[v]);F.useEffect(()=>()=>{T()},[T]),F.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=xf(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:Nf(()=>{g(!1),a&&a()},s?.props.onEnter??If),onExited:Nf(()=>{g(!0),o&&o(),i&&T()},s?.props.onExited??If)}),rootRef:m,portalRef:w,isTopModal:C,exited:h,hasTransition:_}}function zf(e){return aa(`MuiModal`,e)}oa(`MuiModal`,[`root`,`hidden`,`backdrop`]);var Bf=e=>{let{open:t,exited:n,classes:r}=e;return Oo({root:[`root`,!t&&n&&`hidden`],backdrop:[`backdrop`]},zf,r)},Vf=z(`div`,{name:`MuiModal`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(vf(({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`}}]}))),Hf=z(jf,{name:`MuiModal`,slot:`Backdrop`})({zIndex:-1}),Uf=F.forwardRef(function(e,t){let n=Ju({name:`MuiModal`,props:e}),{BackdropComponent:r=Hf,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:ee,isTopModal:N,exited:te,hasTransition:ne}=Rf({...k,rootRef:t}),re={...k,exited:te},ie=Bf(re),ae={};if(c.props.tabIndex===void 0&&(ae.tabIndex=`-1`),ne){let{onEnter:e,onExited:t}=M();ae.onEnter=e,ae.onExited=t}let oe={slots:{root:d.Root,backdrop:d.Backdrop,...E},slotProps:{...f,...T}},[se,ce]=wf(`root`,{ref:t,elementType:Vf,externalForwardedProps:{...oe,...O,component:u},getSlotProps:A,ownerState:re,className:L(o,ie?.root,!re.open&&re.exited&&ie?.hidden)}),[le,ue]=wf(`backdrop`,{ref:i?.ref,elementType:r,externalForwardedProps:oe,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:e=>j({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:L(i?.className,ie?.backdrop),ownerState:re});return!b&&!w&&(!ne||te)?null:(0,I.jsx)(_f,{ref:ee,container:l,disablePortal:g,children:(0,I.jsxs)(se,{...ce,children:[!y&&r?(0,I.jsx)(le,{...ue}):null,(0,I.jsx)(mf,{disableEnforceFocus:m,disableAutoFocus:p,disableRestoreFocus:_,isEnabled:N,open:w,children:F.cloneElement(c,ae)})]})})});function Wf(e){return aa(`MuiPaper`,e)}oa(`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(`.`));var Gf=e=>{let{square:t,elevation:n,variant:r,classes:i}=e;return Oo({root:[`root`,r,!t&&`rounded`,r===`elevation`&&`elevation${n}`]},Wf,i)},Kf=z(`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}`]]}})(vf(({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)`}}]}))),qf=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiPaper`}),r=Vs(),{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},d=Gf(u);return(0,I.jsx)(Kf,{as:a,ownerState:u,className:L(d.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(${ja(`#fff`,Ss(o))}, ${ja(`#fff`,Ss(o))})`}},...l.style}})});function Jf(e){return aa(`MuiPopover`,e)}oa(`MuiPopover`,[`root`,`paper`]);var V=Gr,Yf=Nf;function Xf(e){return aa(`MuiSvgIcon`,e)}oa(`MuiSvgIcon`,[`root`,`colorPrimary`,`colorSecondary`,`colorAction`,`colorError`,`colorDisabled`,`fontSizeInherit`,`fontSizeSmall`,`fontSizeMedium`,`fontSizeLarge`]);var Zf=e=>{let{color:t,fontSize:n,classes:r}=e;return Oo({root:[`root`,t!==`inherit`&&`color${V(t)}`,`fontSize${V(n)}`]},Xf,r)},Qf=z(`svg`,{name:`MuiSvgIcon`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color!==`inherit`&&t[`color${V(n.color)}`],t[`fontSize${V(n.fontSize)}`]]}})(vf(({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}}]}))),$f=F.forwardRef(function(e,t){let n=Ju({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=F.isValidElement(r)&&r.type===`svg`,m={...n,color:a,component:o,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:l,viewBox:d,hasSvgAsChild:p},h={};l||(h.viewBox=d);let g=Zf(m);return(0,I.jsxs)(Qf,{as:o,className:L(g.root,i),focusable:`false`,color:c,"aria-hidden":!u||void 0,role:u?`img`:void 0,ref:t,...h,...f,...p&&r.props,ownerState:m,children:[p?r.props.children:r,u?(0,I.jsx)(`title`,{children:u}):null]})});$f.muiName=`SvgIcon`;function ep(e,t){function n(t,n){return(0,I.jsx)($f,{"data-testid":void 0,ref:n,...t,children:e})}return n.muiName=$f.muiName,F.memo(F.forwardRef(n))}var tp=ko,np=ba,rp=eo;function ip(e){let{controlled:t,default:n,name:r,state:i=`value`}=e,{current:a}=F.useRef(t!==void 0),[o,s]=F.useState(n);return[a?t:o,F.useCallback(e=>{a||s(e)},[])]}var ap=ip,op=Mf;function sp(e,t){let n=e.charCodeAt(2);return e[0]===`o`&&e[1]===`n`&&n>=65&&n<=90&&typeof t==`function`}function cp(e,t){if(!e)return t;function n(e,t){let n={};return Object.keys(t).forEach(r=>{sp(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=L(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=L(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]]}}}function lp(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.height/2:t===`bottom`&&(n=e.height),n}function up(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.width/2:t===`right`&&(n=e.width),n}function dp(e){return[e.horizontal,e.vertical].map(e=>typeof e==`number`?`${e}px`:e).join(` `)}function fp(e){return typeof e==`function`?e():e}var pp=e=>{let{classes:t}=e;return Oo({root:[`root`],paper:[`paper`]},Jf,t)},mp=z(Uf,{name:`MuiPopover`,slot:`Root`})({}),hp=z(qf,{name:`MuiPopover`,slot:`Paper`})({position:`absolute`,overflowY:`auto`,overflowX:`hidden`,minWidth:16,minHeight:16,maxWidth:`calc(100% - 32px)`,maxHeight:`calc(100% - 32px)`,outline:0}),gp=F.forwardRef(function(e,t){let n=Ju({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=F.useRef(),w={...n,anchorOrigin:a,anchorReference:s,elevation:d,marginThreshold:f,transformOrigin:_,TransitionComponent:v,transitionDuration:y,TransitionProps:b},T=pp(w),E=F.useCallback(()=>{if(s===`anchorPosition`)return o;let e=fp(i),t=(e&&e.nodeType===1?e:Qu(C.current).body).getBoundingClientRect();return{top:t.top+lp(t,a.vertical),left:t.left+up(t,a.horizontal)}},[i,a.horizontal,a.vertical,o,s]),D=F.useCallback(e=>({vertical:lp(e,_.vertical),horizontal:up(e,_.horizontal)}),[_.horizontal,_.vertical]),O=F.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=D(t);if(s===`none`)return{top:null,left:null,transformOrigin:dp(n)};let r=E(),a=r.top-n.vertical,o=r.left-n.horizontal,c=a+t.height,l=o+t.width,u=ed(fp(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:dp(n)}},[i,s,E,D,f]),[k,A]=F.useState(p),j=F.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]);F.useEffect(()=>(x&&window.addEventListener(`scroll`,j),()=>window.removeEventListener(`scroll`,j)),[i,x,j]);let M=()=>{j()},ee=()=>{A(!1)};F.useEffect(()=>{p&&j()}),F.useImperativeHandle(r,()=>p?{updatePosition:()=>{j()}}:null,[p,j]),F.useEffect(()=>{if(!p)return;let e=Xu(()=>{j()}),t=ed(fp(i));return t.addEventListener(`resize`,e),()=>{e.clear(),t.removeEventListener(`resize`,e)}},[i,p,j]);let N=y,te={slots:{transition:v,...h},slotProps:{transition:b,paper:m,...g}},[ne,re]=wf(`transition`,{elementType:Gd,externalForwardedProps:te,ownerState:w,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),M()},onExited:t=>{e.onExited?.(t),ee()}}),additionalProps:{appear:!0,in:p}});y===`auto`&&!ne.muiSupportAuto&&(N=void 0);let ie=u||(i?Qu(fp(i)).body:void 0),[ae,{slots:oe,slotProps:se,...ce}]=wf(`root`,{ref:t,elementType:mp,externalForwardedProps:{...te,...S},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:h.backdrop},slotProps:{backdrop:cp(typeof g.backdrop==`function`?g.backdrop(w):g.backdrop,{invisible:!0})},container:ie,open:p},ownerState:w,className:L(T.root,l)}),[le,ue]=wf(`paper`,{ref:C,className:T.paper,elementType:hp,externalForwardedProps:te,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:k?void 0:{opacity:0}},ownerState:w});return(0,I.jsx)(ae,{...ce,...!Wu(ae)&&{slots:oe,slotProps:se,disableScrollLock:x},children:(0,I.jsx)(ne,{...re,timeout:N,children:(0,I.jsx)(le,{...ue,children:c})})})}),_p={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`},vp={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`},yp=s({background:()=>Wp,backgroundDark:()=>Gp,black:()=>im,blueGrey100:()=>iee,blueGrey300:()=>aee,blueGrey600:()=>oee,blueGrey900:()=>see,border:()=>Zp,borderDark:()=>$p,borderGray:()=>em,borderLight:()=>Qp,buttonBorder:()=>lee,buttonFocusOutline:()=>um,buttonHoverBg:()=>gm,correct:()=>Ep,correctSecondary:()=>Dp,correctTertiary:()=>Op,correctWithIcon:()=>kp,defaults:()=>H,disabled:()=>Cp,disabledSecondary:()=>wp,disabledText:()=>Tp,dropdownBackground:()=>qp,fadedPrimary:()=>zp,focusChecked:()=>sm,focusCheckedBorder:()=>cm,focusUnchecked:()=>lm,focusUncheckedBorder:()=>ree,incorrect:()=>Ap,incorrectSecondary:()=>Mp,incorrectWithIcon:()=>jp,keyBoardFocusIndicator:()=>cee,keypadButton:()=>dm,keypadButtonHover:()=>mm,keypadButtonOperator:()=>fm,keypadButtonOperatorHover:()=>hm,keypadEmptyPlaceholder:()=>pm,missing:()=>Np,missingWithIcon:()=>Pp,primary:()=>Fp,primaryDark:()=>Lp,primaryLight:()=>Ip,primaryText:()=>Rp,secondary:()=>Bp,secondaryBackground:()=>Kp,secondaryDark:()=>Hp,secondaryLight:()=>Vp,secondaryText:()=>Up,surface:()=>Jp,tableGrid:()=>tm,tableGridLight:()=>nm,tableStripe:()=>rm,tertiary:()=>Yp,tertiaryLight:()=>Xp,text:()=>Sp,transparent:()=>om,v:()=>bp,visualElementsColors:()=>_m,white:()=>am}),H={TEXT:`black`,DISABLED:`grey`,DISABLED_SECONDARY:`#ABABAB`,DISABLED_TEXT:`#545454`,CORRECT:Lo[500],CORRECT_SECONDARY:Lo[50],CORRECT_TERTIARY:`#0EA449`,CORRECT_WITH_ICON:`#087D38`,INCORRECT:Po[500],INCORRECT_SECONDARY:No[50],INCORRECT_WITH_ICON:`#BF0D00`,MISSING:No[700],MISSING_WITH_ICON:`#6A78A1`,PRIMARY:vp[500],PRIMARY_LIGHT:vp[200],PRIMARY_DARK:vp[800],SECONDARY:_p.A400,SECONDARY_LIGHT:_p[200],SECONDARY_DARK:_p[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)`,SURFACE:`#E0E1E6`,BORDER:`#9A9A9A`,BORDER_LIGHT:`#D1D1D1`,BORDER_DARK:`#646464`,BORDER_GRAY:`#7E8494`,TABLE_GRID:`black`,TABLE_GRID_LIGHT:`#dfe2e5`,TABLE_STRIPE:`#f6f8fa`,BLACK:`#000000`,WHITE:`#ffffff`,TRANSPARENT:`transparent`,FOCUS_CHECKED:`#BBDEFB`,FOCUS_CHECKED_BORDER:`#1565C0`,FOCUS_UNCHECKED:`#E0E0E0`,FOCUS_UNCHECKED_BORDER:`#757575`,BUTTON_FOCUS_OUTLINE:`#3B82F6`,BLUE_GREY100:`#F3F5F7`,BLUE_GREY300:`#81848F`,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)`,KEY_BOARD_FOCUS_INDICATOR:`#2B87FF`,BUTTON_BORDER:`rgba(0, 0, 0, 0.23)`,BUTTON_HOVER_BG:`rgba(0, 0, 0, 0.08)`};Object.freeze(H);var bp=e=>(...t)=>{let n=t.pop();return t.reduceRight((t,n)=>`var(--${e}-${n}, ${t})`,n)},xp=bp(`pie`),Sp=()=>xp(`text`,H.TEXT),Cp=()=>xp(`disabled`,H.DISABLED),wp=()=>xp(`disabled-secondary`,H.DISABLED_SECONDARY),Tp=()=>xp(`disabled-text`,`text`,H.DISABLED_TEXT),Ep=()=>xp(`correct`,H.CORRECT),Dp=()=>xp(`correct-secondary`,H.CORRECT_SECONDARY),Op=()=>xp(`correct-tertiary`,H.CORRECT_TERTIARY),kp=()=>xp(`correct-icon`,H.CORRECT_WITH_ICON),Ap=()=>xp(`incorrect`,H.INCORRECT),jp=()=>xp(`incorrect-icon`,H.INCORRECT_WITH_ICON),Mp=()=>xp(`incorrect-secondary`,H.INCORRECT_SECONDARY),Np=()=>xp(`missing`,H.MISSING),Pp=()=>xp(`missing-icon`,H.MISSING_WITH_ICON),Fp=()=>xp(`primary`,H.PRIMARY),Ip=()=>xp(`primary-light`,H.PRIMARY_LIGHT),Lp=()=>xp(`primary-dark`,H.PRIMARY_DARK),Rp=()=>xp(`primary-text`,`text`,H.TEXT),zp=()=>xp(`faded-primary`,H.FADED_PRIMARY),Bp=()=>xp(`secondary`,H.SECONDARY),Vp=()=>xp(`secondary-light`,H.SECONDARY_LIGHT),Hp=()=>xp(`secondary-dark`,H.SECONDARY_DARK),Up=()=>xp(`secondary-text`,`text`,H.TEXT),Wp=()=>xp(`background`,H.BACKGROUND),Gp=()=>xp(`background-dark`,H.BACKGROUND_DARK),Kp=()=>xp(`secondary-background`,H.SECONDARY_BACKGROUND),qp=()=>xp(`dropdown-background`,H.DROPDOWN_BACKGROUND),Jp=()=>xp(`surface`,H.SURFACE),Yp=()=>xp(`tertiary`,H.TERTIARY),Xp=()=>xp(`tertiary-light`,H.TERTIARY_LIGHT),Zp=()=>xp(`border`,H.BORDER),Qp=()=>xp(`border-light`,H.BORDER_LIGHT),$p=()=>xp(`border-dark`,H.BORDER_DARK),em=()=>xp(`border-gray`,H.BORDER_GRAY),tm=()=>xp(`table-grid`,`text`,H.TABLE_GRID),nm=()=>xp(`table-grid-light`,`border-light`,H.TABLE_GRID_LIGHT),rm=()=>xp(`table-stripe`,`background-dark`,H.TABLE_STRIPE),im=()=>xp(`black`,H.BLACK),am=()=>xp(`white`,H.WHITE),om=()=>H.TRANSPARENT,sm=()=>xp(`focus-checked`,H.FOCUS_CHECKED),cm=()=>xp(`focus-checked-border`,H.FOCUS_CHECKED_BORDER),lm=()=>xp(`focus-unchecked`,H.FOCUS_UNCHECKED),ree=()=>xp(`focus-unchecked-border`,H.FOCUS_UNCHECKED_BORDER),um=()=>xp(`button-focus-outline`,H.BUTTON_FOCUS_OUTLINE),iee=()=>xp(`blue-grey-100`,H.BLUE_GREY100),aee=()=>xp(`blue-grey-300`,H.BLUE_GREY300),oee=()=>xp(`blue-grey-600`,H.BLUE_GREY600),see=()=>xp(`blue-grey-900`,H.BLUE_GREY900),dm=()=>xp(`keypad-button`,H.KEYPAD_BUTTON),fm=()=>xp(`keypad-button-operator`,H.KEYPAD_BUTTON_OPERATOR),pm=()=>xp(`keypad-empty-placeholder`,H.KEYPAD_EMPTY_PLACEHOLDER),mm=()=>xp(`keypad-button-hover`,H.KEYPAD_BUTTON_HOVER),hm=()=>xp(`keypad-button-operator-hover`,H.KEYPAD_BUTTON_OPERATOR_HOVER),cee=()=>xp(`keyboard-focus-indicator`,H.KEY_BOARD_FOCUS_INDICATOR),lee=()=>xp(`button-border`,H.BUTTON_BORDER),gm=()=>xp(`button-hover-bg`,H.BUTTON_HOVER_BG),_m={AXIS_LINE_COLOR:`#5A53C9`,ROLLOVER_FILL_BAR_COLOR:`#050F2D`,GRIDLINES_COLOR:`#8E88EA`,PLOT_FILL_COLOR:`#1463B3`,SHAPES_FILL_COLOR:`#7986cb`},vm=z(`div`)({transformOrigin:`0% 0px 0px`,width:`100%`,display:`block`,overflow:`hidden`,"&.incorrect":{color:`#946202`}}),ym=z(`div`)({WebkitFontSmoothing:`antialiased`,backgroundColor:`var(--feedback-bg-color, ${Cp()})`,borderRadius:`4px`,lineHeight:`25px`,margin:`0px`,padding:`10px`,verticalAlign:`middle`,color:`var(--feedback-color, white)`,"&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${Ep()})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${Ap()})`}}),bm=z(`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`}}),xm=class extends F.Component{static propTypes={correctness:P.string,feedback:P.string};nodeRef=F.createRef();renderFeedback(){let{correctness:e,feedback:t}=this.props;return!e||!t?null:(0,I.jsx)(Ed,{nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:`feedback`,children:(0,I.jsx)(bm,{ref:this.nodeRef,children:(0,I.jsx)(vm,{children:(0,I.jsx)(ym,{className:e,dangerouslySetInnerHTML:{__html:t}})})})},`hasFeedback`)}render(){return(0,I.jsx)(`div`,{children:(0,I.jsx)(Fd,{children:this.renderFeedback()})})}},Sm=()=>{};function Cm(){let e=function(){};return e.enabled=!1,e.log=Sm,e.extend=()=>e,e.destroy=Sm,e}Cm.log=Sm,Cm.enable=Sm,Cm.disable=()=>``,Cm.enabled=()=>!1;var uee=s({Correct:()=>Om,Incorrect:()=>km,NothingSubmitted:()=>jm,PartiallyCorrect:()=>Am}),dee=Cm(`pie-libs:render-ui:response-indicators`),wm=z(`div`)(({hasFeedback:e})=>({cursor:e?`pointer`:`default`})),Tm=z(gp)({cursor:`pointer`}),Em=z(`div`)({padding:`0`,borderRadius:`4px`}),Dm=(e,t)=>{class n extends F.Component{constructor(e){super(e),this.state={}}handlePopoverOpen=e=>{dee(`[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,I.jsxs)(wm,{hasFeedback:!!n,children:[(0,I.jsx)(`span`,{ref:e=>this.icon=e,onClick:this.handlePopoverOpen,children:(0,I.jsx)(e,{})}),n&&(0,I.jsx)(Tm,{PaperComponent:Em,open:!!r,anchorEl:r,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:this.handlePopoverClose,children:(0,I.jsx)(xm,{feedback:n,correctness:t})})]})}}return n.propTypes={feedback:P.string},n},Om=Dm(ku,`correct`),km=Dm(Iu,`incorrect`),Am=Dm(Uu,`partially-correct`),jm=Dm(Bu,`nothing-submitted`);function Mm(e){return aa(`MuiCollapse`,e)}oa(`MuiCollapse`,[`root`,`horizontal`,`vertical`,`entered`,`hidden`,`wrapper`,`wrapperInner`]);var Nm=e=>{let{orientation:t,classes:n}=e;return Oo({root:[`root`,t],entered:[`entered`],hidden:[`hidden`],wrapper:[`wrapper`,t],wrapperInner:[`wrapperInner`,t]},Mm,n)},Pm=z(`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]}})(vf(({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`}}]}))),Fm=z(`div`,{name:`MuiCollapse`,slot:`Wrapper`})({display:`flex`,width:`100%`,variants:[{props:{orientation:`horizontal`},style:{width:`auto`,height:`100%`}}]}),Im=z(`div`,{name:`MuiCollapse`,slot:`WrapperInner`})({width:`100%`,variants:[{props:{orientation:`horizontal`},style:{width:`auto`,height:`100%`}}]}),Lm=F.forwardRef(function(e,t){let n=Ju({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=ds.standard,TransitionComponent:x=Sd,...S}=n,C={...n,orientation:g,collapsedSize:o},w=Nm(C),T=Vs(),E=ad(),D=F.useRef(null),O=F.useRef(),k=typeof o==`number`?`${o}px`:o,A=g===`horizontal`,j=A?`width`:`height`,M=F.useRef(null),ee=Vd(t,M),N=()=>D.current?D.current[A?`clientWidth`:`clientHeight`]:0,te=Ld(M,(e,t)=>{D.current&&A&&(D.current.style.position=`absolute`),e.style[j]=k,u&&u(e,t)}),ne=Ld(M,(e,t)=>{let n=N();D.current&&A&&(D.current.style.position=``);let{duration:r,easing:i}=zd({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)}),re=Ld(M,(e,t)=>{e.style[j]=`auto`,d&&d(e,t)}),ie=Ld(M,e=>{e.style[j]=`${N()}px`,p&&p(e)}),ae=Ld(M,m),oe=Ld(M,e=>{let t=N(),{duration:n,easing:r}=zd({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)}),se=e=>{b===`auto`&&E.start(O.current||0,e),r&&r(M.current,e)},ce={slots:_,slotProps:v,component:s},[le,ue]=wf(`root`,{ref:ee,className:L(w.root,a),elementType:Pm,externalForwardedProps:ce,ownerState:C,additionalProps:{style:{[A?`minWidth`:`minHeight`]:k,...y}}}),[de,fe]=wf(`wrapper`,{ref:D,className:w.wrapper,elementType:Fm,externalForwardedProps:ce,ownerState:C}),[pe,me]=wf(`wrapperInner`,{className:w.wrapperInner,elementType:Im,externalForwardedProps:ce,ownerState:C});return(0,I.jsx)(x,{in:l,onEnter:te,onEntered:re,onEntering:ne,onExit:ie,onExited:ae,onExiting:oe,addEndListener:se,nodeRef:M,timeout:b===`auto`?null:b,...S,children:(e,{ownerState:t,...n})=>{let r={...C,state:e};return(0,I.jsx)(le,{...ue,className:L(ue.className,{entered:w.entered,exited:!l&&k===`0px`&&w.hidden}[e]),ownerState:r,...n,children:(0,I.jsx)(de,{...fe,ownerState:r,children:(0,I.jsx)(pe,{...me,ownerState:r,children:i})})})}})});Lm&&(Lm.muiSupportAuto=!0);var Rm=z(`span`)(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:`pointer`})),zm=z(Lm)(({theme:e})=>({paddingTop:e.spacing(2)})),Bm=class extends F.Component{static propTypes={className:P.string,children:P.object,labels:P.shape({visible:P.string,hidden:P.string})};static defaultProps={labels:{}};state={expanded:!1};toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))};componentDidMount(){Ne(this.root)}componentDidUpdate(){Ne(this.root)}render(){let{labels:e,children:t,className:n}=this.props,r=this.state.expanded?e.visible||`Hide`:e.hidden||`Show`;return(0,I.jsxs)(`div`,{className:n,ref:e=>this.root=e,children:[(0,I.jsx)(`div`,{onClick:this.toggleExpanded,children:(0,I.jsx)(Rm,{children:r})}),(0,I.jsx)(zm,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0,children:t})]})}};function Vm(e){try{return e.matches(`:focus-visible`)}catch{}return!1}var Hm=class e{static create(){return new e}static use(){let t=nd(e.create).current,[n,r]=F.useState(!1);return t.shouldMount=n,t.setShouldMount=r,F.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=Wm(),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 Um(){return Hm.use()}function Wm(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function Gm(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=F.useState(!1),f=L(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},m=L(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),F.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,I.jsx)(`span`,{className:f,style:p,children:(0,I.jsx)(`span`,{className:m})})}var Km=oa(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]),qm=550,Jm=rr`
49
+ 0% {
50
+ transform: scale(0);
51
+ opacity: 0.1;
52
+ }
53
+
54
+ 100% {
55
+ transform: scale(1);
56
+ opacity: 0.3;
57
+ }
58
+ `,Ym=rr`
59
+ 0% {
60
+ opacity: 1;
61
+ }
62
+
63
+ 100% {
64
+ opacity: 0;
65
+ }
66
+ `,Xm=rr`
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
+ `,Zm=z(`span`,{name:`MuiTouchRipple`,slot:`Root`})({overflow:`hidden`,pointerEvents:`none`,position:`absolute`,zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:`inherit`}),Qm=z(Gm,{name:`MuiTouchRipple`,slot:`Ripple`})`
79
+ opacity: 0;
80
+ position: absolute;
81
+
82
+ &.${Km.rippleVisible} {
83
+ opacity: 0.3;
84
+ transform: scale(1);
85
+ animation-name: ${Jm};
86
+ animation-duration: ${qm}ms;
87
+ animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
88
+ }
89
+
90
+ &.${Km.ripplePulsate} {
91
+ animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
92
+ }
93
+
94
+ & .${Km.child} {
95
+ opacity: 1;
96
+ display: block;
97
+ width: 100%;
98
+ height: 100%;
99
+ border-radius: 50%;
100
+ background-color: currentColor;
101
+ }
102
+
103
+ & .${Km.childLeaving} {
104
+ opacity: 0;
105
+ animation-name: ${Ym};
106
+ animation-duration: ${qm}ms;
107
+ animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
108
+ }
109
+
110
+ & .${Km.childPulsate} {
111
+ position: absolute;
112
+ /* @noflip */
113
+ left: 0px;
114
+ top: 0;
115
+ animation-name: ${Xm};
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
+ `,$m=F.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...a}=Ju({props:e,name:`MuiTouchRipple`}),[o,s]=F.useState([]),c=F.useRef(0),l=F.useRef(null);F.useEffect(()=>{l.current&&=(l.current(),null)},[o]);let u=F.useRef(!1),d=ad(),f=F.useRef(null),p=F.useRef(null),m=F.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:a,cb:o}=e;s(e=>[...e,(0,I.jsx)(Qm,{classes:{ripple:L(r.ripple,Km.ripple),rippleVisible:L(r.rippleVisible,Km.rippleVisible),ripplePulsate:L(r.ripplePulsate,Km.ripplePulsate),child:L(r.child,Km.child),childLeaving:L(r.childLeaving,Km.childLeaving),childPulsate:L(r.childPulsate,Km.childPulsate)},timeout:qm,pulsate:t,rippleX:n,rippleY:i,rippleSize:a},c.current)]),c.current+=1,l.current=o},[r]),h=F.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=F.useCallback(()=>{h({},{pulsate:!0})},[h]),_=F.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 F.useImperativeHandle(t,()=>({pulsate:g,start:h,stop:_}),[g,h,_]),(0,I.jsx)(Zm,{className:L(Km.root,r.root,i),ref:p,...a,children:(0,I.jsx)(Fd,{component:null,exit:!0,children:o})})});function eh(e){return aa(`MuiButtonBase`,e)}var th=oa(`MuiButtonBase`,[`root`,`disabled`,`focusVisible`]),nh=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,a=Oo({root:[`root`,t&&`disabled`,n&&`focusVisible`]},eh,i);return n&&r&&(a.root+=` ${r}`),a},rh=z(`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`},[`&.${th.disabled}`]:{pointerEvents:`none`,cursor:`default`},"@media print":{colorAdjust:`exact`}}),ih=F.forwardRef(function(e,t){let n=Ju({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,ee=F.useRef(null),N=Um(),te=Vd(N.ref,A),[ne,re]=F.useState(!1);c&&ne&&re(!1),F.useImperativeHandle(r,()=>({focusVisible:()=>{re(!0),ee.current.focus()}}),[]);let ie=N.shouldMount&&!l&&!c;F.useEffect(()=>{ne&&d&&!l&&N.pulsate()},[l,d,ne,N]);let ae=ah(N,`start`,S,u),oe=ah(N,`stop`,g,u),se=ah(N,`stop`,_,u),ce=ah(N,`stop`,w,u),le=ah(N,`stop`,e=>{ne&&e.preventDefault(),C&&C(e)},u),ue=ah(N,`start`,D,u),de=ah(N,`stop`,T,u),fe=ah(N,`stop`,E,u),pe=ah(N,`stop`,e=>{Vm(e.target)||re(!1),m&&m(e)},!1),me=op(e=>{ee.current||=e.currentTarget,Vm(e.target)&&(re(!0),y&&y(e)),v&&v(e)}),he=()=>{let e=ee.current;return e?e.tagName!==`BUTTON`&&!(e.tagName===`A`&&e.href):s&&s!==`button`},ge=op(e=>{d&&!e.repeat&&ne&&e.key===` `&&N.stop(e,()=>{N.start(e)}),e.target===e.currentTarget&&he()&&e.key===` `&&e.preventDefault(),b&&b(e),e.target===e.currentTarget&&he()&&e.key===`Enter`&&!c&&(e.preventDefault(),h&&h(e))}),_e=op(e=>{d&&e.key===` `&&ne&&!e.defaultPrevented&&N.stop(e,()=>{N.pulsate(e)}),x&&x(e),h&&e.target===e.currentTarget&&he()&&e.key===` `&&!e.defaultPrevented&&!c&&h(e)}),ve=s;ve===`button`&&(M.href||M.to)&&(ve=p);let ye={};if(ve===`button`){let e=!!M.formAction;ye.type=j===void 0&&!e?`button`:j,ye.disabled=c}else!M.href&&!M.to&&(ye.role=`button`),c&&(ye[`aria-disabled`]=c);let be=Vd(t,ee),xe={...n,centerRipple:i,component:s,disabled:c,disableRipple:l,disableTouchRipple:u,focusRipple:d,tabIndex:O,focusVisible:ne},Se=nh(xe);return(0,I.jsxs)(rh,{as:ve,className:L(Se.root,o),ownerState:xe,onBlur:pe,onClick:h,onContextMenu:oe,onFocus:me,onKeyDown:ge,onKeyUp:_e,onMouseDown:ae,onMouseLeave:le,onMouseUp:ce,onDragLeave:se,onTouchEnd:de,onTouchMove:fe,onTouchStart:ue,ref:be,tabIndex:c?-1:O,type:j,...ye,...M,children:[a,ie?(0,I.jsx)($m,{ref:te,center:i,...k}):null]})});function ah(e,t,n,r=!1){return op(i=>(n&&n(i),r||e[t](i),!0))}function oh(e){return typeof e.main==`string`}function sh(e,t=[]){if(!oh(e))return!1;for(let n of t)if(!e.hasOwnProperty(n)||typeof e[n]!=`string`)return!1;return!0}function ch(e=[]){return([,t])=>t&&sh(t,e)}function lh(e){return aa(`MuiCircularProgress`,e)}oa(`MuiCircularProgress`,[`root`,`determinate`,`indeterminate`,`colorPrimary`,`colorSecondary`,`svg`,`track`,`circle`,`circleDeterminate`,`circleIndeterminate`,`circleDisableShrink`]);var uh=44,dh=rr`
122
+ 0% {
123
+ transform: rotate(0deg);
124
+ }
125
+
126
+ 100% {
127
+ transform: rotate(360deg);
128
+ }
129
+ `,fh=rr`
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
+ `,ph=typeof dh==`string`?null:nr`
145
+ animation: ${dh} 1.4s linear infinite;
146
+ `,mh=typeof fh==`string`?null:nr`
147
+ animation: ${fh} 1.4s ease-in-out infinite;
148
+ `,hh=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e;return Oo({root:[`root`,n,`color${V(r)}`],svg:[`svg`],track:[`track`],circle:[`circle`,`circle${V(n)}`,i&&`circleDisableShrink`]},lh,t)},gh=z(`span`,{name:`MuiCircularProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${V(n.color)}`]]}})(vf(({theme:e})=>({display:`inline-block`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`transform`)}},{props:{variant:`indeterminate`},style:ph||{animation:`${dh} 1.4s linear infinite`}},...Object.entries(e.palette).filter(ch()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),_h=z(`svg`,{name:`MuiCircularProgress`,slot:`Svg`})({display:`block`}),vh=z(`circle`,{name:`MuiCircularProgress`,slot:`Circle`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,t[`circle${V(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(vf(({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:mh||{animation:`${fh} 1.4s ease-in-out infinite`}}]}))),yh=z(`circle`,{name:`MuiCircularProgress`,slot:`Track`})(vf(({theme:e})=>({stroke:`currentColor`,opacity:(e.vars||e).palette.action.activatedOpacity}))),bh=F.forwardRef(function(e,t){let n=Ju({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=hh(p),h={},g={},_={};if(d===`determinate`){let e=2*Math.PI*((uh-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,I.jsx)(gh,{className:L(m.root,r),style:{width:s,height:s,...g,...c},ownerState:p,ref:t,role:`progressbar`,..._,...f,children:(0,I.jsxs)(_h,{className:m.svg,ownerState:p,viewBox:`${uh/2} ${uh/2} ${uh} ${uh}`,children:[o?(0,I.jsx)(yh,{className:m.track,ownerState:p,cx:uh,cy:uh,r:(uh-l)/2,fill:`none`,strokeWidth:l,"aria-hidden":`true`}):null,(0,I.jsx)(vh,{className:m.circle,style:h,ownerState:p,cx:uh,cy:uh,r:(uh-l)/2,fill:`none`,strokeWidth:l})]})})});function xh(e){return aa(`MuiButton`,e)}var Sh=oa(`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(`.`)),Ch=F.createContext({}),wh=F.createContext(void 0),Th=e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:a,loading:o,loadingPosition:s,classes:c}=e,l=Oo({root:[`root`,o&&`loading`,a,`${a}${V(t)}`,`size${V(i)}`,`${a}Size${V(i)}`,`color${V(t)}`,n&&`disableElevation`,r&&`fullWidth`,o&&`loadingPosition${V(s)}`],startIcon:[`icon`,`startIcon`,`iconSize${V(i)}`],endIcon:[`icon`,`endIcon`,`iconSize${V(i)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},xh,c);return{...c,...l}},Eh=[{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}}}],Dh=z(ih,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${V(n.color)}`],t[`size${V(n.size)}`],t[`${n.variant}Size${V(n.size)}`],n.color===`inherit`&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(vf(({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`},[`&.${Sh.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]},[`&.${Sh.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Sh.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)`,[`&.${Sh.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(ch()).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`},[`&.${Sh.focusVisible}`]:{boxShadow:`none`},"&:active":{boxShadow:`none`},[`&.${Sh.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}),[`&.${Sh.loading}`]:{color:`transparent`}}}]}})),Oh=z(`span`,{name:`MuiButton`,slot:`StartIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${V(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}},...Eh]})),kh=z(`span`,{name:`MuiButton`,slot:`EndIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${V(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}},...Eh]})),Ah=z(`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}}]})),jh=z(`span`,{name:`MuiButton`,slot:`LoadingIconPlaceholder`})({display:`inline-block`,width:`1em`,height:`1em`}),Mh=F.forwardRef(function(e,t){let n=F.useContext(Ch),r=F.useContext(wh),i=Ju({props:ya(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=rp(h),T=_??(0,I.jsx)(bh,{"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=Th(E),O=(b||g&&v===`start`)&&(0,I.jsx)(Oh,{className:D.startIcon,ownerState:E,children:b||(0,I.jsx)(jh,{className:D.loadingIconPlaceholder,ownerState:E})}),k=(f||g&&v===`end`)&&(0,I.jsx)(kh,{className:D.endIcon,ownerState:E,children:f||(0,I.jsx)(jh,{className:D.loadingIconPlaceholder,ownerState:E})}),A=r||``,j=typeof g==`boolean`?(0,I.jsx)(`span`,{className:D.loadingWrapper,style:{display:`contents`},children:g&&(0,I.jsx)(Ah,{className:D.loadingIndicator,ownerState:E,children:T})}):null,{root:M,...ee}=D;return(0,I.jsxs)(Dh,{ownerState:E,className:L(n.className,D.root,c,A),component:s,disabled:l||g,focusRipple:!d,focusVisibleClassName:L(D.focusVisible,p),ref:t,type:x,id:g?w:h,...C,classes:ee,children:[O,v!==`end`&&j,a,v===`end`&&j,k]})}),Nh=ep((0,I.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`),Ph=ep((0,I.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`),Fh=z(`div`)({display:`flex`,flexDirection:`column`}),Ih=z(`div`)({display:`flex`,alignItems:`center`,justifyContent:`center`}),Lh=z(`div`)(({theme:e})=>({width:`24px`,height:`24px`,color:`gray`,marginRight:e.spacing(1),display:`flex`,alignItems:`center`})),Rh=z(Mh)(({theme:e})=>({display:`flex`,alignItems:`center`,marginLeft:e.spacing(3),marginRight:e.spacing(3)})),zh=e=>{class t extends F.Component{static propTypes={session:P.object,onSessionChange:P.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,I.jsxs)(Fh,{children:[(0,I.jsxs)(Ih,{children:[(0,I.jsxs)(Rh,{color:`primary`,disabled:n.length===0,onClick:this.onUndo,children:[(0,I.jsx)(Lh,{children:(0,I.jsx)(Ph,{})}),`Undo`]}),(0,I.jsxs)(Rh,{color:`primary`,disabled:n.length===0,onClick:this.onReset,children:[(0,I.jsx)(Lh,{children:(0,I.jsx)(Nh,{})}),`Start Over`]})]}),(0,I.jsx)(e,{...t,session:r,onSessionChange:this.onSessionChange})]})}}return t},Bh=zs({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`}}}}}}),Vh=z(`div`)({"& table, th, td":{fontSize:`inherit`}}),Hh=class extends F.Component{static propTypes={className:P.string,children:P.array,extraCSSRules:P.shape({names:P.arrayOf(P.string),rules:P.string}),fontSizeFactor:P.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,I.jsx)(yr,{injectFirst:!0,children:(0,I.jsxs)(Xs,{theme:Bh,children:[i?.rules?(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${i.rules} }`}}):null,(0,I.jsx)(Vh,{className:`${t} extraCSSRules`,...a,...o&&{style:o},children:e})]})})}},Uh=z(Hh)({display:`flex`,flexDirection:`column`,position:`relative`}),Wh=class extends F.Component{static propTypes={ariaLabel:P.string,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,role:P.string,extraCSSRules:P.shape({names:P.arrayOf(P.string),rules:P.string}),fontSizeFactor:P.number};render(){let{children:e,ariaLabel:t,role:n,extraCSSRules:r,fontSizeFactor:i,classes:a}=this.props;return(0,I.jsx)(Uh,{...t?{"aria-label":t,role:n}:{},extraCSSRules:r,fontSizeFactor:i,classes:a,children:e})}},Gh=class extends F.Component{static propTypes={tag:P.string,className:P.string,html:P.string};static defaultProps={tag:`div`,html:``};render(){let{tag:e,className:t,html:n}=this.props;return(0,I.jsx)(e||`div`,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}};function Kh({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 qh=F.createContext(void 0);function Jh(){return F.useContext(qh)}function Yh(e){return aa(`MuiFormLabel`,e)}var Xh=oa(`MuiFormLabel`,[`root`,`colorSecondary`,`focused`,`disabled`,`error`,`filled`,`required`,`asterisk`]),Zh=e=>{let{classes:t,color:n,focused:r,disabled:i,error:a,filled:o,required:s}=e;return Oo({root:[`root`,`color${V(n)}`,i&&`disabled`,a&&`error`,o&&`filled`,r&&`focused`,s&&`required`],asterisk:[`asterisk`,a&&`error`]},Yh,t)},Qh=z(`label`,{name:`MuiFormLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color===`secondary`&&t.colorSecondary,n.filled&&t.filled]}})(vf(({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(ch()).map(([t])=>({props:{color:t},style:{[`&.${Xh.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${Xh.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Xh.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),$h=z(`span`,{name:`MuiFormLabel`,slot:`Asterisk`})(vf(({theme:e})=>({[`&.${Xh.error}`]:{color:(e.vars||e).palette.error.main}}))),eg=F.forwardRef(function(e,t){let n=Ju({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=Kh({props:n,muiFormControl:Jh(),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=Zh(m);return(0,I.jsxs)(Qh,{as:o,ownerState:m,className:L(h.root,i),ref:t,...f,children:[r,p.required&&(0,I.jsxs)($h,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[` `,`*`]})]})});function tg(e){return aa(`MuiInputLabel`,e)}oa(`MuiInputLabel`,[`root`,`focused`,`disabled`,`error`,`required`,`asterisk`,`formControl`,`sizeSmall`,`shrink`,`animated`,`standard`,`filled`,`outlined`]);var ng=e=>{let{classes:t,formControl:n,size:r,shrink:i,disableAnimation:a,variant:o,required:s}=e,c=Oo({root:[`root`,n&&`formControl`,!a&&`animated`,i&&`shrink`,r&&r!==`medium`&&`size${V(r)}`,o],asterisk:[s&&`asterisk`]},tg,t);return{...t,...c}},rg=z(eg,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiInputLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${Xh.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]]}})(vf(({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)`}}]}))),ig=F.forwardRef(function(e,t){let n=Ju({name:`MuiInputLabel`,props:e}),{disableAnimation:r=!1,margin:i,shrink:a,variant:o,className:s,...c}=n,l=Jh(),u=a;u===void 0&&l&&(u=l.filled||l.focused||l.adornedStart);let d=Kh({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=ng(f);return(0,I.jsx)(rg,{"data-shrink":u,ref:t,className:L(p.root,s),...c,ownerState:f,classes:p})});function ag(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function og(e,t=!1){return e&&(ag(e.value)&&e.value!==``||t&&ag(e.defaultValue)&&e.defaultValue!==``)}function sg(e){return e.startAdornment}function cg(e){return aa(`MuiFormControl`,e)}oa(`MuiFormControl`,[`root`,`marginNone`,`marginNormal`,`marginDense`,`fullWidth`,`disabled`]);var lg=e=>{let{classes:t,margin:n,fullWidth:r}=e;return Oo({root:[`root`,n!==`none`&&`margin${V(n)}`,r&&`fullWidth`]},cg,t)},ug=z(`div`,{name:`MuiFormControl`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`margin${V(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%`}}]}),dg=F.forwardRef(function(e,t){let n=Ju({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=lg(_),[y,b]=F.useState(()=>{let e=!1;return r&&F.Children.forEach(r,t=>{if(!tp(t,[`Input`,`Select`]))return;let n=tp(t,[`Select`])?t.props.input:t;n&&sg(n.props)&&(e=!0)}),e}),[x,S]=F.useState(()=>{let e=!1;return r&&F.Children.forEach(r,t=>{tp(t,[`Input`,`Select`])&&(og(t.props,!0)||og(t.props.inputProps,!0))&&(e=!0)}),e}),[C,w]=F.useState(!1);s&&C&&w(!1);let T=l!==void 0&&!s?l:C;F.useRef(!1);let E=F.useCallback(()=>{S(!0)},[]),D=F.useCallback(()=>{S(!1)},[]),O=F.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,I.jsx)(qh.Provider,{value:O,children:(0,I.jsx)(ug,{as:o,ownerState:_,className:L(v.root,i),ref:t,...g,children:r})})}),fg=z(dg)(({theme:e})=>({margin:0,padding:0,flex:`1 0 auto`,minWidth:e.spacing(4)})),pg=z(ig)(()=>({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)`}})),mg=({label:e,className:t,children:n})=>(0,I.jsxs)(fg,{className:t,children:[(0,I.jsx)(pg,{shrink:!0,children:e}),n]});mg.propTypes={label:P.oneOfType([P.string,P.object]).isRequired,className:P.string,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired};var hg=z(`div`)(({theme:e,tagName:t})=>({'&:not(.MathJax) > table:not([role="presentation"])':{borderCollapse:`collapse`},'&:not(.MathJax) table[border]:not([role="presentation"]), &:not(.MathJax) table[border]:not([role="presentation"]) td, &:not(.MathJax) table[border]:not([role="presentation"]) th':{borderStyle:`solid`,borderColor:tm()},'&: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:rm()},'&:not(.MathJax) > table:not([role="presentation"]):has(tbody tr > td:first-child) tbody tr:nth-child(even) td':{backgroundColor:rm()},'&: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:Sp()},"&.legend":{width:`100%`,fontSize:`inherit !important`},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${Sp()} !important`,display:`flex`,flexDirection:`column`,verticalAlign:`middle`,cursor:`pointer`,"& > p":{margin:`0 0 0 0 !important`}}})),gg=/\\embed\{newLine\}\[\]/g,_g=`\\newline `,vg=`preview-prompt`,yg=class extends F.Component{static propTypes={prompt:P.string,tagName:P.string,className:P.string,onClick:P.func,defaultClassName:P.string,autoplayAudioEnabled:P.bool,customAudioButton:P.shape({playImage:P.string,pauseImage:P.string})};static defaultProps={onClick:()=>{}};promptRef=F.createRef();parsedText=e=>{let{autoplayAudioEnabled:t,customAudioButton:n}=this.props,r=document.createElement(`div`);r.innerHTML=e;let i=r.querySelector(`audio`);if(i){let e=document.createElement(`source`);if(e.setAttribute(`type`,`audio/mp3`),e.setAttribute(`src`,i.getAttribute(`src`)),i.removeAttribute(`src`),i.setAttribute(`id`,`pie-prompt-audio-player`),i.appendChild(e),n){i.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?n.pauseImage:n.playImage})`,backgroundSize:`cover`,borderRadius:`50%`,border:`1px solid #326295`}),i.parentNode.insertBefore(e,i)}}return r.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=>{n&&t&&(n.style.backgroundImage=`url(${t.playImage})`),console.error(`Error playing audio`,e)}),!n||!r||!t)return;let i=()=>{r.paused&&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=this.promptRef.current;e&&typeof Ne==`function`&&Ne(e)}alignImages(){let e=this.promptRef.current;if(!e)return;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`:``} ${vg}`.trim();return(0,I.jsx)(hg,{as:t||`div`,ref:this.promptRef,onClick:r,className:a,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||``).replace(gg,_g)}})}},bg=e=>(0,I.jsx)(I.Fragment,{children:F.Children.map(e.children,t=>F.cloneElement(t,{"data-pie-readable":e.false===void 0}))});bg.propTypes={children:P.node,false:P.bool};var xg=e=>(0,I.jsx)(I.Fragment,{children:F.Children.map(e.children,t=>F.cloneElement(t,{"data-pie-purpose":e.purpose}))});xg.propTypes={children:P.node,purpose:P.string};var Sg;typeof window<`u`&&(Sg=new DOMParser);var Cg=e=>Sg.parseFromString(e,`text/html`).body.textContent,wg=e=>{if(!e)return!1;let t=Cg(e);return!!(t&&t.trim())},Tg;typeof window<`u`&&(Tg=new DOMParser);var Eg=e=>{if(!e)return!1;let t=Tg.parseFromString(e,`text/html`);return!!t.body.querySelector(`img`)||!!t.body.querySelector(`video`)||!!t.body.querySelector(`audio`)},Dg=`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 Og(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 kg(e){let{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:bf(n,r),{props:s,internalRef:c}=Cf({...a,externalSlotProps:o}),l=Bd(c,o?.ref,e.additionalProps?.ref);return yf(t,{...s,ref:l},r)}var Ag=F.createContext({});function jg(e){return aa(`MuiList`,e)}oa(`MuiList`,[`root`,`padding`,`dense`,`subheader`]);var Mg=e=>{let{classes:t,disablePadding:n,dense:r,subheader:i}=e;return Oo({root:[`root`,!n&&`padding`,r&&`dense`,i&&`subheader`]},jg,t)},Ng=z(`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}}]}),Pg=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiList`}),{children:r,className:i,component:a=`ul`,dense:o=!1,disablePadding:s=!1,subheader:c,...l}=n,u=F.useMemo(()=>({dense:o}),[o]),d={...n,component:a,dense:o,disablePadding:s},f=Mg(d);return(0,I.jsx)(Ag.Provider,{value:u,children:(0,I.jsxs)(Ng,{as:a,className:L(f.root,i),ref:t,ownerState:d,...l,children:[c,r]})})}),Fg=Kd;function Ig(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Lg(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function Rg(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 zg(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`)||!Rg(s,a)||t)s=i(e,s,n);else return s.focus(),!0}return!1}var Bg=F.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=F.useRef(null),p=F.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});np(()=>{r&&f.current.focus()},[r]),F.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{let n=!f.current.style.width;if(e.clientHeight<f.current.clientHeight&&n){let n=`${Fg(ed(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=af(Qu(t));if(n===`ArrowDown`)e.preventDefault(),zg(t,r,c,s,Ig);else if(n===`ArrowUp`)e.preventDefault(),zg(t,r,c,s,Lg);else if(n===`Home`)e.preventDefault(),zg(t,null,c,s,Ig);else if(n===`End`)e.preventDefault(),zg(t,null,c,s,Lg);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&&Rg(r,i);i.previousKeyMatched&&(c||zg(t,r,!1,s,Ig,i))?e.preventDefault():i.previousKeyMatched=!1}l&&l(e)},h=Vd(f,t),g=-1;F.Children.forEach(a,(e,t)=>{if(!F.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 _=F.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),F.cloneElement(e,t)}return e});return(0,I.jsx)(Pg,{role:`menu`,ref:h,className:o,onKeyDown:m,tabIndex:r?0:-1,...d,children:_})});function Vg(e){return aa(`MuiMenu`,e)}oa(`MuiMenu`,[`root`,`paper`,`list`]);var Hg={vertical:`top`,horizontal:`right`},Ug={vertical:`top`,horizontal:`left`},Wg=e=>{let{classes:t}=e;return Oo({root:[`root`],paper:[`paper`],list:[`list`]},Vg,t)},Gg=z(gp,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiMenu`,slot:`Root`})({}),Kg=z(hp,{name:`MuiMenu`,slot:`Paper`})({maxHeight:`calc(100% - 96px)`,WebkitOverflowScrolling:`touch`}),qg=z(Bg,{name:`MuiMenu`,slot:`List`})({outline:0}),Jg=F.forwardRef(function(e,t){let n=Ju({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=Ka(),b={...n,autoFocus:r,disableAutoFocusItem:o,MenuListProps:s,onEntering:p,PaperProps:u,transitionDuration:f,TransitionProps:m,variant:h},x=Wg(b),S=r&&!o&&l,C=F.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;F.Children.map(i,(e,t)=>{F.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=kg({elementType:g.root,externalSlotProps:_.root,ownerState:b,className:[x.root,a]}),[k,A]=wf(`paper`,{className:x.paper,elementType:Kg,externalForwardedProps:D,shouldForwardComponentProp:!0,ownerState:b}),[j,M]=wf(`list`,{className:L(x.list,s.className),elementType:qg,shouldForwardComponentProp:!0,externalForwardedProps:D,getSlotProps:e=>({...e,onKeyDown:t=>{T(t),e.onKeyDown?.(t)}}),ownerState:b}),ee=typeof D.slotProps.transition==`function`?D.slotProps.transition(b):D.slotProps.transition;return(0,I.jsx)(Gg,{onClose:c,anchorOrigin:{vertical:`bottom`,horizontal:y?`right`:`left`},transformOrigin:y?Hg:Ug,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:{...ee,onEntering:(...e)=>{w(...e),ee?.onEntering?.(...e)}}},open:l,ref:t,transitionDuration:f,ownerState:b,...v,classes:d,children:(0,I.jsx)(j,{actions:C,autoFocus:r&&(E===-1||o),autoFocusItem:S,variant:h,...M,children:i})})}),Yg=({slotProps:e,...t})=>(0,I.jsx)(Jg,{...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}}}}),Xg=s({Collapsible:()=>Bm,EnableAudioAutoplayImage:()=>Dg,Feedback:()=>xm,HtmlAndMath:()=>Gh,InlineMenu:()=>Yg,InputContainer:()=>mg,PreviewLayout:()=>Wh,PreviewPrompt:()=>yg,Purpose:()=>xg,Readable:()=>bg,UiLayout:()=>Hh,color:()=>yp,hasMedia:()=>Eg,hasText:()=>wg,indicators:()=>uee,transformDataHeadings:()=>Og,withUndoReset:()=>zh}),Zg=o((e=>{var t=d();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 f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Qg=o(((e,t)=>{t.exports=Zg()})),$g=Object.defineProperty,e_=(e,t)=>{let n={};for(var r in e)$g(n,r,{get:e[r],enumerable:!0});return t||$g(n,Symbol.toStringTag,{value:`Module`}),n};function t_(e){this.content=e}t_.prototype={constructor:t_,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 t_(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 t_(n)},addToStart:function(e,t){return new t_([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new t_(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 t_(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=t_.from(e),e.size?new t_(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=t_.from(e),e.size?new t_(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=t_.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}},t_.from=function(e){if(e instanceof t_)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new t_(t)};function n_(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){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&a_(e.charCodeAt(r-1))&&i_(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=n_(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function r_(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=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&a_(e.charCodeAt(i-1))&&i_(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=r_(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function i_(e){return e>=56320&&e<57344}function a_(e){return e>=55296&&e<56320}var U=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 n_(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return r_(this,e,t,n)}findIndex(e){if(e==0)return s_(0,e);if(e==this.size)return s_(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?s_(t+1,i):s_(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 e.fromArray(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)`:``))}};U.empty=new U([],0);var o_={index:0,offset:0};function s_(e,t){return o_.index=e,o_.offset=t,o_}function c_(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(!c_(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!c_(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var l_=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&&c_(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`);return n.create(t.attrs)}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}};l_.none=[];var u_=class extends Error{},W=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=f_(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(d_(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(U.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)}};W.empty=new W(U.empty,0,0);function d_(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(d_(a.content,t-i-1,n-i-1)))}function f_(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=f_(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function p_(e,t,n){if(n.openStart>e.depth)throw new u_(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new u_(`Inconsistent open depths`);return m_(e,t,n,0)}function m_(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=m_(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return y_(a,x_(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return y_(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=S_(n,e);return y_(a,b_(e,i,o,t,r))}}function h_(e,t){if(!t.type.compatibleContent(e.type))throw new u_(`Cannot join `+t.type.name+` onto `+e.type.name)}function g_(e,t,n){let r=e.node(n);return h_(r,t.node(n)),r}function __(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 v_(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&&(__(e.nodeAfter,r),a++));for(let e=a;e<o;e++)__(i.child(e),r);t&&t.depth==n&&t.textOffset&&__(t.nodeBefore,r)}function y_(e,t){if(!e.type.validContent(t))throw new u_(`Invalid content for node `+e.type.name);return e.copy(t)}function b_(e,t,n,r,i){let a=e.depth>i&&g_(e,t,i+1),o=r.depth>i&&g_(n,r,i+1),s=[];return v_(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(h_(a,o),__(y_(a,b_(e,t,n,r,i+1)),s)):(a&&__(y_(a,x_(e,t,i+1)),s),v_(t,n,i,s),o&&__(y_(o,x_(n,r,i+1)),s)),v_(r,null,i,s),new U(s)}function x_(e,t,n){let r=[];return v_(null,e,n,r),e.depth>n&&__(y_(g_(e,t,n+1),x_(e,t,n+1)),r),v_(t,null,n,r),new U(r)}function S_(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(U.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var C_=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 l_.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 D_(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=E_.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 E_.set(t,r=new w_);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%T_,i}},w_=class{constructor(){this.elts=[],this.i=0}},T_=12,E_=new WeakMap,D_=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)}},O_=Object.create(null),k_=class e{constructor(e,t,n,r=l_.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||U.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&&c_(this.attrs,t||e.defaultAttrs||O_)&&l_.sameSet(this.marks,n||l_.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 W.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new W(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return p_(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 C_.resolveCached(this,e)}resolveNoCache(e){return C_.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()+`)`),A_(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=U.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),j_(this.type.attrs,this.attrs,`node`,this.type.name);let e=l_.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];j_(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!l_.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=U.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};k_.prototype.text=void 0;var fee=class e extends k_{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):A_(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 A_(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function j_(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var M_=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new pee(t,n);if(r.next==null)return e.empty;let i=N_(r);r.next&&r.err(`Unexpected trailing text`);let a=L_(yee(i));return R_(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 U.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
+ `)}};M_.empty=new M_(!0);var pee=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 N_(e){let t=[];do t.push(mee(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function mee(e){let t=[];do t.push(hee(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function hee(e){let t=vee(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=gee(e,t);else break;return t}function P_(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function gee(e,t){let n=P_(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:P_(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function _ee(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 vee(e){if(e.eat(`(`)){let t=N_(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=_ee(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 yee(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 F_(e,t){return t-e}function I_(e,t){let n=[];return r(t),n.sort(F_);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 L_(e){let t=Object.create(null);return n(I_(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]);I_(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new M_(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(F_);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function R_(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 z_(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 B_(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0)if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r);else i.validate&&i.validate(a);n[r]=a}return n}function V_(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new W_(e,r,t[r]);return n}var H_=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=V_(e,n.attrs),this.defaultAttrs=z_(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==M_.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:B_(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new k_(this,this.computeAttrs(e),U.from(t),l_.setFrom(n))}createChecked(e=null,t,n){return t=U.from(t),this.checkContent(t),new k_(this,this.computeAttrs(e),t,l_.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=U.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(U.empty,!0);return i?new k_(this,e,t.append(i),l_.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){}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:l_.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 U_(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 W_=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?U_(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},G_=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=V_(e,r.attrs),this.excluded=null;let i=z_(this.attrs);this.instance=i?new l_(this,i):null}create(e=null){return!e&&this.instance?this.instance:new l_(this,B_(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]}excludes(e){return this.excluded.indexOf(e)>-1}},K_=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=t_.from(e.nodes),t.marks=t_.from(e.marks||{}),this.nodes=H_.compile(this.spec.nodes,this),this.marks=G_.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]=M_.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?q_(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==``?[]:q_(this,n.split(` `))}this.nodeFromJSON=e=>k_.fromJSON(this,e),this.markFromJSON=e=>l_.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 H_))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 fee(n,n.defaultAttrs,e,l_.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 q_(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 J_(e){return e.tag!=null}function Y_(e){return e.style!=null}var X_=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(J_(e))this.tags.push(e);else if(Y_(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 av(this,t,!1);return n.addAll(e,l_.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new av(this,t,!0);return n.addAll(e,l_.none,t.from,t.to),W.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(sv(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=cv(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=cv(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)))}},Z_={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Q_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},$_={ol:!0,ul:!0},ev=1,tv=2,nv=4;function rv(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?ev:0)|(t===`full`?tv:0)}var iv=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=l_.none,this.match=i||(a&nv?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(U.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&ev)){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=U.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(U.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&&!Z_.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},av=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=rv(null,t.preserveWhitespace,0)|(n?nv:0);i=r?new iv(r.type,r.attrs,l_.none,!0,t.topMatch||r.type.contentMatch,a):n?new iv(null,null,l_.none,!0,null,a):new iv(e.schema.topNodeType,null,l_.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&tv?`full`:this.localPreserveWS||(r.options&ev)>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;$_.hasOwnProperty(a)&&this.parser.normalizeLists&&ov(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Q_.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(Z_.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=l_.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):lv(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=rv(e,i,a.options);a.options&nv&&a.content.length==0&&(o|=nv);let s=l_.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):lv(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new iv(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|=ev);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 ov(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&$_.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function sv(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function cv(e){let t={};for(let n in e)t[n]=e[n];return t}function lv(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 uv=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=fv(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){if(e.isText)return fv(t).createTextNode(e.text);let{dom:n,contentDOM:r}=gv(fv(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&&gv(fv(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:gv(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=dv(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return dv(e.marks)}};function dv(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function fv(e){return e.document||window.document}var pv=new WeakMap;function mv(e){let t=pv.get(e);return t===void 0&&pv.set(e,t=hv(e)),t}function hv(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 gv(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=mv(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 if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=gv(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var _v=65535,vv=2**16;function yv(e,t){return e+t*vv}function bv(e){return e&_v}function xv(e){return(e-(e&_v))/vv}var Sv=1,Cv=2,wv=4,Tv=8,Ev=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Tv)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&wv)>0}},Dv=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=bv(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+xv(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:yv(o/3,e-s),f=0;return c&&(f|=e==s?Cv:e==u?Sv:wv,(t<0?e!=s:e!=u)&&(f|=Tv)),new Ev(a,f,d)}r+=l-c}return n?e+r:new Ev(e+r,0,null)}touches(e,t){let n=0,r=bv(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])}};Dv.empty=new Dv([]);var Ov=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 Ev(e,r,null)}},kv=Object.create(null),Av=class{getMap(){return Dv.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=kv[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in kv)throw RangeError(`Duplicate use of step JSON ID `+e);return kv[e]=t,t.prototype.jsonID=e,t}},jv=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 u_)return e.fail(t.message);throw t}}};function Mv(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Mv(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return U.fromArray(r)}var Nv=class e extends Av{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 W(Mv(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 jv.fromReplace(e,this.from,this.to,i)}invert(){return new Pv(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))}};Av.jsonID(`addMark`,Nv);var Pv=class e extends Av{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 W(Mv(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return jv.fromReplace(e,this.from,this.to,n)}invert(){return new Nv(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))}};Av.jsonID(`removeMark`,Pv);var Fv=class e extends Av{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return jv.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return jv.fromReplace(e,this.pos,this.pos+1,new W(U.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 Iv(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))}};Av.jsonID(`addNodeMark`,Fv);var Iv=class e extends Av{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return jv.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return jv.fromReplace(e,this.pos,this.pos+1,new W(U.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Fv(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))}};Av.jsonID(`removeNodeMark`,Iv);var Lv=class e extends Av{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&zv(e,this.from,this.to)?jv.fail(`Structure replace would overwrite content`):jv.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Dv([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?W.empty:new W(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?W.empty:new W(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,W.fromJSON(t,n.slice),!!n.structure)}};Lv.MAP_BIAS=1,Av.jsonID(`replace`,Lv);var Rv=class e extends Av{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&&(zv(e,this.from,this.gapFrom)||zv(e,this.gapTo,this.to)))return jv.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return jv.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?jv.fromReplace(e,this.from,this.to,n):jv.fail(`Content does not fit in gap`)}getMap(){return new Dv([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,W.fromJSON(t,n.slice),n.insert,!!n.structure)}};Av.jsonID(`replaceAround`,Rv);function zv(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 Bv(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 Pv(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Nv(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Vv(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 G_){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 Pv(t.from,t.to,t.style)))}function Hv(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 Lv(s,l,W.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Pv(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 W(U.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Lv(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(U.empty,!0);e.replace(s,s,new W(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Uv(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Wv(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||!Uv(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Gv(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=U.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=U.from(r.node(e).copy(u)),d++):c--;let f=U.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=U.from(i.node(e).copy(f)),p++):l++;e.step(new Rv(c,l,o,s,new W(u.append(f),d,p),u.size-d,!0))}function Kv(e,t,n=null,r=e){let i=Jv(e,t),a=i&&Yv(r,t);return a?i.map(qv).concat({type:t,attrs:n}).concat(a.map(qv)):null}function qv(e){return{type:e,attrs:null}}function Jv(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 Yv(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 Xv(e,t,n){let r=U.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=U.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Rv(i,a,i,a,new W(r,0,0),n.length,!0))}function Zv(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)&&ey(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&&$v(e,t,n,a),Hv(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 Rv(c,l,c+1,l-1,new W(U.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Qv(e,t,n,a),!1}})}function Qv(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 $v(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 ey(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function ty(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 Rv(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new W(U.from(o),0,0),1,!0))}function ny(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 ry(e,t,n=1,r){let i=e.doc.resolve(t),a=U.empty,o=U.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=U.from(i.node(e).copy(a));let t=r&&r[s];o=U.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Lv(t,t,new W(a.append(o),n,n),!0))}function iy(e,t){let n=e.resolve(t),r=n.index();return oy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ay(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 oy(e,t){return!!(e&&t&&!e.isLeaf&&ay(e,t))}function sy(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&&oy(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 cy(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);$v(e,r.node(),r.before(),s)}o.inlineContent&&Hv(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 Lv(l,c.map(t+n,-1),W.empty,!0)),r===!0){let t=e.doc.resolve(l);Qv(e,t.node(),t.before(),e.steps.length)}return e}function ly(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 uy(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 dy(e,t,n=t,r=W.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return fy(i,a,r)?new Lv(t,n,r):new py(i,a,r).fit()}function fy(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var py=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=U.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=U.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 W(i,a,o);return e>-1?new Rv(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Lv(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=gy(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(U.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;return xy(e,-1)<=t?!1:(this.unplaced.size>1&&xy(e,1)>n&&n++,this.unplaced=new W(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=gy(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new W(my(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new W(my(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(_y(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=hy(this.placed,t,U.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?W.empty:new W(my(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new W(my(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||!vy(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=vy(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=vy(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=hy(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=hy(this.placed,this.depth,U.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(U.empty,!0);e.childCount&&(this.placed=hy(this.placed,this.frontier.length,e))}};function my(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(my(e.firstChild.content,t-1,n)))}function hy(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(hy(e.lastChild.content,t-1,n)))}function gy(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function _y(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,_y(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(U.empty,!0)))),e.copy(r)}function vy(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&&!yy(n,a.content,o)?s:null}function yy(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function by(e){return e.spec.defining||e.spec.definingForContent}function xy(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function Sy(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(fy(i,a,r))return e.step(new Lv(t,n,r));let o=Ey(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=by(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 W(Cy(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 Cy(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Cy(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(U.empty,!0))}return e}function wy(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=ly(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new W(U.from(r),0,0))}function Ty(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=Ey(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 Ey(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 Dy=class e extends Av{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 jv.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 jv.fromReplace(e,this.pos,this.pos+1,new W(U.from(r),0,+!t.isLeaf))}getMap(){return Dv.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)}};Av.jsonID(`attr`,Dy);var Oy=class e extends Av{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 jv.ok(n)}getMap(){return Dv.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)}};Av.jsonID(`docAttr`,Oy);var ky=class extends Error{};ky=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},ky.prototype=Object.create(Error.prototype),ky.prototype.constructor=ky,ky.prototype.name=`TransformError`;var Ay=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ov}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new ky(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=W.empty){let r=dy(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new W(U.from(n),0,0))}delete(e,t){return this.replace(e,t,W.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Sy(this,e,t,n),this}replaceRangeWith(e,t,n){return wy(this,e,t,n),this}deleteRange(e,t){return Ty(this,e,t),this}lift(e,t){return Gv(this,e,t),this}join(e,t=1){return cy(this,e,t),this}wrap(e,t){return Xv(this,e,t),this}setBlockType(e,t=e,n,r=null){return Zv(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return ty(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Dy(e,t,n)),this}setDocAttribute(e,t){return this.step(new Oy(e,t)),this}addNodeMark(e,t){return this.step(new Fv(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof l_)t.isInSet(n.marks)&&this.step(new Iv(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Iv(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 ry(this,e,t,n),this}addMark(e,t,n){return Bv(this,e,t,n),this}removeMark(e,t,n){return Vv(this,e,t,n),this}clearIncompatible(e,t,n){return Hv(this,e,t,n),this}},jy=Object.create(null),My=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Ny(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=W.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?W.empty:t),o==0&&Uy(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),Uy(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Iy(e):Hy(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?Hy(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Hy(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 By(e.node(0))}static atStart(e){return Hy(e,e,0,0,1)||new By(e)}static atEnd(e){return Hy(e,e,e.content.size,e.childCount,-1)||new By(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=jy[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in jy)throw RangeError(`Duplicate use of selection JSON ID `+e);return jy[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Iy.between(this.$anchor,this.$head).getBookmark()}};My.prototype.visible=!0;var Ny=class{constructor(e,t){this.$from=e,this.$to=t}},Py=!1;function Fy(e){!Py&&!e.parent.inlineContent&&(Py=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var Iy=class e extends My{constructor(e,t=e){Fy(e),Fy(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 My.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=W.empty){if(super.replace(e,t),t==W.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 Ly(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=My.findFrom(n,r,!0)||My.findFrom(n,-r,!0);if(e)n=e.$head;else return My.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(My.findFrom(t,-r,!0)||My.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};My.jsonID(`text`,Iy);var Ly=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 Iy.between(e.resolve(this.anchor),e.resolve(this.head))}},Ry=class e extends My{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?My.near(a):new e(a)}content(){return new W(U.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 zy(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}};Ry.prototype.visible=!1,My.jsonID(`node`,Ry);var zy=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Ly(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ry.isSelectable(n)?new Ry(t):My.near(t)}},By=class e extends My{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=W.empty){if(t==W.empty){e.delete(0,e.doc.content.size);let t=My.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 Vy}};My.jsonID(`all`,By);var Vy={map(){return this},resolve(e){return new By(e)}};function Hy(e,t,n,r,i,a=!1){if(t.inlineContent)return Iy.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=Hy(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&Ry.isSelectable(r))return Ry.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Uy(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Lv||i instanceof Rv))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(My.near(e.doc.resolve(o),n))}var Wy=1,Gy=2,Ky=4,qy=class extends Ay{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|Wy)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Wy)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Gy,this}ensureMarks(e){return l_.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&Gy)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,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)||l_.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(My.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|=Ky,this}get scrolledIntoView(){return(this.updated&Ky)>0}};function Jy(e,t){return!t||!e?e:e.bind(t)}var Yy=class{constructor(e,t,n){this.name=e,this.init=Jy(t.init,n),this.apply=Jy(t.apply,n)}},Xy=[new Yy(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Yy(`selection`,{init(e,t){return e.selection||My.atStart(t.doc)},apply(e){return e.selection}}),new Yy(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Yy(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Zy=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Xy.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 Yy(e.key,e.spec.state,e))})}},Qy=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 qy(this)}static create(t){let n=new Zy(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 Zy(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 Zy(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=k_.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=My.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 $y(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=$y(i,t,{})),n[r]=i}return n}var eb=class{constructor(e){this.spec=e,this.props={},e.props&&$y(e.props,this,this.props),this.key=e.key?e.key.key:nb(`plugin`)}getState(e){return e[this.key]}},tb=Object.create(null);function nb(e){return e in tb?e+`$`+ ++tb[e]:(tb[e]=0,e+`$`)}var rb=class{constructor(e=`key`){this.key=nb(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},ib=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function ab(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var ob=(e,t,n)=>{let r=ab(e,n);if(!r)return!1;let i=fb(r);if(!i){let n=r.blockRange(),i=n&&Wv(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Ab(e,i,t,-1))return!0;if(r.parent.content.size==0&&(ub(a,`end`)||Ry.isSelectable(a)))for(let n=r.depth;;n--){let o=dy(e.doc,r.before(n),r.after(n),W.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(ub(a,`end`)?My.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):Ry.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},sb=(e,t,n)=>{let r=ab(e,n);if(!r)return!1;let i=fb(r);return i?lb(e,i,t):!1},cb=(e,t,n)=>{let r=pb(e,n);if(!r)return!1;let i=gb(r);return i?lb(e,i,t):!1};function lb(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=dy(e.doc,i,o,W.empty);if(!s||s.from!=i||s instanceof Lv&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(Iy.create(t.doc,i)),n(t.scrollIntoView())}return!0}function ub(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 db=(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=fb(r)}let o=a&&a.nodeBefore;return!o||!Ry.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Ry.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function fb(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 pb(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var mb=(e,t,n)=>{let r=pb(e,n);if(!r)return!1;let i=gb(r);if(!i)return!1;let a=i.nodeAfter;if(Ab(e,i,t,1))return!0;if(r.parent.content.size==0&&(ub(a,`start`)||Ry.isSelectable(a))){let n=dy(e.doc,r.before(),r.after(),W.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(ub(a,`start`)?My.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Ry.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},hb=(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=gb(r)}let o=a&&a.nodeAfter;return!o||!Ry.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Ry.create(e.doc,a.pos)).scrollIntoView()),!0)};function gb(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 _b=(e,t)=>{let n=e.selection,r=n instanceof Ry,i;if(r){if(n.node.isTextblock||!iy(e.doc,n.from))return!1;i=n.from}else if(i=sy(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(Ry.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},vb=(e,t)=>{let n=e.selection,r;if(n instanceof Ry){if(n.node.isTextblock||!iy(e.doc,n.to))return!1;r=n.to}else if(r=sy(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},yb=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Wv(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},bb=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
153
+ `).scrollIntoView()),!0)};function xb(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 Sb=(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=xb(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(My.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Cb=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof By||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=xb(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(Iy.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},wb=(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(ny(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Wv(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Tb(e){return(t,n)=>{if(t.selection instanceof Ry&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!ny(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof Iy||t.selection instanceof By)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=xb(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=ny(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,ny(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var Eb=Tb(),Db=(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(Ry.create(e.doc,i))),!0)},Ob=(e,t)=>(t&&t(e.tr.setSelection(new By(e.doc))),!0);function kb(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||iy(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Ab(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&kb(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=U.empty;for(let e=o.length-1;e>=0;e--)s=U.from(o[e].create(null,s));s=U.from(i.copy(s));let c=e.tr.step(new Rv(t.pos-1,r,t.pos,r,new W(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&iy(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:My.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Wv(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&ub(a,`start`,!0)&&ub(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=U.empty;for(let e=o.length-1;e>=0;e--)r=U.from(o[e].copy(r));n(e.tr.step(new Rv(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new W(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function jb(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(Iy.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Mb=jb(-1),Nb=jb(1);function Pb(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Kv(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Fb(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 Ib(...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 Lb=Ib(ib,ob,db),Rb=Ib(ib,mb,hb),zb={Enter:Ib(bb,Cb,wb,Eb),"Mod-Enter":Sb,Backspace:Lb,"Mod-Backspace":Lb,"Shift-Backspace":Lb,Delete:Rb,"Mod-Delete":Rb,"Mod-a":Ob},Bb={"Ctrl-h":zb.Backspace,"Alt-Backspace":zb[`Mod-Backspace`],"Ctrl-d":zb.Delete,"Ctrl-Alt-Backspace":zb[`Mod-Delete`],"Alt-Delete":zb[`Mod-Delete`],"Alt-d":zb[`Mod-Delete`],"Ctrl-a":Mb,"Ctrl-e":Nb};for(let e in zb)Bb[e]=zb[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Vb(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 Hb(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Hb(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 D_(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new D_(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Kv(a,n,r,t);return s?(e&&Ub(e,t,s,i,n),!0):!1}function Ub(e,t,n,r,i){let a=U.empty;for(let e=n.length-1;e>=0;e--)a=U.from(n[e].type.create(n[e].attrs,a));e.step(new Rv(t.start-(r?2:0),t.end,t.start,t.end,new W(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&&ny(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Wb(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?Gb(t,n,e,a):Kb(t,n,a):!0:!1}}function Gb(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Rv(a-1,o,a,o,new W(U.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new D_(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Wv(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return iy(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Kb(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?U.empty:U.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Rv(d-+!!s,f+ +!!c,d+1,f-1,new W((s?U.empty:U.from(i.copy(U.empty))).append(c?U.empty:U.from(i.copy(U.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function qb(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=U.from(r?e.create():null),o=new W(U.from(e.create(null,U.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Rv(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Jb=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Yb=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Xb=null,Zb=function(e,t,n){let r=Xb||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Qb=function(){Xb=null},$b=function(e,t,n,r){return n&&(tx(e,t,n,r,-1)||tx(e,t,n,r,1))},ex=/^(img|br|input|textarea|hr)$/i;function tx(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:nx(e))){let n=e.parentNode;if(!n||!rx(n)||lx(e)||ex.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Jb(e)+(i<0?0:1),e=n}else if(rx(e)){let n=e.childNodes[t+(i<0?-1:0)];if(rx(n)&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?nx(e):0}else return!1}}function nx(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function rx(e){return e.nodeType==1}function ix(e){return e.nodeType==3}function ax(e,t){return t?e.contains(rx(t)?t:t.parentNode):!1}function ox(e,t){for(;;){if(ix(e)&&t)return e;if(rx(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=nx(e)}else if(e.parentNode&&!lx(e))t=Jb(e),e=e.parentNode;else return null}}function sx(e,t){for(;;){if(ix(e)&&t<e.nodeValue.length)return e;if(rx(e)&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!lx(e))t=Jb(e)+1,e=e.parentNode;else return null}}function cx(e,t,n){for(let r=t==0,i=t==nx(e);r||i;){if(e==n)return!0;let t=Jb(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==nx(e)}}function lx(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 ux=function(e){return e.focusNode&&$b(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function dx(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function fx(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function px(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(nx(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(nx(r.startContainer),r.startOffset)}}}var mx=typeof navigator<`u`?navigator:null,hx=typeof document<`u`?document:null,gx=mx&&mx.userAgent||``,_x=/Edge\/(\d+)/.exec(gx),vx=/MSIE \d/.exec(gx),yx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(gx),bx=!!(vx||yx||_x),xx=vx?document.documentMode:yx?+yx[1]:_x?+_x[1]:0,Sx=!bx&&/gecko\/(\d+)/i.test(gx);Sx&&+(/Firefox\/(\d+)/.exec(gx)||[0,0])[1];var Cx=!bx&&/Chrome\/(\d+)/.exec(gx),wx=!!Cx,Tx=Cx?+Cx[1]:0,Ex=!bx&&!!mx&&/Apple Computer/.test(mx.vendor),Dx=Ex&&(/Mobile\/\w+/.test(gx)||!!mx&&mx.maxTouchPoints>2),Ox=Dx||(mx?/Mac/.test(mx.platform):!1),kx=mx?/Win/.test(mx.platform):!1,Ax=/Android \d/.test(gx),jx=!!hx&&`webkitFontSmoothing`in hx.documentElement.style,Mx=jx?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Nx(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 Px(e,t){return typeof e==`number`?e:e[t]}function Fx(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 Ix(e,t,n){if(!Zx(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!rx(o)){o=Yb(o);continue}let e=o==a.body,n=e?Nx(a):Fx(o),s=0,c=0;if(t.top<n.top+Px(r,`top`)?c=-(n.top-t.top+Px(i,`top`)):t.bottom>n.bottom-Px(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+Px(i,`top`)-n.top:t.bottom-n.bottom+Px(i,`bottom`)),t.left<n.left+Px(r,`left`)?s=-(n.left-t.left+Px(i,`left`)):t.right>n.right-Px(r,`right`)&&(s=t.right-n.right+Px(i,`right`)),s||c)if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:Yb(o)}}function Lx(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:Rx(e.dom)}}function Rx(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Yb(r));return t}function zx({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Bx(n,r==0?0:r-t)}function Bx(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 Vx=null;function Hx(e){if(e.setActive)return e.setActive();if(Vx)return e.focus(Vx);let t=Rx(e);e.focus(Vx==null?{get preventScroll(){return Vx={preventScroll:!0},!0}}:void 0),Vx||(Vx=!1,Bx(t,0))}function Ux(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(rx(u))e=u.getClientRects();else if(ix(u))e=Zb(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&&ix(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,rx(u)&&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&&ix(n)?Wx(n,i):!n||r?{node:e,offset:a}:Ux(n,i)}function Wx(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=Qx(r,1);if(n.top!=n.bottom&&Gx(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Gx(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Kx(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function qx(e,t,n){let{node:r,offset:i}=Ux(t,n),a=-1;if(rx(r)&&!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 Jx(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(rx(t.dom)&&(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 Yx(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(rx(n)){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Gx(t,i))return Yx(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Xx(e,t){let n=e.dom.ownerDocument,r,i=0,a=px(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)){let n=e.dom.getBoundingClientRect();if(!Gx(t,n)||(o=Yx(e.dom,t,n),!o))return null}if(Ex)for(let e=o;r&&e;e=Yb(e))e.draggable&&(r=void 0);if(o=Kx(o,t),r){if(Sx&&rx(r)&&(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;jx&&i&&rx(r)&&rx(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&rx(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||!rx(r)||r.childNodes[i-1].nodeName!=`BR`)&&(s=Jx(e,r,i,t))}s??=qx(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Zx(e){return e.top<e.bottom||e.left<e.right}function Qx(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Zx(e))return e}return Array.prototype.find.call(n,Zx)||e.getBoundingClientRect()}var $x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function eS(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=jx||Sx;if(ix(r))if(o&&($x.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Qx(Zb(r,i,i),n);if(Sx&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Qx(Zb(r,i-1,i-1),-1);if(t.top==e.top){let n=Qx(Zb(r,i,i+1),-1);if(n.top!=e.top)return tS(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++,tS(Qx(Zb(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==nx(r))){let e=r.childNodes[i-1];if(rx(e))return nS(e.getBoundingClientRect(),!1)}if(a==null&&i<nx(r)){let e=r.childNodes[i];if(rx(e))return nS(e.getBoundingClientRect(),!0)}return nS(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==nx(r))){let e=r.childNodes[i-1],t=ix(e)?Zb(e,nx(e)-+!o):rx(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return tS(Qx(t,1),!1)}if(a==null&&i<nx(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?ix(e)?Zb(e,0,+!o):rx(e)?e:null:null;if(t)return tS(Qx(t,-1),!0)}return tS(Qx(ix(r)?Zb(r):r,-n),n>=0)}function tS(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 nS(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 rS(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 iS(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return rS(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=eS(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(rx(e))t=e.getClientRects();else if(ix(e))t=Zb(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 aS=/[\u0590-\u08ac]/;function oS(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?!aS.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:rS(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&&!ax(l,u)||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 sS=null,cS=null,lS=!1;function uS(e,t,n){return sS==t&&cS==n?lS:(sS=t,cS=n,lS=n==`up`||n==`down`?iS(e,t,n):oS(e,t,n))}var dS=0,fS=1,pS=2,mS=3,hS=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=dS,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){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&&ax(this.contentDOM,e))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>Jb(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(e.compareDocumentPosition(this.contentDOM)&4);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)&&!(rx(a)?ax(a,e):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){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof SS||e instanceof gS&&e.side>=0))break}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?Jb(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?Jb(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=Jb(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=Jb(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(!rx(t)||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((Sx||Ex)&&e==t){let{node:e,offset:t}=o;if(ix(e)){if(u=!!(t&&e.nodeValue[t-1]==`
154
+ `),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:Jb(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(Sx&&l.focusNode&&l.focusNode!=s.node&&rx(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Ex)&&$b(o.node,o.offset,l.anchorNode,l.anchorOffset)&&$b(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Sx)){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?pS:fS,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=mS:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?pS:mS}n=a}this.dirty=pS}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?pS:fS;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},gS=class extends hS{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){let e=rx(a)?a:document.createElement(`span`);e!=a&&e.appendChild(a),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==dS&&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}},_S=class extends hS{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}},vS=class e extends hS{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=uv.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&mS||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=mS&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=dS){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=dS}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=zS(a,n,o,r)),t>0&&(a=zS(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()}},yS=class e extends hS{constructor(e,t,n,r,i,a,o){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(!ix(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=uv.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=AS(u,r,n),l?c=new CS(t,n,r,i,u,d||null,f,l):n.isText?new xS(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>rx(t)&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>U.empty}}return t}matchesNode(e,t,n){return this.dirty==dS&&e.eq(this.node)&&jS(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 NS(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;IS(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?l_.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(f=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==pS)&&(a&&this.protectLocalComposition(e,a),wS(this.contentDOM,this.children,e),Dx&&LS(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Iy)||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=RS(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 _S(this,i,t,r);e.input.compositionNodes.push(a),this.children=zS(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==mS||!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=dS}updateOuterDeco(e){if(jS(e,this.outerDeco))return;let t=!rx(this.nodeDOM),n=this.dom;this.dom=OS(this.dom,this.nodeDOM,DS(this.outerDeco,this.node,t),DS(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){rx(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){rx(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function bS(e,t,n,r,i){AS(r,t,e);let a=new yS(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var xS=class e extends yS{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}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==mS||this.dirty!=dS&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=dS||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=dS,!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)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=mS)}get domAtom(){return!1}isText(e){return this.node.text==e}},SS=class extends hS{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==dS&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},CS=class extends yS{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==mS)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 wS(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=MS(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof vS){let t=r?r.previousSibling:e.lastChild;wS(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=MS(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var TS=function(e){e&&(this.nodeName=e)};TS.prototype=Object.create(null);var ES=[new TS];function DS(e,t,n){if(e.length==0)return ES;let r=n?ES[0]:new TS,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new TS(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new TS(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 OS(e,t,n,r){if(n==ES&&r==ES)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=ES[0],i=t)}kS(i,o||ES[0],a)}return i}function kS(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 AS(e,t,n){return OS(e,e,ES,DS(t,n,!rx(e)))}function jS(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 MS(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var NS=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=PS(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=dS,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<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof vS&&t.dirty!=mS&&t.mark.type==e[a].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[a])&&(t.mark=e[a],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=vS.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==mS&&a.dom==a.contentDOM&&(a.dirty=pS),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 yS){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!=mS&&jS(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=pS,u.updateChildren(r,a+1),u.dirty=dS),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)||!jS(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=yS.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=yS.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 gS(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 vS;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof xS)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ex||wx)&&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 SS(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||rx(e)&&e.contains(this.lock.parentNode))}};function PS(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 vS)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 FS(e,t){return e.type.side-t.type.side}function IS(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(FS);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 LS(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 RS(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 zS(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 BS(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(ux(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&Ry.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&cx(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Ry(o==e?s:r.resolve(e))}else if(Sx&&t==`key`&&o>e.state.selection.to&&rx(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=My.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!rx(e.parentNode))break}}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=ZS(e,u,s,n)}return l}function VS(e){return e.editable?e.hasFocus():$S(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function HS(e,t=!1){let n=e.state.selection;if(YS(e,n),!VS(e))return;let r=e.input.mouseDown;if(!t&&wx&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&$b(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)JS(e);else{let{anchor:r,head:i}=n,a,o;US&&!(n instanceof Iy)&&(n.$from.parent.inlineContent||(a=WS(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=WS(e,n.to))),e.docView.setSelection(r,i,e,t),US&&(a&&KS(a),o&&KS(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&qS(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var US=Ex||wx&&Tx<63;function WS(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(Ex&&i&&i.contentEditable==`false`)return GS(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return GS(i);if(a)return GS(a)}}function GS(e){return e.contentEditable=`true`,Ex&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function KS(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function qS(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(()=>{(!VS(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function JS(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Jb(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&bx&&xx<=11&&(n.disabled=!0,n.disabled=!1)}function YS(e,t){if(t instanceof Ry){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(XS(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else XS(e)}function XS(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function ZS(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||Iy.between(t,n,r)}function QS(e){return e.editable&&!e.hasFocus()?!1:$S(e)}function $S(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return ax(e.dom,t.anchorNode)&&(e.editable||ax(e.dom,t.focusNode))}catch{return!1}}function eC(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return $b(t.node,t.offset,n.anchorNode,n.anchorOffset)}function tC(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&&My.findFrom(a,t)}function nC(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function rC(e,t,n){let r=e.state.selection;if(r instanceof Iy){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 nC(e,new Iy(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=tC(e.state,t);return n&&n instanceof Ry?nC(e,n):!1}else if(!(Ox&&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?Ry.isSelectable(i)?nC(e,new Ry(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):nC(e,new Iy(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof Ry&&r.node.isInline)return nC(e,new Iy(t>0?r.$to:r.$from));else{let n=tC(e.state,t);return n?nC(e,n):!1}}function iC(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):rx(e)&&e.contentEditable==`false`}function aC(e,t){return t<0?oC(e):sC(e)}function oC(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Sx&&rx(n)&&r<nx(n)&&iC(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!rx(n))break;let e=n.childNodes[r-1];if(iC(e,-1))i=n,a=--r;else if(ix(e))n=e,r=n.nodeValue.length;else break}else if(cC(n))break;else{let t=n.previousSibling;for(;t&&iC(t,-1);)i=n.parentNode,a=Jb(t),t=t.previousSibling;if(t)n=t,r=nx(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?dC(e,n,r):i&&dC(e,i,a)}function sC(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=nx(n),a,o;for(;;)if(r<i){if(!rx(n))break;let e=n.childNodes[r];if(iC(e,1))a=n,o=++r;else break}else if(cC(n))break;else{let t=n.nextSibling;for(;t&&iC(t,1);)a=t.parentNode,o=Jb(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=nx(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&dC(e,a,o)}function cC(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function lC(e,t){for(;e&&t==e.childNodes.length&&!lx(e);)t=Jb(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(ix(n))return n;if(rx(n)&&n.contentEditable==`false`)break;e=n,t=0}}function uC(e,t){for(;e&&!t&&!lx(e);)t=Jb(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(ix(n))return n;if(rx(n)&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function dC(e,t,n){if(!ix(t)){let e,r;(r=lC(t,n))?(t=r,n=0):(e=uC(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(ux(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&&HS(e)},50)}function fC(e,t){let n=e.state.doc.resolve(t);if(!(wx||kx)&&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 pC(e,t,n){let r=e.state.selection;if(r instanceof Iy&&!r.empty||n.indexOf(`s`)>-1||Ox&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=tC(e.state,t);if(n&&n instanceof Ry)return nC(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof By?My.near(n,t):My.findFrom(n,t);return o?nC(e,o):!1}return!1}function mC(e,t){if(!(e.state.selection instanceof Iy))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 hC(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function gC(e){if(!Ex||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&rx(t)&&n==0&&t.firstChild&&rx(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;hC(e,n,`true`),setTimeout(()=>hC(e,n,`false`),20)}return!1}function _C(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function vC(e,t){let n=t.keyCode,r=_C(t);if(n==8||Ox&&n==72&&r==`c`)return mC(e,-1)||aC(e,-1);if(n==46&&!t.shiftKey||Ox&&n==68&&r==`c`)return mC(e,1)||aC(e,1);if(n==13||n==27)return!0;if(n==37||Ox&&n==66&&r==`c`){let t=n==37?fC(e,e.state.selection.from)==`ltr`?-1:1:-1;return rC(e,t,r)||aC(e,t)}else if(n==39||Ox&&n==70&&r==`c`){let t=n==39?fC(e,e.state.selection.from)==`ltr`?1:-1:1;return rC(e,t,r)||aC(e,t)}else if(n==38||Ox&&n==80&&r==`c`)return pC(e,-1,r)||aC(e,-1);else if(n==40||Ox&&n==78&&r==`c`)return gC(e)||pC(e,1,r)||aC(e,1);else if(r==(Ox?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function yC(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`)||uv.fromSchema(e.state.schema),s=kC(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&rx(l)&&(u=OC[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&&rx(l)&&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,`
155
+
156
+ `),slice:t}}function bC(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 W(U.from(e.state.schema.text(t.replace(/\r\n?/g,`
157
+ `))),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=uv.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=MC(n),jx&&NC(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&&!rx(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||X_.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!xC.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=PC(DC(s,+u[1],+u[2]),u[4]);else if(s=W.maxOpen(SC(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=DC(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var xC=/^(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 SC(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&&wC(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=TC(a[a.length-1],i.length));let n=CC(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return U.from(a)}return e}function CC(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,U.from(e));return e}function wC(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=wC(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(U.from(CC(n,e,i+1))))}}function TC(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,TC(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(U.empty,!0);return e.copy(n.append(r))}function EC(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=EC(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(U.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function DC(e,t,n){return t<e.openStart&&(e=new W(EC(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new W(EC(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var OC={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function kC(){return document.implementation.createHTMLDocument(`title`)}var AC=null;function jC(e){let t=window.trustedTypes;if(!t)return e;if(!AC){if(AC=t.defaultPolicy)try{return AC.createHTML(e)}catch{}AC=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return AC.createHTML(e)}function MC(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=kC(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&OC[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=jC(e),a)for(let e=0;e<a.length;e++)r=r.querySelector(a[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}function NC(e){let t=e.querySelectorAll(wx?`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 PC(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;try{i=U.from(t.create(r[e+1],i))}catch{break}a++,o++}return new W(i,a,o)}var FC={},IC={},LC={touchstart:!0,touchmove:!0},RC=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 zC(e){for(let t in FC){let n=FC[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{WC(e,t)&&!UC(e,t)&&(e.editable||!(t.type in IC))&&n(e,t)},LC[t]?{passive:!0}:void 0)}Ex&&e.dom.addEventListener(`input`,()=>null),HC(e)}function BC(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function VC(e){e.input.mouseDown&&e.input.mouseDown.done(),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 HC(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>UC(e,t))})}function UC(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function WC(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 GC(e,t){!UC(e,t)&&FC[t.type]&&(e.editable||!(t.type in IC))&&FC[t.type](e,t)}IC.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!cw(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ax&&wx&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Dx&&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,dx(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||vC(e,n)?n.preventDefault():BC(e,`key`)},IC.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},IC.keypress=(e,t)=>{let n=t;if(cw(e)||!n.charCode||n.ctrlKey&&!n.altKey||Ox&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Iy)||!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 KC(e){return{left:e.clientX,top:e.clientY}}function qC(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function JC(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 YC(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function XC(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Ry.isSelectable(r)?(YC(e,new Ry(n)),!0):!1}function ZC(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Ry&&(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(Ry.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:(YC(e,Ry.create(e.state.doc,i)),!0)}function QC(e,t,n,r,i){return JC(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?ZC(e,n):XC(e,n))}function $C(e,t,n,r){return JC(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function ew(e,t,n,r){return JC(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||tw(e,n,r)}function tw(e,t,n){if(n.button!=0)return!1;let r=nw(e,t,!0),i=e.state.doc;return r?(YC(e,r),r instanceof Iy&&i.eq(e.state.doc)&&(e.input.mouseDown=new sw(e,r)),!0):!1}function nw(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?Iy.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return Iy.create(r,a+1,a+1+t.content.size);if(n&&Ry.isSelectable(t))return Ry.create(r,a)}return null}function rw(e){return mw(e)}var iw=Ox?`metaKey`:`ctrlKey`;FC.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=rw(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&qC(n,e.input.lastClick)&&!n[iw]&&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},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(KC(n));o&&(a==`singleClick`?e.input.mouseDown=new ow(e,o,n,!!r):(a==`doubleClick`?$C:ew)(e,o.pos,o.inside,n)?n.preventDefault():BC(e,`pointer`))};var aw=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},ow=class extends aw{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[iw],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&&rx(s.nodeDOM)?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Ry&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Sx&&!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()),BC(e,`pointer`)}done(){super.done(),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(()=>{this.view.isDestroyed||HS(this.view)})}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(KC(e))),this.updateAllowDefault(e),this.allowDefault||!t?BC(this.view,`pointer`):QC(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ex&&this.mightDrag&&!this.mightDrag.node.isAtom||wx&&!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)?(YC(this.view,My.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):BC(this.view,`pointer`)}move(e){this.updateAllowDefault(e),BC(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},sw=class extends aw{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),BC(this.view,`pointer`);let t=this.view.posAtCoords(KC(e)),n=t&&nw(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];YC(this.view,Iy.create(r,a,o))}};FC.touchstart=e=>{e.input.lastTouch=Date.now(),rw(e),BC(e,`pointer`)},FC.touchmove=e=>{e.input.lastTouch=Date.now(),BC(e,`pointer`)},FC.contextmenu=e=>rw(e);function cw(e,t){return e.composing?!0:Ex&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var lw=Ax?5e3:-1;IC.compositionstart=IC.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Iy&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||wx&&kx&&uw(e)))e.markCursor=e.state.storedMarks||n.marks(),mw(e,!0),e.markCursor=null;else if(mw(e,!t.selection.empty),Sx&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&rx(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(ix(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}dw(e,lw)};function uw(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!rx(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return rx(r)&&r.contentEditable==`false`}IC.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),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++,dw(e,20))};function dw(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>mw(e),t))}function fw(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function pw(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=ox(t.focusNode,t.focusOffset),r=sx(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 mw(e,t=!1){if(!(Ax&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),fw(e),t||e.docView&&e.docView.dirty){let n=BS(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 hw(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 gw=bx&&xx<15||Dx&&Mx<604;FC.copy=IC.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=gw?null:n.clipboardData,{dom:o,text:s}=yC(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):hw(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function _w(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function vw(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?yw(e,r.value,null,i,t):yw(e,r.textContent,r.innerHTML,i,t)},50)}function yw(e,t,n,r,i){let a=bC(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||W.empty)))return!0;if(!a)return!1;let o=_w(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 bw(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,` `):``}IC.paste=(e,t)=>{let n=t;if(e.composing&&!Ax)return;let r=gw?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&yw(e,bw(r),r.getData(`text/html`),i,n)?n.preventDefault():vw(e,n)};var xw=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Sw=Ox?`altKey`:`ctrlKey`;function Cw(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Sw]:!n}FC.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(KC(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Ry?i.to-1:i.to))){if(r&&r.mightDrag)o=Ry.create(e.state.doc,r.mightDrag.pos);else if(n.target&&rx(n.target)){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Ry.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=yC(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!wx||Tx>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(gw?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,gw||n.dataTransfer.setData(`text/plain`,c),e.dragging=new xw(l,Cw(e,n),o)},FC.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},IC.dragover=IC.dragenter=(e,t)=>t.preventDefault(),IC.drop=(e,t)=>{try{ww(e,t,e.dragging)}finally{e.dragging=null}};function ww(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(KC(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=bC(e,bw(t.dataTransfer),gw?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Cw(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||W.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?uy(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&&Ry.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Ry(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(ZS(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}FC.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())&&HS(e)},20))},FC.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)},FC.beforeinput=(e,t)=>{if(Ax&&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,dx(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 IC)FC[e]=IC[e];function Tw(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 Ew=class e{constructor(e,t){this.toDOM=e,this.spec=t||Aw,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 Ow(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&&Tw(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Dw=class e{constructor(e,t){this.attrs=e,this.spec=t||Aw}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 Ow(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Tw(this.attrs,t.attrs)&&Tw(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},bee=class e{constructor(e,t){this.attrs=e,this.spec=t||Aw}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 Ow(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&&Tw(this.attrs,t.attrs)&&Tw(this.spec,t.spec)}destroy(){}},Ow=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 Ew(n,r))}static inline(t,n,r,i){return new e(t,n,new Dw(r,i))}static node(t,n,r,i){return new e(t,n,new bee(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Dw}get widget(){return this.type instanceof Ew}},kw=[],Aw={},jw=class e{constructor(e,t){this.local=e.length?e:kw,this.children=t.length?t:kw}static create(e,t){return t.length?Lw(t,e,0,Aw):Mw}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==Mw||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Aw)}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?xee(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Rw),kw):Mw}add(t,n){return n.length?this==Mw?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=Fw(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,Lw(s,e,o+1,Aw)),a+=3}});let o=Pw(a?Iw(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(Rw):this.local,i||this.children)}remove(e){return e.length==0||this==Mw?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==Mw?(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):Mw}forChild(t,n){if(this==Mw)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 Dw){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(Rw),kw);return r?new Nw([t,r]):t}return r||Mw}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 zw(this.localsInner(e))}localsInner(e){if(this==Mw)return kw;if(e.inlineContent||!this.local.some(Dw.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Dw||t.push(this.local[e]);return t}forEachSet(e){e(this)}};jw.empty=new jw([],[]),jw.removeOverlap=zw;var Mw=jw.empty,Nw=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Aw));return e.from(r)}forChild(t,n){if(n.isLeaf)return jw.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Mw&&(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?zw(n?t:t.sort(Rw)):kw}static from(t){switch(t.length){case 0:return Mw;case 1:return t[0];default:return new e(t.every(e=>e instanceof jw)?t:t.reduce((e,t)=>e.concat(t instanceof jw?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function xee(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==Mw?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Lw(See(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 jw(t.sort(Rw),s)}function Pw(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 Ow(i.from+t,i.to+t,i.type))}return n}function See(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 Fw(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 Iw(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Lw(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Fw(e,t,o+n);if(s){a=!0;let e=Lw(s,t,n+o+1,r);e!=Mw&&i.push(o,o+t.nodeSize,e)}});let o=Pw(a?Iw(e):e,-n).sort(Rw);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 jw(o,i):Mw}function Rw(e,t){return e.from-t.from||e.to-t.to}function zw(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),Bw(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),Bw(t,i,r.copy(a.from,r.to)));break}}}return t}function Bw(e,t,n){for(;t<e.length&&Rw(n,e[t])>0;)t++;e.splice(t,0,n)}function Vw(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Mw&&t.push(r)}),e.cursorWrapper&&t.push(jw.create(e.state.doc,[e.cursorWrapper.deco])),Nw.from(t)}var Cee={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},wee=bx&&xx<=11,Tee=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}},Eee=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Tee,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]);bx&&xx<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Ex&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),wee&&(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,Cee)),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(QS(this.view)){if(this.suppressingSelectionUpdates)return HS(this.view);if(bx&&xx<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&$b(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=Yb(n))t.add(n);for(let r=e.anchorNode;r;r=Yb(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:ix(n)?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)&&QS(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||wx&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&rx(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Sx&&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||kee(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&&ux(n)&&(c=BS(e))&&c.eq(My.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,HS(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Dee(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Aee(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||HS(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),ix(r)&&(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(bx&&xx<=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?Jb(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Jb(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}}},Hw=new WeakMap,Uw=!1;function Dee(e){if(!Hw.has(e)&&(Hw.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Sx,Uw)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.`),Uw=!0}}function Ww(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return $b(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Oee(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ww(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?Ww(e,n):null}function kee(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 Aee(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||!rx(e)||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 jee(e,t,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&ax(e.dom,d)&&(u=[{node:d,offset:l.anchorOffset}],ux(l)||u.push({node:l.focusNode,offset:l.focusOffset})),wx&&e.input.lastKeyCode===8)for(let e=o;e>a;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||X_.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:Mee(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var Mee=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(Ex&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(t.parentNode.lastChild==t||Ex&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},Nee=/^(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 Pee(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=BS(e,t);if(n&&!e.state.selection.eq(n)){if(wx&&Ax&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,dx(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=jee(e,t,n,i),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=Jw(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Dx&&e.input.lastIOSEnter>Date.now()-225||Ax)&&i.some(e=>rx(e)&&!Nee.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,dx(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof Iy&&!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=Gw(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 Iy&&(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)),bx&&xx<=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((Dx&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&Kw(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,dx(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Iee(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,dx(8,`Backspace`)))){Ax&&wx&&e.domObserver.suppressSelectionUpdates();return}wx&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Ax&&!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,dx(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=Gw(e,n.doc,l.sel);t&&!(wx&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||bx&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){bx&&xx<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>HS(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=Fee(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 Gw(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ZS(e,t.resolve(n.anchor),t.resolve(n.head))}function Fee(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(U.from(l).eq(e))return{mark:s,type:o}}function Iee(e,t,n,r,i){if(n-t<=i.pos-r.pos||qw(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(qw(a,!0,!0));return!o.parent.isTextblock||o.pos>n||qw(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Kw(e,t,n){let r=0,i=0;return e.nodesBetween(t,n,(e,a)=>{e.isTextblock&&a>=t&&a<n?r++:(e.isText?/\S/.test(e.text.slice(Math.max(0,t-a),Math.min(e.nodeSize,n-a))):e.isLeaf)&&i++}),i==0&&r==1}function qw(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 Jw(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var Yw=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 RC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(nT),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=Qw(this),Zw(this),this.nodeViews=eT(this),this.docView=bS(this.state.doc,Xw(this),Vw(this),this.dom,this),this.domObserver=new Eee(this,(e,t,n,r)=>Pee(this,e,t,n,r)),this.domObserver.start(),zC(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&&HC(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(nT),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&&(fw(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=eT(this);tT(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&HC(this),this.editable=Qw(this),Zw(this);let o=Vw(this),s=Xw(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&&Lx(this);if(i){this.domObserver.stop();let t=l&&(bx||wx)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&$w(n.selection,e.selection);if(l){let n=wx?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=pw(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=bS(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&eC(this)&&i.delaySelUpdate())?HS(this,t):(YS(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&&zx(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!ax(this.dom,e))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof Ry){let t=this.docView.domAfterPos(this.state.selection.from);rx(t)&&Ix(this,t.getBoundingClientRect(),e)}else Ix(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 xw(e.slice,e.move,r<0?void 0:Ry.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(bx){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&&Hx(this.dom),HS(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 Xx(this,e)}coordsAtPos(e,t=1){return eS(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 uS(this,t||this.state,e)}pasteHTML(e,t){return yw(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return yw(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return yC(this,e)}destroy(){this.docView&&(VC(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Vw(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Qb())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return GC(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?Ex&&this.root.nodeType===11&&fx(this.dom.ownerDocument)==this.dom&&Oee(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Yw.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Xw(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`,[Ow.node(0,e.state.doc.content.size,t)]}function Zw(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:Ow.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Qw(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function $w(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 eT(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 tT(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 nT(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 rT={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:`'`},iT={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},aT=typeof navigator<`u`&&/Mac/.test(navigator.platform),oT=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),sT=0;sT<10;sT++)rT[48+sT]=rT[96+sT]=String(sT);for(var sT=1;sT<=24;sT++)rT[sT+111]=`F`+sT;for(var sT=65;sT<=90;sT++)rT[sT]=String.fromCharCode(sT+32),iT[sT]=String.fromCharCode(sT);for(var cT in rT)iT.hasOwnProperty(cT)||(iT[cT]=rT[cT]);function lT(e){var t=!(aT&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||oT&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?iT:rT)[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 uT=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),dT=typeof navigator<`u`&&/Win/.test(navigator.platform);function fT(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))uT?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 pT(e){let t=Object.create(null);for(let n in e)t[fT(n)]=e[n];return t}function mT(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 hT(e){return new eb({props:{handleKeyDown:gT(e)}})}function gT(e){let t=pT(e);return function(e,n){let r=lT(n),i,a=t[mT(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[mT(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(dT&&n.ctrlKey&&n.altKey)&&(i=rT[n.keyCode])&&i!=r){let r=t[mT(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}function _T(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 vT=class e{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}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}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)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:_T({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}},yT=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),bT=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),xT=()=>({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=Wv(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},ST=e=>t=>e(t),CT=()=>({state:e,dispatch:t})=>Cb(e,t),wT=(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 Iy(r.doc.resolve(Math.max(o-1,0)))),!0},TT=()=>({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 ET(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 DT=e=>({tr:t,state:n,dispatch:r})=>{let i=ET(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},OT=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},kT=e=>e.content?/^text(\*|\+)/.test(e.content):!1,AT=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return kT(r)?n===`left`?e.start()-1:e.end()+1:e.pos},jT=(e,t,n)=>({from:AT(e,n,`left`),to:AT(t,n,`right`)}),MT=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=jT(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(Iy.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},NT=()=>({commands:e})=>e.keyboardShortcut(`Enter`),PT=()=>({state:e,dispatch:t})=>Sb(e,t);function FT(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function IT(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:FT(t[r])?t[r].test(e[r]):t[r]===e[r])}function LT(e,t,n={}){return e.find(e=>e.type===t&&IT(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function RT(e,t,n={}){return!!LT(e,t,n)}function zT(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(!LT([...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&&RT([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&RT([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function BT(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 VT=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=BT(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=zT(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=Iy.create(o,e.from,e.to);n.setSelection(t)}}return!0},HT=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 UT(e){return e instanceof Iy}function WT(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function GT(e,t=null){if(!t)return null;let n=My.atStart(e),r=My.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?Iy.create(e,WT(0,i,a),WT(e.content.size,i,a)):Iy.create(e,WT(t,i,a),WT(t,i,a))}function KT(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function qT(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function JT(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var YT=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(qT()||KT())&&r.dom.focus(),JT()&&!qT()&&!KT()&&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&&!UT(n.state.selection))return o(),!0;let s=GT(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},XT=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),ZT=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),QT=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&&QT(r)}return e};function $T(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 QT(n)}function eE(e){return typeof e?.nodesBetween==`function`}function tE(e,t,n){if(eE(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return U.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),tE(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new K_({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?X_.fromSchema(a).parseSlice($T(e),n.parseOptions):X_.fromSchema(a).parse($T(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=X_.fromSchema(t);return n.slice?r.parseSlice($T(e),n.parseOptions).content:r.parse($T(e),n.parseOptions)}return tE(``,t,n)}function nE(e){return!(`type`in e)}function rE(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Lv||i instanceof Rv))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(My.near(e.doc.resolve(o),n))}var iE=(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{tE(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=tE(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,f=nE(i)?i.content:[i];if(f.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 p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):eE(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=U.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&rE(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function aE(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}var oE=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=aE(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=tE(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&rE(t,t.steps.length-1,-1)),!0):!1},sE=()=>({state:e,dispatch:t})=>_b(e,t),cE=()=>({state:e,dispatch:t})=>vb(e,t),lE=()=>({state:e,dispatch:t})=>ob(e,t),uE=()=>({state:e,dispatch:t})=>mb(e,t),dE=()=>({state:e,dispatch:t,tr:n})=>{try{let r=sy(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},fE=()=>({state:e,dispatch:t,tr:n})=>{try{let r=sy(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},pE=()=>({state:e,dispatch:t})=>sb(e,t),mE=()=>({state:e,dispatch:t})=>cb(e,t);function hE(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function gE(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))qT()||hE()?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 _E=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=gE(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 vE(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?ET(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).filter(e=>IT(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var yE=(e,t={})=>({state:n,dispatch:r})=>vE(n,ET(e,n.schema),t)?yb(n,r):!1,bE=()=>({state:e,dispatch:t})=>wb(e,t),xE=e=>({state:t,dispatch:n})=>Wb(ET(e,t.schema))(t,n),SE=()=>({state:e,dispatch:t})=>bb(e,t);function CE(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function wE(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 TE=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=CE(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=ET(e,r.schema)),s===`mark`&&(o=BT(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,wE(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(wE(a.attrs,t))))})})}),c},EE=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),DE=()=>({tr:e,dispatch:t})=>{if(t){let t=new By(e.doc);e.setSelection(t)}return!0},OE=()=>({state:e,dispatch:t})=>db(e,t),kE=()=>({state:e,dispatch:t})=>hb(e,t),AE=()=>({state:e,dispatch:t})=>Db(e,t),jE=()=>({state:e,dispatch:t})=>Nb(e,t),ME=()=>({state:e,dispatch:t})=>Mb(e,t);function NE(e,t,n={},r={}){return tE(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var PE=(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=NE(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=nE(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function FE(e,t){let n=BT(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 IE(e,t){let n=new Ay(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function LE(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function RE(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 zE(e){return t=>RE(t.$from,e)}function BE(e,t,n){return e.config[t]===void 0&&e.parent?BE(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?BE(e.parent,t,n):null}):e.config[t]}function VE(e){return e.map(e=>{let t=BE(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...VE(t())]:e}).flat(10)}function HE(e,t){let n=uv.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function UE(e){return typeof e==`function`}function WE(e,t=void 0,...n){return UE(e)?t?e.bind(t)(...n):e(...n):e}function GE(e={}){return Object.keys(e).length===0&&e.constructor===Object}function KE(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function qE(e){let t=[],{nodeExtensions:n,markExtensions:r}=KE(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=BE(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=BE(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 JE(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 YE(e){let t=[],n=JE(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 XE(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}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([...YE(n[e]),...YE(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function ZE(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)=>XE(e,t),{})}function QE(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function $E(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):QE(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function eD(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&GE(t)?!1:t!=null))}function tD(e){var t,n;let r={};return!(!(e==null||(t=e.attribute)==null)&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function nD(e,t){let n=qE(e),{nodeExtensions:r,markExtensions:i}=KE(e);return new K_({topNode:r.find(e=>BE(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=eD({...e.reduce((e,t)=>{let n=BE(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:WE(BE(r,`content`,a)),marks:WE(BE(r,`marks`,a)),group:WE(BE(r,`group`,a)),inline:WE(BE(r,`inline`,a)),atom:WE(BE(r,`atom`,a)),selectable:WE(BE(r,`selectable`,a)),draggable:WE(BE(r,`draggable`,a)),code:WE(BE(r,`code`,a)),whitespace:WE(BE(r,`whitespace`,a)),linebreakReplacement:WE(BE(r,`linebreakReplacement`,a)),defining:WE(BE(r,`defining`,a)),isolating:WE(BE(r,`isolating`,a)),attrs:Object.fromEntries(i.map(tD))}),s=WE(BE(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>$E(e,i)));let c=BE(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:ZE(e,i)}));let l=BE(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=eD({...e.reduce((e,t)=>{let n=BE(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:WE(BE(r,`inclusive`,a)),excludes:WE(BE(r,`excludes`,a)),group:WE(BE(r,`group`,a)),spanning:WE(BE(r,`spanning`,a)),code:WE(BE(r,`code`,a)),attrs:Object.fromEntries(i.map(tD))}),s=WE(BE(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>$E(e,i)));let c=BE(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:ZE(e,i)})),[r.name,o]}))})}function rD(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function iD(e){return e.sort((e,t)=>{let n=BE(e,`priority`)||100,r=BE(t,`priority`)||100;return n>r?-1:+(n<r)})}function aD(e){let t=iD(VE(e)),n=rD(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 oD(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;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function sD(e,t){return oD(e,{from:0,to:e.content.size},t)}function cD(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function lD(e,t){let n=ET(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 uD(e,t){let n=CE(typeof t==`string`?t:t.name,e.schema);return n===`node`?lD(e,t):n===`mark`?FE(e,t):{}}function dD(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 fD(e){let t=dD(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 pD(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}})})}),fD(r)}function mD(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=zT(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 hD=(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]},gD=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function _D(e,t){return t.nodes[e]||t.marks[e]||null}function vD(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 yD=(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 bD(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?BT(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>IT(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).filter(e=>IT(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)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function xD(e,t,n={}){if(!t)return vE(e,null,n)||bD(e,null,n);let r=CE(t,e.schema);return r===`node`?vE(e,t,n):r===`mark`&&bD(e,t,n)}var SD=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=zE(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)},CD=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function wD(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function TD(e,t){let{nodeExtensions:n}=KE(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=WE(BE(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function ED(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&&(ED(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function DD(e){return e instanceof Ry}var OD=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function kD(e,t){let n=t.mapping.mapResult(e.position);return{position:new OD(n.pos),mapResult:n}}function AD(e){return new OD(e)}function jD(e,t,n){let{selection:r}=t,i=null;if(UT(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);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 MD=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=BT(e,r.schema);if(i)if(o){let e=FE(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 jD(r,n,c)},ND=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),PD=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=ET(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Fb(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Fb(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},FD=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=WT(e,0,n.content.size),i=Ry.create(n,r);t.setSelection(i)}return!0},ID=(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},LD=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=Iy.atStart(n).from,o=Iy.atEnd(n).to,s=WT(r,a,o),c=WT(i,a,o),l=Iy.create(n,s,c);t.setSelection(l)}return!0},RD=e=>({state:t,dispatch:n})=>qb(ET(e,t.schema))(t,n);function zD(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 BD=({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=vD(l,s.node().type.name,s.node().attrs);if(a instanceof Ry&&a.node.isBlock)return!s.parentOffset||!ny(o,s.pos)?!1:(r&&(e&&zD(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:aE(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=ny(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&ny(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 Iy&&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&&zD(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},VD=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=ET(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=U.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=U.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={...vD(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(U.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new W(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(Iy.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...vD(d,u.type.name,u.attrs),...t},m={...vD(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(!ny(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};function HD(e){return!e||e===`1`?null:e}function UD(e,t){return HD(e)===HD(t)}var WD=(e,t)=>{let n=zE(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&&iy(e.doc,n.pos))||!UD(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},GD=(e,t)=>{let n=zE(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&&iy(e.doc,r))||!UD(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function KD(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return Iy.between(r,i)}var qD=(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=ET(e,o.schema),m=ET(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=zE(e=>TD(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&&TD(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=KD(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(TD(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>WD(a,p)).command(()=>GD(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>WD(a,p)).command(()=>GD(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(()=>WD(a,p)).command(()=>GD(a,p)).run()},JD=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=BT(e,r.schema);return bD(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},YD=(e,t,n={})=>({state:r,commands:i})=>{let a=ET(e,r.schema),o=ET(t,r.schema),s=vE(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})},XD=(e,t={})=>({state:n,commands:r})=>{let i=ET(e,n.schema);return vE(n,i,t)?r.lift(i):r.wrapIn(i,t)},ZD=()=>({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},QD=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},$D=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=BT(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=zT(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},eO=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},tO=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=CE(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=ET(e,r.schema)),s===`mark`&&(o=BT(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},nO=new rb(`__tiptap_decorations__`),rO=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(nO,{type:`force`,name:e}),!0),iO=(e,t={})=>({state:n,dispatch:r})=>Pb(ET(e,n.schema),t)(n,r),aO=(e,t={})=>({state:n,dispatch:r})=>Vb(ET(e,n.schema),t)(n,r),oO=e_({blur:()=>yT,clearContent:()=>bT,clearNodes:()=>xT,command:()=>ST,createParagraphNear:()=>CT,cut:()=>wT,deleteCurrentNode:()=>TT,deleteNode:()=>DT,deleteRange:()=>OT,deleteSelection:()=>MT,enter:()=>NT,exitCode:()=>PT,extendMarkRange:()=>VT,first:()=>HT,focus:()=>YT,forEach:()=>XT,insertContent:()=>ZT,insertContentAt:()=>iE,insertDefaultBlock:()=>oE,joinBackward:()=>lE,joinDown:()=>cE,joinForward:()=>uE,joinItemBackward:()=>dE,joinItemForward:()=>fE,joinTextblockBackward:()=>pE,joinTextblockForward:()=>mE,joinUp:()=>sE,keyboardShortcut:()=>_E,lift:()=>yE,liftEmptyBlock:()=>bE,liftListItem:()=>xE,newlineInCode:()=>SE,resetAttributes:()=>TE,scrollIntoView:()=>EE,selectAll:()=>DE,selectNodeBackward:()=>OE,selectNodeForward:()=>kE,selectParentNode:()=>AE,selectTextblockEnd:()=>jE,selectTextblockStart:()=>ME,setContent:()=>PE,setMark:()=>MD,setMeta:()=>ND,setNode:()=>PD,setNodeSelection:()=>FD,setTextDirection:()=>ID,setTextSelection:()=>LD,sinkListItem:()=>RD,splitBlock:()=>BD,splitListItem:()=>VD,toggleList:()=>qD,toggleMark:()=>JD,toggleNode:()=>YD,toggleWrap:()=>XD,undoInputRule:()=>ZD,unsetAllMarks:()=>QD,unsetMark:()=>$D,unsetTextDirection:()=>eO,updateAttributes:()=>tO,updateDecorations:()=>rO,wrapIn:()=>iO,wrapInList:()=>aO}),sO=new WeakMap;function cO(e,t){sO.set(e,(sO.get(e)??0)+1);try{return t()}finally{let t=(sO.get(e)??1)-1;t>0?sO.set(e,t):sO.delete(e)}}function lO(e){return sO.has(e)}var uO=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={}}},dO=typeof process<`u`&&!1;function fO(e){return e.kind===`widget`}function pO(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&fO(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function Lee(e,t,n){let{decorations:r,widgetKeys:i}=pO(t,n);return{set:jw.create(e,r),widgetKeys:i}}function mO({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function Ree({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>mO({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function hO(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function zee(e){let t=new Map,n=new Map;for(let r of e.find()){let e=hO(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function gO(e){return e.jsonID===`attr`}function Bee(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||gO(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function Vee(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function Hee(e,t){if(e.steps.some(e=>!Bee(e)))return{type:`full`};let n=pD(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!gO(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=Vee(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function _O(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function vO(e,t,n){let r=t.decorationSetsByExtension[e]??jw.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:_O(r,n.mapping,n.doc,i),widgetKeys:i}}function yO(e,t){let n=Object.values(t).flatMap(e=>e.find());return jw.create(e,n)}function bO(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function xO(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function SO(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var CO=new Set,wO=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=nO.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>xO(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return nO.getState(this.editor.state)?.widgetKeys??CO}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new eb({key:nO,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:bO(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(nO),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return cO(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!SO(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=vO(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:bO(u)}}},props:{decorations(e){return nO.getState(e)?.mergedDecorationSet??jw.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=Hee(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??jw.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=_O(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>mO({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=hO(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=pO(Ree({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return Lee(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!dO)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=zee(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:yO(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):yO(n.doc,r)}};function TO(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof Ry){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}function EO(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}function DO(e,t){let n=e.getAttribute(`style`);if(!n)return null;let r=n.split(`;`).map(e=>e.trim()).filter(Boolean),i=t.toLowerCase();for(let e=r.length-1;e>=0;--e){let t=r[e],n=t.indexOf(`:`);if(n!==-1&&t.slice(0,n).trim().toLowerCase()===i)return t.slice(n+1).trim()}return null}function OO(e){return typeof e==`number`}function kO(e){return Object.prototype.toString.call(e).slice(8,-1)}function AO(e){return kO(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function jO(e,t,n){let r=e.split(`
160
+ `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],u=e.match(t.itemPattern);if(!u){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}else return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o<r.length;){var c;let e=r[o];if(e.trim()===``){var l;let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}else break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(`
161
+ `);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var MO=4;function NO(e){let t=0;for(let n of e)t=n===` `?t+MO-t%MO:t+1;return t}function PO(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=NO(a);return(NO(n)>=r?n:` `.repeat(r))+e},o=r.split(`
162
+ `).map(e=>n(e||``)).join(`
163
+ `);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function FO(e,t){let n={...e};return AO(e)&&AO(t)&&Object.keys(t).forEach(r=>{AO(t[r])&&AO(e[r])?n[r]=FO(e[r],t[r]):n[r]=t[r]}),n}function IO(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 LO=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},RO=(e,t)=>{if(FT(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 zO(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=yD(c)+i;return a.forEach(e=>{if(l)return;let a=RO(u,e.find);if(!a)return;let d=a[0].length-i.length;if(d>0){let e=c.parentOffset-d;if(e<0||c.parent.textBetween(e,c.parentOffset)!==a[0].slice(0,d))return}let f=s.state.tr,p=_T({state:s.state,transaction:f}),m={from:n-(a[0].length-i.length),to:r},{commands:h,chain:g,can:_}=new vT({editor:t,state:p});e.handler({state:p,range:m,match:a,commands:h,chain:g,can:_})===null||!f.steps.length||(e.undoable&&f.setMeta(o,{transform:f,from:n,to:r,text:i}),s.dispatch(f),l=!0)}),l}function BO(e){let{editor:t,rules:n}=e,r=new eb({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:HE(U.from(e),a.schema);let{from:i}=s,o=i+e.length;zO({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return zO({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&zO({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?zO({editor:t,from:a.pos,to:a.pos,text:`
164
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var VO=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{...WE(BE(this,`addOptions`,{name:this.name}))}}get storage(){return{...WE(BE(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>FO(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}},HO=class e extends VO{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}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)}},UO=class{constructor(e){this.find=e.find,this.handler=e.handler}},WO=(e,t,n)=>{if(FT(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 GO(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new vT({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if(!((f=e.type)==null||(f=f.spec)==null)&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||WO(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+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 KO=null,qO=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function JO(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,l=_T({state:e,transaction:c});if(!(!GO({editor:t,state:l,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 eb({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(KO=t)},i=()=>{KO&&=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=KO;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:HE(U.from(t),r.schema);let{from:n}=d,i=n+t.length,a=qO(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(!(!OO(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var YO=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=aD(e),this.schema=nD(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=BE(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:_D(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=iD([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:_D(t.name,this.schema)},r=[],i=BE(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&BE(t,`exitable`,n)&&(a.ArrowRight=()=>HO.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=hT(a);r.push(o);let s=BE(t,`addInputRules`,n);if(wD(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=BO({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=BE(t,`addPasteRules`,n);if(wD(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=JO({editor:e,rules:t});r.push(...n)}}let l=BE(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=BE(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:_D(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new wO({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return qE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=KE(this.extensions);return Object.fromEntries(t.filter(e=>!!BE(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=BE(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ET(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=ZE(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return iD([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:_D(n.name,this.schema)},i=BE(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return iD([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:_D(n.name,this.schema)},i=BE(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}=KE(this.extensions);return Object.fromEntries(t.filter(e=>!!BE(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=BE(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:BT(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=ZE(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{IO(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.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.decorationManager=null,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:_D(e.name,this.schema)};e.type===`mark`&&((WE(BE(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(WE(BE(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=BE(e,`onBeforeCreate`,t),r=BE(e,`onCreate`,t),i=BE(e,`onUpdate`,t),a=BE(e,`onSelectionUpdate`,t),o=BE(e,`onTransaction`,t),s=BE(e,`onFocus`,t),c=BE(e,`onBlur`,t),l=BE(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)})}};YO.resolve=aD,YO.sort=iD,YO.flatten=VE;var XO=class e extends VO{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},ZO=XO.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new eb({key:new rb(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=cD(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>oD(r,{from:e.pos,to:t.pos},s)).join(o??`
165
+
166
+ `)}}})]}}),QO=XO.create({name:`commands`,addCommands(){return{...oO}}}),$O=XO.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=IE(e.before,[e,...t]);pD(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof Pv){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.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:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),ek=XO.create({name:`drop`,addProseMirrorPlugins(){return[new eb({key:new rb(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),tk=XO.create({name:`editable`,addProseMirrorPlugins(){return[new eb({key:new rb(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),nk=new rb(`focusEvents`),rk=XO.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new eb({key:nk,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}}}})]}}),ik=XO.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:My.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 qT()||hE()?i:r},addProseMirrorPlugins(){return[new eb({key:new rb(`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=My.atStart(t.doc).from,l=My.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!ED(n.doc))return;let u=n.tr,d=_T({state:n,transaction:u}),{commands:f}=new vT({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),ak=XO.create({name:`paste`,addProseMirrorPlugins(){return[new eb({key:new rb(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),ok=XO.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new eb({key:new rb(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),sk=XO.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=KE(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 eb({key:new rb(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),ck=!1;function lk(e){if(ck)return;ck=!0;let t;try{t=Lv.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof U||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var uk=class e{get name(){return this.node.type.name}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 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’t 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),n=this.resolvedPos.doc.resolve(t);return new e(n,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=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),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)}},dk=`.ProseMirror {
167
+ position: relative;
168
+ }
169
+
170
+ .ProseMirror {
171
+ word-wrap: break-word;
172
+ white-space: pre-wrap;
173
+ white-space: break-spaces;
174
+ -webkit-font-variant-ligatures: none;
175
+ font-variant-ligatures: none;
176
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
177
+ }
178
+
179
+ .ProseMirror [contenteditable="false"] {
180
+ white-space: normal;
181
+ }
182
+
183
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
184
+ white-space: pre-wrap;
185
+ }
186
+
187
+ .ProseMirror pre {
188
+ white-space: pre-wrap;
189
+ }
190
+
191
+ img.ProseMirror-separator {
192
+ display: inline !important;
193
+ border: none !important;
194
+ margin: 0 !important;
195
+ width: 0 !important;
196
+ height: 0 !important;
197
+ }
198
+
199
+ .ProseMirror-gapcursor {
200
+ display: none;
201
+ pointer-events: none;
202
+ position: absolute;
203
+ margin: 0;
204
+ }
205
+
206
+ .ProseMirror-gapcursor:after {
207
+ content: "";
208
+ display: block;
209
+ position: absolute;
210
+ top: -2px;
211
+ width: 20px;
212
+ border-top: 1px solid black;
213
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
214
+ }
215
+
216
+ @keyframes ProseMirror-cursor-blink {
217
+ to {
218
+ visibility: hidden;
219
+ }
220
+ }
221
+
222
+ .ProseMirror-hideselection *::selection {
223
+ background: transparent;
224
+ }
225
+
226
+ .ProseMirror-hideselection *::-moz-selection {
227
+ background: transparent;
228
+ }
229
+
230
+ .ProseMirror-hideselection * {
231
+ caret-color: transparent;
232
+ }
233
+
234
+ .ProseMirror-focused .ProseMirror-gapcursor {
235
+ display: block;
236
+ }`,fk=class extends uO{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:kD,createMappablePosition:AD},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),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();if(!this.editorState){let e=GT(t,this.options.autofocus);this.editorState=Qy.create({doc:t,schema:this.schema,selection:e||void 0})}lk(this.schema),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),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():vT.createFakeChain()}can(){return this.commandManager?this.commandManager.can():vT.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=EO(dk,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.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[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 dO&&!this.hasWarnedStaleDecorationRead&&lO(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=UE(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(){var e,t;let n=[...this.options.enableCoreExtensions?[tk,ZO.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),QO,rk,ik,ok.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),ek,ak,$O,sk.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new YO(n,this)}createCommandManager(){this.commandManager=new vT({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=NE(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=NE(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Qy.create({doc:t,schema:this.schema,selection:GT(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,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()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Yw(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${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 uD(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return xD(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return HE(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
237
+
238
+ `,textSerializers:n={}}=e||{};return sD(this.state.doc,{blockSeparator:t,textSerializers:{...cD(this.schema),...n}})}get isEmpty(){return ED(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}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){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new uk(t,this,!1,n)}get $doc(){return this.$pos(0)}};function pk(e){return new LO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=WE(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(mD(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 mk(e){return new LO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=WE(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 hk(e){return new LO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=WE(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 gk(e){return new LO({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=WE(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Kv(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&&iy(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var _k=e=>`touches`in e,vk=class{constructor(e){var t;this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),!(e==null||(t=e.options)==null)&&t.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,!this.onUpdate||this.onUpdate(e,t,n)):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,_k(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},yk=class e extends VO{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},bk=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=()=>{try{return t.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){let{view:t}=this.editor,n=e.target,r=n.nodeType===3?n.parentElement?.closest(`[data-drag-handle]`):n.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(n)||!r)return;let i=0,a=0;if(this.dom!==r){let t=this.dom.getBoundingClientRect(),n=r.getBoundingClientRect(),o=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;i=n.x-t.x+o,a=n.y-t.y+s}let o=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();o.style.width=`${Math.round(e.width)}px`,o.style.height=`${Math.round(e.height)}px`,o.style.boxSizing=`border-box`,o.style.pointerEvents=`none`}catch{}let s=null;try{var c;s=document.createElement(`div`),s.style.position=`absolute`,s.style.top=`-9999px`,s.style.left=`-9999px`,s.style.pointerEvents=`none`,s.appendChild(o),document.body.appendChild(s),(c=e.dataTransfer)==null||c.setDragImage(o,i,a)}finally{s&&setTimeout(()=>{try{s?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=Ry.create(t.state.doc,l),d=t.state.tr.setSelection(u);t.dispatch(d)}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===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=Ry.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){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!(o||r||i||l||u||d||f&&c)}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.contentDOM.contains(e.target)&&e.type===`childList`&&(qT()||KT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`||!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})}};function xk(e){return new UO({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=WE(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(mD(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{getOwnPropertyNames:Sk,getOwnPropertySymbols:Ck}=Object,{hasOwnProperty:wk}=Object.prototype;function Tk(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Ek(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Dk(e){return e?.[Symbol.toStringTag]}function Ok(e){return Sk(e).concat(Ck(e))}var kk=Object.hasOwn||((e,t)=>wk.call(e,t));function Ak(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var jk=`__v`,Mk=`__o`,Nk=`_owner`,{getOwnPropertyDescriptor:Pk,keys:Fk}=Object;function Ik(e,t){return e.byteLength===t.byteLength&&Yk(new Uint8Array(e),new Uint8Array(t))}function Lk(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Rk(e,t){return e.byteLength===t.byteLength&&Yk(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function zk(e,t){return Ak(e.getTime(),t.getTime())}function Bk(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Vk(e,t){return e===t}function Hk(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Uk=Ak;function Wk(e,t,n){let r=Fk(e),i=r.length;if(Fk(t).length!==i)return!1;for(;i-->0;)if(!Zk(e,t,n,r[i]))return!1;return!0}function Gk(e,t,n){let r=Ok(e),i=r.length;if(Ok(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!Zk(e,t,n,a)||(o=Pk(e,a),s=Pk(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Kk(e,t){return Ak(e.valueOf(),t.valueOf())}function qk(e,t){return e.source===t.source&&e.flags===t.flags}function Jk(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function Yk(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function Xk(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Zk(e,t,n,r){return(r===Nk||r===Mk||r===jk)&&(e.$$typeof||t.$$typeof)?!0:kk(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Qk=`[object ArrayBuffer]`,$k=`[object Arguments]`,eA=`[object Boolean]`,tA=`[object DataView]`,nA=`[object Date]`,rA=`[object Error]`,iA=`[object Map]`,aA=`[object Number]`,oA=`[object Object]`,sA=`[object RegExp]`,cA=`[object Set]`,lA=`[object String]`,uA={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},dA=`[object URL]`,fA=Object.prototype.toString;function pA({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=fA.call(h);if(b===nA)return r(h,g,_);if(b===sA)return u(h,g,_);if(b===iA)return o(h,g,_);if(b===cA)return d(h,g,_);if(b===oA)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===dA)return p(h,g,_);if(b===rA)return i(h,g,_);if(b===$k)return c(h,g,_);if(uA[b])return f(h,g,_);if(b===Qk)return e(h,g,_);if(b===tA)return n(h,g,_);if(b===eA||b===aA||b===lA)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Dk(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function mA({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Ik,areArraysEqual:n?Gk:Lk,areDataViewsEqual:Rk,areDatesEqual:zk,areErrorsEqual:Bk,areFunctionsEqual:Vk,areMapsEqual:n?Tk(Hk,Gk):Hk,areNumbersEqual:Uk,areObjectsEqual:n?Gk:Wk,arePrimitiveWrappersEqual:Kk,areRegExpsEqual:qk,areSetsEqual:n?Tk(Jk,Gk):Jk,areTypedArraysEqual:n?Tk(Yk,Gk):Yk,areUrlsEqual:Xk,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Ek(r.areArraysEqual),t=Ek(r.areMapsEqual),n=Ek(r.areObjectsEqual),i=Ek(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function hA(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function gA({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var _A=vA();vA({strict:!0}),vA({circular:!0}),vA({circular:!0,strict:!0}),vA({createInternalComparator:()=>Ak}),vA({strict:!0,createInternalComparator:()=>Ak}),vA({circular:!0,createInternalComparator:()=>Ak}),vA({circular:!0,createInternalComparator:()=>Ak,strict:!0});function vA(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=pA(mA(e));return gA({circular:t,comparator:a,createState:r,equals:n?n(a):hA(a),strict:i})}var yA=o((e=>{var t=d(),n=Qg();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}})),bA=o(((e,t)=>{t.exports=yA()})),xA=Qg(),SA=bA(),CA=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},wA=({contentComponent:e})=>{let t=(0,xA.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,I.jsx)(I.Fragment,{children:Object.values(t)})};function TA(){let e=new Set,t={},n=!1,r=()=>{n||!e.size||(n=!0,queueMicrotask(()=>{n=!1,e.forEach(e=>e())}))};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,n){t={...t,[e]:gd.createPortal(n.reactElement,n.element,e)},r()},removeRenderer(e){let n={...t};delete n[e],t=n,r()}}}var EA=class extends F.Component{constructor(e){super(e),this.editorContentRef=F.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=TA(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{ref:CA(t,this.editorContentRef),...n}),e?.contentComponent&&(0,I.jsx)(wA,{contentComponent:e.contentComponent})]})}},DA=(0,F.forwardRef)((e,t)=>{let n=F.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return F.createElement(EA,{key:n,innerRef:t,...e})}),OA=F.memo(DA),kA=typeof window<`u`?F.useLayoutEffect:F.useEffect,AA=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,t=t=>{t?.transaction!==void 0&&t.transaction===e||(e=t?.transaction,this.transactionNumber+=1,this.subscribers.forEach(e=>e()))},n=this.editor;return n.on(`transaction`,t),n.on(`update`,t),()=>{n.off(`transaction`,t),n.off(`update`,t)}}}};function jA(e){let[t]=(0,F.useState)(()=>new AA(e.editor)),n=(0,SA.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??_A);return kA(()=>t.watch(e.editor),[e.editor,t]),(0,F.useDebugValue)(n),n}var MA=typeof window>`u`,NA=MA||!!(typeof window<`u`&&window.next),PA=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(){let e=this.options.current.immediatelyRender,t=e??!0;return(MA||NA&&e===void 0)&&(t=!1),t?this.createEditor():null}createEditor(){return new fk({...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)},onMount:(...e)=>{var t;return(t=this.options.current).onMount?.call(t,...e)},onUnmount:(...e)=>{var t;return(t=this.options.current).onUnmount?.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]):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 FA(e={},t=[]){let n=(0,F.useRef)(e);n.current=e;let[r]=(0,F.useState)(()=>new PA(n)),i=(0,xA.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,F.useDebugValue)(i),(0,F.useEffect)(r.onRender(t)),jA({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var IA=(0,F.createContext)({editor:null});IA.Consumer;var LA=(0,F.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),RA=()=>(0,F.useContext)(LA),zA=F.forwardRef((e,t)=>{let{onDragStart:n}=RA();return(0,I.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function BA(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function VA(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function HA(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function UA(e){if(BA(e)||VA(e))return!0;if(HA(e)){let t=e.type;if(t)return BA(t)||VA(t)}return!1}function WA(){try{if(F.version)return parseInt(F.version.split(`.`)[0],10)>=19}catch{}return!1}var GA=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,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.isEditorContentInitialized?(0,gd.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=WA(),a=UA(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,I.jsx)(t,{...o}),r==null||(e=r.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==this.props[i]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;let t=this.editor;t==null||(e=t.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};F.createContext({markViewContentRef:()=>{}});function KA(e){var t;let n=e.getRootNode(),r=typeof n.getSelection==`function`?n.getSelection():(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.getSelection();if(!r||r.rangeCount===0)return null;let{anchorNode:i,anchorOffset:a,focusNode:o,focusOffset:s}=r;return!i||!o||!e.contains(i)||!e.contains(o)?null:()=>{try{r.setBaseAndExtent(i,a,o,s)}catch{}}}function qA(e,t,n){return e.node(n)===t.node(n)&&e.before(n)===t.before(n)}function JA(e){if(!UT(e))return[];let{$from:t,$to:n}=e,r=[],i=Math.min(t.depth,n.depth);for(let e=1;e<=i&&qA(t,n,e);e+=1)r.push(t.before(e));return r}var YA=class{constructor(e){this.views=new WeakMap,this.viewCount=0,this.insideViews=new Set,this.syncQueued=!1,this.scheduleSync=()=>{this.syncQueued||(this.syncQueued=!0,queueMicrotask(()=>{this.syncQueued=!1,this.sync()}))},this.handleTransaction=()=>this.scheduleSync(),this.editor=e}register(e){this.viewCount===0&&this.editor.on(`transaction`,this.handleTransaction),this.views.set(e.dom,e),this.viewCount+=1,this.scheduleSync()}unregister(e){this.views.delete(e.dom),--this.viewCount,this.insideViews.delete(e),this.viewCount===0&&this.editor.off(`transaction`,this.handleTransaction)}sync(){if(this.viewCount===0||this.editor.isDestroyed)return;let e=this.findInsideViews();this.updateViews(this.insideViews,e,!1),this.updateViews(e,this.insideViews,!0),this.insideViews=e}updateViews(e,t,n){for(let r of e)t.has(r)||r.setSelectionInside(n)}findInsideViews(){let e=new Set;for(let t of JA(this.editor.state.selection)){let n=this.editor.view.nodeDOM(t),r=n?this.views.get(n):void 0;r&&e.add(r)}return e}},XA=new WeakMap;function ZA(e){let t=XA.get(e);return t||(t=new YA(e),XA.set(e,t)),t}var QA=class extends bk{constructor(e,t,n){if(super(e,t,n),this.nodeSelected=!1,this.handlePositionUpdate=()=>{let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!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]`);e?e.appendChild(this.contentDOMElement):this.dom.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on(`update`,this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,selectionInside:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,F.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=>{if(e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement){e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`);let t=KA(this.contentDOMElement);e.appendChild(this.contentDOMElement),t?.()}}},n=this.component,r=(0,F.memo)(e=>(0,I.jsx)(LA.Provider,{value:t,children:(0,F.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.renderer=new GA(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),ZA(this.editor).register(this),this.updateElementAttributes(),this.currentPos=this.getPos()}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}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.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;let i=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i;let a={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(a.getPos=()=>this.getPos()),r(a),!0}selectNode(){this.nodeSelected=!0,this.updateSelectedState(!0)}deselectNode(){this.nodeSelected=!1,this.updateSelectedState(this.options.selectedOnTextSelection===!0&&this.isTextSelectionInside())}setSelectionInside(e){let t=this.nodeSelected||this.options.selectedOnTextSelection===!0&&e;this.renderer.updateProps({selectionInside:e,selected:t}),this.renderer.element.classList.toggle(`ProseMirror-selectednode`,t)}updateSelectedState(e){this.renderer.updateProps({selected:e}),this.renderer.element.classList.toggle(`ProseMirror-selectednode`,e)}isTextSelectionInside(){let e=this.getPos();return typeof e==`number`&&JA(this.editor.state.selection).includes(e)}destroy(){this.renderer.destroy(),ZA(this.editor).unregister(this),this.options.trackNodeViewPosition&&this.editor.off(`update`,this.handlePositionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=ZE(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function $A(e,t){return n=>n.editor.contentComponent?new QA(e,n,t):{dom:document.createElement(`span`),contentDOM:null,update:()=>!1,destroy:()=>{},selectNode:()=>{},deselectNode:()=>{},stopEvent:()=>!1,ignoreMutation:()=>!0}}var ej=(0,F.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});ej.displayName=`TiptapContext`;var tj=()=>(0,F.useContext)(ej);function nj({children:e,...t}){let n=`editor`in t?t.editor:t.instance;if(!n)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let r=(0,F.useMemo)(()=>({editor:n}),[n]),i=(0,F.useMemo)(()=>({editor:n}),[n]);return(0,I.jsx)(IA.Provider,{value:i,children:(0,I.jsx)(ej.Provider,{value:r,children:e})})}nj.displayName=`Tiptap`;function rj({...e}){let{editor:t}=tj();return(0,I.jsx)(OA,{editor:t,...e})}rj.displayName=`Tiptap.Content`,Object.assign(nj,{Content:rj});var ij=new WeakSet,aj=new WeakSet;function oj(e){let t=e;return ij.add(t),t}function sj(e){return Array.isArray(e)&&ij.has(e)}function cj(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&aj.has(e)&&!sj(e)?cj(e):[e])}function lj(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!sj(n)&&!aj.has(n)?oj(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(sj(n))return oj([e,r,n]);if(n.length===0)return oj([e,r]);let t=cj(n);return t.length===0?oj([e,r]):oj([e,r,...t])}return oj(n==null?[e,r]:[e,r,n])}var uj=(e,t)=>lj(e,t),dj=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new W(n,0,0);return e.replace(l,i.after(),r),e.setSelection(Iy.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},fj=/^\s*>\s$/,pj=yk.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return uj(`blockquote`,{...XE(this.options.HTMLAttributes,e),children:uj(`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(`
239
+ `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
240
+ `))}),n.join(`
241
+ >
242
+ `)},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(),Backspace:()=>dj(this.editor,this.type)}},addInputRules(){return[gk({find:fj,type:this.type})]}}),mj=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,hj=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,gj=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,_j=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,vj=HO.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 uj(`strong`,{...XE(this.options.HTMLAttributes,e),children:uj(`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[pk({find:mj,type:this.type}),pk({find:gj,type:this.type})]},addPasteRules(){return[xk({find:hj,type:this.type}),xk({find:_j,type:this.type})]}}),yj=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},bj=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},xj=HO.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,XE(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[pk({find:yj,type:this.type})]},addPasteRules(){return[xk({find:bj,type:this.type})]}}),Sj=4,Cj=/^```([a-z]+)?[\s\n]$/,wj=/^~~~([a-z]+)?[\s\n]$/,Tj=yk.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Sj,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`,XE(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(`
243
+ `):`\`\`\`${r}\n\n\`\`\``,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??Sj,{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,`
244
+ `,`
245
+ `).split(`
246
+ `).map(e=>o+e).join(`
247
+ `);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??Sj,{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,`
248
+ `,`
249
+ `).split(`
250
+ `),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(Iy.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
251
+ `,`
252
+ `).split(`
253
+ `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
254
+ `);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(`
255
+
256
+ `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},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(My.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[hk({find:Cj,type:this.type,getAttributes:e=>({language:e[1]})}),hk({find:wj,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new eb({key:new rb(`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,`
257
+ `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(Iy.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),Ej=yk.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
258
+
259
+ `):``}),Dj=yk.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`,XE(this.options.HTMLAttributes,e)]},renderText(){return`
260
+ `},renderMarkdown:()=>`
261
+ `,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}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Oj=yk.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]}`,XE(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=>hk({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),kj=yk.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,XE(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!TO(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return DD(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(Iy.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(Ry.create(t.doc,n.pos)):t.setSelection(Iy.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(Iy.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[mk({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Aj=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,jj=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Mj=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Nj=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Pj=HO.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`,XE(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[pk({find:Aj,type:this.type}),pk({find:Mj,type:this.type})]},addPasteRules(){return[xk({find:jj,type:this.type}),xk({find:Nj,type:this.type})]}}),Fj=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Ij=`ελ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`,Lj=`numeric`,Rj=`ascii`,zj=`alpha`,Bj=`asciinumeric`,Vj=`alphanumeric`,Hj=`domain`,Uj=`emoji`,Wj=`scheme`,Gj=`slashscheme`,Kj=`whitespace`;function qj(e,t){return e in t||(t[e]=[]),t[e]}function Jj(e,t,n){t[Lj]&&(t[Bj]=!0,t[Vj]=!0),t[Rj]&&(t[Bj]=!0,t[zj]=!0),t[Bj]&&(t[Vj]=!0),t[zj]&&(t[Vj]=!0),t[Vj]&&(t[Hj]=!0),t[Uj]&&(t[Hj]=!0);for(let r in t){let t=qj(r,n);t.indexOf(e)<0&&t.push(e)}}function Yj(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Xj(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Xj.groups={},Xj.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||=Xj.groups;let i;return t&&t.j?i=t:(i=new Xj(t),n&&r&&Jj(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||=Xj.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 Xj,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new Xj,a&&(r&&(o.t&&typeof o.t==`string`?Jj(a,Object.assign(Yj(o.t,r),n),r):n&&Jj(a,n,r)),o.t=a),i.j[e]=o,o}};var Zj=(e,t,n,r,i)=>e.ta(t,n,r,i),Qj=(e,t,n,r,i)=>e.tr(t,n,r,i),$j=(e,t,n,r,i)=>e.ts(t,n,r,i),G=(e,t,n,r,i)=>e.tt(t,n,r,i),eM=`WORD`,tM=`UWORD`,nM=`ASCIINUMERICAL`,rM=`ALPHANUMERICAL`,iM=`LOCALHOST`,aM=`TLD`,oM=`UTLD`,sM=`SCHEME`,cM=`SLASH_SCHEME`,lM=`NUM`,uM=`WS`,dM=`NL`,fM=`OPENBRACE`,pM=`CLOSEBRACE`,mM=`OPENBRACKET`,hM=`CLOSEBRACKET`,gM=`OPENPAREN`,_M=`CLOSEPAREN`,vM=`OPENANGLEBRACKET`,yM=`CLOSEANGLEBRACKET`,bM=`FULLWIDTHLEFTPAREN`,xM=`FULLWIDTHRIGHTPAREN`,SM=`LEFTCORNERBRACKET`,CM=`RIGHTCORNERBRACKET`,wM=`LEFTWHITECORNERBRACKET`,TM=`RIGHTWHITECORNERBRACKET`,EM=`FULLWIDTHLESSTHAN`,DM=`FULLWIDTHGREATERTHAN`,OM=`AMPERSAND`,kM=`APOSTROPHE`,AM=`ASTERISK`,jM=`AT`,MM=`BACKSLASH`,NM=`BACKTICK`,PM=`CARET`,FM=`COLON`,IM=`COMMA`,LM=`DOLLAR`,RM=`DOT`,zM=`EQUALS`,BM=`EXCLAMATION`,VM=`HYPHEN`,HM=`PERCENT`,UM=`PIPE`,WM=`PLUS`,GM=`POUND`,KM=`QUERY`,qM=`QUOTE`,JM=`FULLWIDTHMIDDLEDOT`,YM=`SEMI`,XM=`SLASH`,ZM=`TILDE`,QM=`UNDERSCORE`,$M=`EMOJI`,eN=`SYM`,tN=Object.freeze({__proto__:null,ALPHANUMERICAL:rM,AMPERSAND:OM,APOSTROPHE:kM,ASCIINUMERICAL:nM,ASTERISK:AM,AT:jM,BACKSLASH:MM,BACKTICK:NM,CARET:PM,CLOSEANGLEBRACKET:yM,CLOSEBRACE:pM,CLOSEBRACKET:hM,CLOSEPAREN:_M,COLON:FM,COMMA:IM,DOLLAR:LM,DOT:RM,EMOJI:$M,EQUALS:zM,EXCLAMATION:BM,FULLWIDTHGREATERTHAN:DM,FULLWIDTHLEFTPAREN:bM,FULLWIDTHLESSTHAN:EM,FULLWIDTHMIDDLEDOT:JM,FULLWIDTHRIGHTPAREN:xM,HYPHEN:VM,LEFTCORNERBRACKET:SM,LEFTWHITECORNERBRACKET:wM,LOCALHOST:iM,NL:dM,NUM:lM,OPENANGLEBRACKET:vM,OPENBRACE:fM,OPENBRACKET:mM,OPENPAREN:gM,PERCENT:HM,PIPE:UM,PLUS:WM,POUND:GM,QUERY:KM,QUOTE:qM,RIGHTCORNERBRACKET:CM,RIGHTWHITECORNERBRACKET:TM,SCHEME:sM,SEMI:YM,SLASH:XM,SLASH_SCHEME:cM,SYM:eN,TILDE:ZM,TLD:aM,UNDERSCORE:QM,UTLD:oM,UWORD:tM,WORD:eM,WS:uM}),nN=/[a-z]/,rN=/\p{L}/u,iN=/\p{Emoji}/u,aN=/\d/,oN=/\s/,sN=`\r`,cN=`
262
+ `,lN=`️`,uN=`‍`,dN=``,fN=null,pN=null;function mN(e=[]){let t={};Xj.groups=t;let n=new Xj;fN??=vN(Fj),pN??=vN(Ij),G(n,`'`,kM),G(n,`{`,fM),G(n,`}`,pM),G(n,`[`,mM),G(n,`]`,hM),G(n,`(`,gM),G(n,`)`,_M),G(n,`<`,vM),G(n,`>`,yM),G(n,`(`,bM),G(n,`)`,xM),G(n,`「`,SM),G(n,`」`,CM),G(n,`『`,wM),G(n,`』`,TM),G(n,`<`,EM),G(n,`>`,DM),G(n,`&`,OM),G(n,`*`,AM),G(n,`@`,jM),G(n,"`",NM),G(n,`^`,PM),G(n,`:`,FM),G(n,`,`,IM),G(n,`$`,LM),G(n,`.`,RM),G(n,`=`,zM),G(n,`!`,BM),G(n,`-`,VM),G(n,`%`,HM),G(n,`|`,UM),G(n,`+`,WM),G(n,`#`,GM),G(n,`?`,KM),G(n,`"`,qM),G(n,`/`,XM),G(n,`;`,YM),G(n,`~`,ZM),G(n,`_`,QM),G(n,`\\`,MM),G(n,`・`,JM);let r=Qj(n,aN,lM,{[Lj]:!0});Qj(r,aN,r);let i=Qj(r,nN,nM,{[Bj]:!0}),a=Qj(r,rN,rM,{[Vj]:!0}),o=Qj(n,nN,eM,{[Rj]:!0});Qj(o,aN,i),Qj(o,nN,o),Qj(i,aN,i),Qj(i,nN,i);let s=Qj(n,rN,tM,{[zj]:!0});Qj(s,nN),Qj(s,aN,a),Qj(s,rN,s),Qj(a,aN,a),Qj(a,nN),Qj(a,rN,a);let c=G(n,cN,dM,{[Kj]:!0}),l=G(n,sN,uM,{[Kj]:!0}),u=Qj(n,oN,uM,{[Kj]:!0});G(n,dN,u),G(l,cN,c),G(l,dN,u),Qj(l,oN,u),G(u,sN),G(u,cN),Qj(u,oN,u),G(u,dN,u);let d=Qj(n,iN,$M,{[Uj]:!0});G(d,`#`),Qj(d,iN,d),G(d,lN,d);let f=G(d,uN);G(f,`#`),Qj(f,iN,d);let p=[[nN,o],[aN,i]],m=[[nN,null],[rN,s],[aN,a]];for(let e=0;e<fN.length;e++)_N(n,fN[e],aM,eM,p);for(let e=0;e<pN.length;e++)_N(n,pN[e],oM,tM,m);Jj(aM,{tld:!0,ascii:!0},t),Jj(oM,{utld:!0,alpha:!0},t),_N(n,`file`,sM,eM,p),_N(n,`mailto`,sM,eM,p),_N(n,`http`,cM,eM,p),_N(n,`https`,cM,eM,p),_N(n,`ftp`,cM,eM,p),_N(n,`ftps`,cM,eM,p),Jj(sM,{scheme:!0,ascii:!0},t),Jj(cM,{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]?{[Wj]:!0}:{[Gj]:!0};r.indexOf(`-`)>=0?i[Hj]=!0:nN.test(r)?aN.test(r)?i[Bj]=!0:i[Rj]=!0:i[Lj]=!0,$j(n,r,r,i)}return $j(n,`localhost`,iM,{ascii:!0}),n.jd=new Xj(eN),{start:n,tokens:Object.assign({groups:t},tN)}}function hN(e,t){let n=gN(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 gN(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 _N(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 Xj(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new Xj(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function vN(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 yN={defaultProtocol:`http`,events:null,format:xN,formatHref:xN,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function bN(e,t=null){let n=Object.assign({},yN);e&&(n=Object.assign(n,e instanceof bN?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}bN.prototype={o:yN,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]:yN[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 xN(e){return e}function SN(e,t){this.t=`token`,this.v=e,this.tk=t}SN.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=yN.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 CN(e,t){class n extends SN{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 wN=CN(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),TN=CN(`text`),EN=CN(`nl`),DN=CN(`url`,{isLink:!0,toHref(e=yN.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==iM&&e[1].t===FM}}),ON=e=>new Xj(e);function kN({groups:e}){let t=e.domain.concat([OM,AM,jM,MM,NM,PM,LM,zM,VM,lM,HM,UM,WM,GM,XM,eN,ZM,QM]),n=[kM,FM,IM,RM,BM,HM,KM,qM,YM,vM,yM,fM,pM,hM,mM,gM,_M,bM,xM,SM,CM,wM,TM,EM,DM],r=[OM,kM,AM,MM,NM,PM,LM,zM,VM,fM,pM,HM,UM,WM,GM,KM,XM,eN,ZM,QM],i=ON(),a=G(i,ZM);Zj(a,r,a),Zj(a,e.domain,a);let o=ON(),s=ON(),c=ON();Zj(i,e.domain,o),Zj(i,e.scheme,s),Zj(i,e.slashscheme,c),Zj(o,r,a),Zj(o,e.domain,o);let l=G(o,jM);G(a,jM,l),G(s,jM,l),G(c,jM,l);let u=G(a,RM);Zj(u,r,a),Zj(u,e.domain,a);let d=ON();Zj(l,e.domain,d),Zj(d,e.domain,d);let f=G(d,RM);Zj(f,e.domain,d);let p=ON(wN);Zj(f,e.tld,p),Zj(f,e.utld,p),G(l,iM,p);let m=G(d,VM);G(m,VM,m),Zj(m,e.domain,d),Zj(p,e.domain,d),G(p,RM,f),G(p,VM,m);let h=G(o,VM),g=G(o,RM);G(h,VM,h),Zj(h,e.domain,o),Zj(g,r,a),Zj(g,e.domain,o);let _=ON(DN);Zj(g,e.tld,_),Zj(g,e.utld,_),Zj(_,e.domain,o),Zj(_,r,a),G(_,RM,g),G(_,VM,h),G(_,jM,l);let v=G(_,FM),y=ON(DN);Zj(v,e.numeric,y);let b=ON(DN),x=ON();Zj(b,t,b),Zj(b,n,x),Zj(x,t,b),Zj(x,n,x),G(_,XM,b),G(y,XM,b);let S=G(s,FM),C=G(G(G(c,FM),XM),XM);Zj(s,e.domain,o),G(s,RM,g),G(s,VM,h),Zj(c,e.domain,o),G(c,RM,g),G(c,VM,h),Zj(S,e.domain,b),G(S,XM,b),G(S,KM,b),Zj(C,e.domain,b),Zj(C,t,b),G(C,XM,b);let w=[[fM,pM],[mM,hM],[gM,_M],[vM,yM],[bM,xM],[SM,CM],[wM,TM],[EM,DM]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=G(b,r);G(x,r,a);let o=ON(DN);Zj(a,t,o);let s=ON();Zj(a,n,s),G(a,i,b),Zj(o,t,o),Zj(o,n,s),Zj(s,t,o),Zj(s,n,s),G(o,i,b),G(s,i,b)}return G(i,iM,_),G(i,dM,EN),{start:i,tokens:tN}}function AN(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(jN(TN,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(jN(e,t,r))}}return o.length>0&&a.push(jN(TN,t,o)),a}function jN(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var MN=typeof console<`u`&&console&&console.warn||(()=>{}),NN=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,PN={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function FN(){return Xj.groups={},PN.scanner=null,PN.parser=null,PN.tokenQueue=[],PN.pluginQueue=[],PN.customSchemes=[],PN.initialized=!1,PN}function IN(e,t=!1){if(PN.initialized&&MN(`linkifyjs: already initialized - will not register custom scheme "${e}" ${NN}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
263
+ 1. Must only contain digits, lowercase ASCII letters or "-"
264
+ 2. Cannot start or end with "-"
265
+ 3. "-" cannot repeat`);PN.customSchemes.push([e,t])}function LN(){PN.scanner=mN(PN.customSchemes);for(let e=0;e<PN.tokenQueue.length;e++)PN.tokenQueue[e][1]({scanner:PN.scanner});PN.parser=kN(PN.scanner.tokens);for(let e=0;e<PN.pluginQueue.length;e++)PN.pluginQueue[e][1]({scanner:PN.scanner,parser:PN.parser});return PN.initialized=!0,PN}function RN(e){return PN.initialized||LN(),AN(PN.parser.start,e,hN(PN.scanner.start,e))}RN.scan=hN;function zN(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 bN(n),i=RN(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 BN=`[\0- \xA0 ᠎ -\u2029  ]`,VN=new RegExp(BN),HN=RegExp(`${BN}$`),UN=new RegExp(BN,`g`);function WN(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function GN(e){return new eb({key:new rb(`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(pD(IE(n.doc,[...t])).forEach(({newRange:t})=>{let n=LE(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(!HN.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(VN).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=RN(n).map(t=>t.toObject(e.defaultProtocol));if(!WN(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)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{mD(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 KN(e){return new eb({key:new rb(`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=uD(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var qN=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Uee=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function JN(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function YN(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"){r+=1;continue}if(n===0&&JN(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function XN(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||JN(e,t.index??0)||YN(e,t.index??0)?!1:!!r.trim()&&n(i)}function ZN(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function QN(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function $N(e){return{href:e.data?.href,title:e.data?.title??null}}function eP(e){let t=pk({find:t=>{let n=qN.exec(t);return!n||!XN(t,n,e.isAllowedHref)?null:ZN(n)},type:e.type,getAttributes:$N});return new LO({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function tP(e){let t=xk({find:t=>{let n=[];for(let r of t.matchAll(Uee))XN(t,r,e.isAllowedHref)&&n.push(ZN(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>QN(t,e)));return[...n,...r]},type:e.type,getAttributes:$N});return new UO({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function nP(e){return new eb({key:new rb(`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=zN(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 rP(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(UN,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var iP=HO.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`){IN(e);return}IN(e.scheme,e.optionalSlashes)})},onDestroy(){FN()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!rP(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??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!rP(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=>!!rP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,XE(this.options.HTMLAttributes,e),0]:[`a`,XE(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=>!!rP(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=>!!rP(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()}},addInputRules(){return this.options.markdownLinks?[eP({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!rP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;zN(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!rP(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[tP({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!rP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[xk({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(GN({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!rP(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(KN({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(nP({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),aP=`listItem`,oP=`textStyle`,sP=/^\s*([-+*])\s$/,cP=yk.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`,XE(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,`
266
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(aP,this.editor.getAttributes(oP)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=gk({find:sP,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=gk({find:sP,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(oP),editor:this.editor})),[e]}}),lP=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},uP=(e,t,n,r)=>{let i=lP(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,U.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},dP=(e,t,n)=>uP(e.state,e.view.dispatch,t,n),fP=(e,t)=>XO.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>dP(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),pP=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],mP=`abcdefghijklmnopqrstuvwxyz`,hP=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function gP(e){let t=e,n=``;for(let[e,r]of pP)for(;t>=e;)n+=r,t-=e;return n}function _P(e){return gP(e).toUpperCase()}function vP(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of pP)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function yP(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=vP(e);return t<=0?!1:(e===e.toLowerCase()?gP(t):_P(t))===e}function bP(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function xP(e){if(e<=26)return mP[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?mP[n]:mP[t]+mP[n]}function SP(e){if(!(!e||/^\d+$/.test(e))){if(yP(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function CP(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=SP(e);if(t===`i`||t===`I`)return vP(e);if(t===`a`||t===`A`){let t=bP(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function wP(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return xP(t);case`A`:return xP(t).toUpperCase();case`i`:return gP(t);case`I`:return _P(t);default:return String(t)}}function TP(e){if(e.length===0)return!1;let t=SP(e[0])??`numeric`,n=CP(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=wP(t,n+r);if(e[r]!==i)return!1}return!0}function EP(e){return{type:SP(e),start:CP(e)}}function DP(e){let{type:t,start:n}=EP(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function OP(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${xP(r)}${n}`;case`A`:return`${xP(r).toUpperCase()}${n}`;case`i`:return`${gP(r)}${n}`;case`I`:return`${_P(r)}${n}`;default:return`${r}${n}`}}function kP(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function AP(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var jP=yk.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,XE(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(kP(e))return{type:`listItem`,content:[{type:`paragraph`,content:AP(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)=>PO(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){var t,n;let r=((t=e.meta)==null||(t=t.parentAttrs)==null?void 0:t.start)||1;return OP((n=e.meta)==null||(n=n.parentAttrs)==null?void 0:n.type,r-1+(e.index||0),`. `)}return`- `},n,{alignNestedToPrefix:n?.parentType===`orderedList`}),addExtensions(){return[fP(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),MP=(e,t)=>{let{$from:n}=t.selection,r=ET(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}},NP=(e,t)=>{let n=MP(e,t);if(!n)return!1;let[,r]=hD(t,e,n.$pos.pos+4);return r},PP=(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))},FP=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!vE(e.state,t)&&PP(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(!vE(e.state,t)||!CD(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},IP=(e,t)=>{let n=NP(e,t),r=MP(e,t);return!r||!n?!1:n>r.depth},LP=(e,t)=>{let n=NP(e,t),r=MP(e,t);return!r||!n?!1:n<r.depth},RP=(e,t)=>{if(!vE(e.state,t)||!SD(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:IP(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():LP(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},zP=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||vE(r,t))return!1;let o=gD(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,U.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,U.from(c)),e.setSelection(Iy.create(e.doc,d+1)),e.scrollIntoView()),!0))},BP=XO.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&&RP(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&&RP(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&&FP(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&&FP(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&zP(e,t,n))return!0;return!1}}}}),VP=RegExp(`^(\\s*)(${hP})([.)])\\s+(.*)$`),HP=/^\s/,UP={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function WP(e){return VP.test(e.trimStart())}function GP(e){let t=e.trimStart();return UP.bulletItem.test(t)||WP(t)||UP.heading.test(t)||UP.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||UP.codeFence.test(t)||UP.blockMath.test(t)}function KP(e){return Object.values(UP).some(t=>t.test(e))}function qP(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&&GP(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function JP(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(VP);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?SP(s):void 0,p=isNaN(d)?CP(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(VP))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(HP)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_||KP(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
267
+ `).trim(),contentLines:m,raw:g.join(`
268
+ `)}),r=h,n=h}return[t,r]}var YP=RegExp(`^(${hP})([.)])\\s+(.+)$`);function XP(e){let t=e.split(`
269
+ `).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(YP);if(!t)return null;n.push({marker:t[1],content:t[3]})}return TP(n.map(e=>e.marker))?{type:`orderedList`,attrs:DP(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function ZP(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=qP(a.contentLines),c=o.join(`
270
+ `).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
271
+ `).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=ZP(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
272
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function QP(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 $P=`listItem`,eF=`textStyle`,tF=/^(\d+)\.\s$/;function nF(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var rF=yk.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=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=nF(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=nF(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=XE(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?QP(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
273
+ `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(`
274
+ `),[i,a]=JP(r);if(i.length===0)return;let o=ZP(i,i[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(`
275
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes($P,this.editor.getAttributes(eF)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new eb({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=XP(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=gk({find:tF,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=gk({find:tF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(eF)}),joinPredicate:e,editor:this.editor})),[t]}}),iF=/^\s*(\[([( |x])?\])\s$/,aF=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,oF=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},sF=yk.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,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,XE(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)=>PO(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[fP(this.name,[this.options.taskListTypeName])]:[]},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`);o.style.cssText=aF;let l=e=>{let t=oF(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};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=ZE(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[gk({find:iF,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),cF=yk.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`,XE(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,`
276
+ `):``,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=jO(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(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=jO(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()}}});XO.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(cP.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(jP.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(BP.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(rF.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(sF.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(cF.configure(this.options.taskList)),e}});var lF=`&nbsp;`,uF=`\xA0`,dF=yk.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,XE(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===lF||n[0].text===lF||n[0].raw===uF||n[0].text===uF)&&r.length===1&&r[0].type===`text`&&(r[0].text===lF||r[0].text===uF)?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){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?lF:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),fF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,pF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,mF=HO.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`,XE(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[pk({find:fF,type:this.type})]},addPasteRules(){return[xk({find:pF,type:this.type})]}}),hF=yk.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),gF=HO.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`,XE(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 _F(e={}){return new eb({view(t){return new vF(t,e)}})}var vF=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,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.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else 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)}computeTarget(e){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)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=uy(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},yF=class e extends My{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):My.near(r)}content(){return W.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 bF(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!SF(e)||!CF(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&&!Ry.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}}};yF.prototype.visible=!1,yF.findFrom=yF.findGapCursorFrom,My.jsonID(`gapcursor`,yF);var bF=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 yF.valid(t)?new yF(t):My.near(t)}};function xF(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function SF(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||xF(e.type))return!0;if(e.inlineContent)return!1}}return!0}function CF(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||xF(e.type))return!0;if(e.inlineContent)return!1}}return!0}function wF(){return new eb({props:{decorations:kF,createSelectionBetween(e,t,n){return t.pos==n.pos&&yF.valid(n)?new yF(n):null},handleClick:DF,handleKeyDown:TF,handleDOMEvents:{beforeinput:OF}}})}var TF=gT({ArrowLeft:EF(`horiz`,-1),ArrowRight:EF(`horiz`,1),ArrowUp:EF(`vert`,-1),ArrowDown:EF(`vert`,1)});function EF(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 Iy){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=yF.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new yF(c))),!0):!1}}function DF(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!yF.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ry.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new yF(r))),!0)}function OF(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof yF))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=U.empty;for(let e=r.length-1;e>=0;e--)i=U.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new W(i,0,0));return a.setSelection(Iy.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function kF(e){if(!(e.selection instanceof yF))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,jw.create(e.doc,[Ow.widget(e.selection.head,t,{key:`gapcursor`})])}var AF=200,jF=function(){};jF.prototype.append=function(e){return e.length?(e=jF.from(e),!this.length&&e||e.length<AF&&this.leafAppend(e)||this.length<AF&&e.leafPrepend(this)||this.appendInner(e)):this},jF.prototype.prepend=function(e){return e.length?jF.from(e).append(this):this},jF.prototype.appendInner=function(e){return new NF(this,e)},jF.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?jF.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},jF.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},jF.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)},jF.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},jF.from=function(e){return e instanceof jF?e:e&&e.length?new MF(e):jF.empty};var MF=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<=AF)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=AF)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}(jF);jF.empty=new MF([]);var NF=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}(jF),PF=500,FF=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 LF(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 LF(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 LF(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>zF&&(s=IF(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Ov;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 LF(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 LF(i,o,l))}else r.push(new LF(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new LF(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>PF&&(d=d.compress(this.items.length-r.length)),d}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 LF(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(jF.from(i.reverse()),a)}};FF.empty=new FF(jF.empty,0);function IF(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var LF=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)}}},RF=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},zF=20;function BF(e,t,n,r){let i=n.getMeta(JF),a;if(i)return i.historyState;n.getMeta(YF)&&(e=new RF(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(JF))return o.getMeta(JF).redo?new RF(e.done.addTransform(n,void 0,r,qF(t)),e.undone,HF(n.mapping.maps),e.prevTime,e.prevComposition):new RF(e.done,e.undone.addTransform(n,void 0,r,qF(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||!VF(n,e.prevRanges)),s=o?UF(e.prevRanges,n.mapping):HF(n.mapping.maps);return new RF(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,qF(t)),FF.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new RF(e.done.rebased(n,a),e.undone.rebased(n,a),UF(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new RF(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),UF(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function VF(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 HF(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 UF(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 WF(e,t,n){let r=qF(t),i=JF.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 RF(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(JF,{redo:n,historyState:c})}var GF=!1,KF=null;function qF(e){let t=e.plugins;if(KF!=t){GF=!1,KF=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){GF=!0;break}}return GF}var JF=new rb(`history`),YF=new rb(`closeHistory`);function XF(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new eb({key:JF,state:{init(){return new RF(FF.empty,FF.empty,null,0,-1)},apply(t,n,r){return BF(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?QF:n==`historyRedo`?$F:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function ZF(e,t){return(n,r)=>{let i=JF.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=WF(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var QF=ZF(!1,!0),$F=ZF(!0,!0),eI=XO.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,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 eb({key:new rb(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-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)}})]}}),tI=XO.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[_F(this.options)]}});XO.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new eb({key:new rb(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return jw.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(Ow.node(t,t+e.nodeSize,{class:this.options.className}))}),jw.create(e,a)}}})]}});var nI=XO.create({name:`gapCursor`,addProseMirrorPlugins(){return[wF()]},extendNodeSchema(e){return{allowGapCursor:WE(BE(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),rI=`placeholder`,iI=new rb(`tiptap__placeholder`);function aI(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),Ow.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function oI(e,t){return typeof e==`function`?e(t):e}function sI({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&ED(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(aI({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:oI(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function cI({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&ED(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(aI({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:oI(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...sI({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return jw.create(r,o)}function lI(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function uI(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function dI(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function fI(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function pI(e,t){let n=dI(e,t.from,t.to);return n.push(uI(e,lI(e,t.from))),t.to>t.from?n.push(uI(e,lI(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(uI(e,lI(e,Math.min(t.from+1,e.content.size)))),n}function mI(e,t,n){let r=[];if(e.docChanged){let t=pD(e);for(let e of t)r.push(...pI(n.doc,e.newRange))}return e.selectionSet&&(r.push(uI(n.doc,lI(n.doc,e.mapping.map(t.selection.anchor)))),r.push(uI(n.doc,lI(n.doc,n.selection.anchor)))),fI(r)}function hI(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function gI({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=hI(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=sI({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function _I({editor:e,options:t,dataAttribute:n}){return{init(r,i){return cI({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??jw.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:gI({decorations:i.map(r.mapping,r.doc),ranges:mI(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function vI(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function yI({editor:e,options:t}){let n=t.dataAttribute?`data-${vI(t.dataAttribute)}`:`data-${rI}`,r=t.showOnlyCurrent&&!t.includeChildren;return new eb({key:iI,...r?{}:{state:_I({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>cI({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?jw.empty:iI.getState(n)??jw.empty}})}var bI=XO.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:rI,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[yI({editor:this.editor,options:this.options})]}});function xI(e,t){return!e.selection.empty&&!DD(e.selection)&&t.isEditable}function SI(e,t){return xI(e,t)&&!t.isFocused&&!t.view.dragging}function CI(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function wI(e){e.focus()}XO.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new eb({key:new rb(`selection`),props:{decorations(n){return SI(n,e)?jw.create(n.doc,[Ow.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return xI(t.state,e)&&CI(),!1},focus(t){return xI(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&wI(t)}),!1}}}})]}});function TI({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var EI=XO.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new rb(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 eb({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!TI({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!TI({node:r,types:n})}}})]}}),DI=XO.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>QF(e,t),redo:()=>({state:e,dispatch:t})=>$F(e,t)}},addProseMirrorPlugins(){return[XF(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()}}}),OI=XO.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(vj.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(pj.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(cP.configure(this.options.bulletList)),this.options.code!==!1&&e.push(xj.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Tj.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Ej.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(tI.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(nI.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Dj.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Oj.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(DI.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(kj.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Pj.configure(this.options.italic)),this.options.listItem!==!1&&e.push(jP.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(BP.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(iP.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(rF.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(dF.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(mF.configure(this.options.strike)),this.options.text!==!1&&e.push(hF.configure(this.options.text)),this.options.underline!==!1&&e.push(gF.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(EI.configure(this.options?.trailingNode)),e}}),kI=20,AI=(e,t=0)=>{let n=[];return!e.children.length||t>kI||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...AI(e,t+1))}),n},jI=e=>{if(!e.children.length)return;let t=AI(e);t&&t.forEach(e=>{var t;let n=e.getAttribute(`style`),r=(t=e.parentElement)==null||(t=t.closest(`span`))==null?void 0:t.getAttribute(`style`);e.setAttribute(`style`,`${r};${n}`)})},MI=HO.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&jI(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,XE(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.isInline)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}}}}),NI=XO.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>(DO(e,`background-color`)??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()}}}),PI=XO.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>(DO(e,`color`)??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()}}}),Wee=XO.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>DO(e,`font-family`)??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()}}}),Gee=XO.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>DO(e,`font-size`)??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()}}}),Kee=XO.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>DO(e,`line-height`)??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()}}}),qee=XO.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(NI.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(PI.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(Wee.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(Gee.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(Kee.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(MI.configure(this.options.textStyle)),e}}),Jee=HO.create({name:`superscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sup`},{style:`vertical-align`,getAttrs(e){return e===`super`&&null}}]},renderHTML({HTMLAttributes:e}){return[`sup`,XE(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()}}}),Yee=HO.create({name:`subscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sub`},{style:`vertical-align`,getAttrs(e){return e===`sub`&&null}}]},renderHTML({HTMLAttributes:e}){return[`sub`,XE(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()}}}),Xee=XO.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})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(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`)}}}),Zee=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Qee=yk.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},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`,XE(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=XE(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{if(typeof e==`string`&&e!==``){l.getAttribute(`src`)!==e&&(l.src=e);return}l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``)};f(s.src);let p=new vk({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=ZE(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[mk({find:Zee,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),$ee=bI,ete=e=>String(e).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`),tte=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>`},FI=e=>{let t=String(e??``).trim();return t?/<[^>]+>/.test(t)?tte(t):`<div>${ete(t)}</div>`:`<div></div>`},II,LI;if(typeof WeakMap<`u`){let e=new WeakMap;II=t=>e.get(t),LI=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;II=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},LI=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var RI=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 II(e)||LI(e,nte(e))}};function nte(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=rte(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 RI(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&&ite(s,o,e),s}function rte(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 ite(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||=ate(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function ate(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function zI(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 BI=new rb(`selectingCells`);function VI(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 ote(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 HI(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 UI(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=VI(t.$head)||ste(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function ste(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 WI(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function cte(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function GI(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function KI(e,t,n){let r=e.node(-1),i=RI.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 qI(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 JI(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 lte(e,t,n){let r=zI(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 YI=class e extends My{constructor(e,t=e){let n=e.node(-1),r=RI.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 Ny(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(WI(r)&&WI(i)&&GI(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 Iy.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=RI.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=qI(e,0,l)),u>0&&(e=qI(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(U.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new W(U.from(o),1,1)}replace(e,t=W.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?W.empty:t)}let i=My.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new W(U.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=RI.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=RI.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=RI.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=RI.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 ute(this.$anchorCell.pos,this.$headCell.pos)}};YI.prototype.visible=!1,My.jsonID(`cell`,YI);var ute=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&&GI(t,n)?new YI(t,n):My.near(n,1)}};function dte(e){if(!(e.selection instanceof YI))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Ow.node(n,n+e.nodeSize,{class:`selectedCell`}))}),jw.create(e.doc,t)}function fte({$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 pte({$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 mte(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof Ry&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=YI.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=YI.rowSelection(e,e)}else if(!n){let e=RI.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=YI.create(i,t+1,n)}}else r instanceof Iy&&fte(r)?a=Iy.create(i,r.from):r instanceof Iy&&pte(r)&&(a=Iy.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var hte=new rb(`fix-tables`);function XI(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)?XI(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function ZI(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=gte(e,t,r,n))};return t?t.doc!=e.doc&&XI(t.doc,e.doc,0,r):e.doc.descendants(r),n}function gte(e,t,n,r){let i=RI.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,qI(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=zI(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(hte,{fixTables:!0})}function QI(e){let t=e.selection,n=UI(e),r=n.node(-1),i=n.start(-1),a=RI.get(r);return{...t instanceof YI?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function $I(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;lte(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,JI(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?zI(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 _te(e,t){if(!HI(e))return!1;if(t){let n=QI(e);t($I(e.tr,n,n.left))}return!0}function vte(e,t){if(!HI(e))return!1;if(t){let n=QI(e);t($I(e.tr,n,n.right))}return!0}function yte(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,qI(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 bte(e,t){if(!HI(e))return!1;if(t){let n=QI(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;yte(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=RI.get(e)}t(r)}return!0}function xte(e,t,n){let r=zI(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 eL(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;xte(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?zI(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,zI(r.type.schema).row.create(null,o)),e}function tL(e,t){if(!HI(e))return!1;if(t){let n=QI(e);t(eL(e.tr,n,n.top))}return!0}function nL(e,t){if(!HI(e))return!1;if(t){let n=QI(e);t(eL(e.tr,n,n.bottom))}return!0}function rL(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 iL(e,t){if(!HI(e))return!1;if(t){let n=QI(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;rL(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=RI.get(n.table)}t(r)}return!0}function aL(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function oL({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 sL(e,t){let n=e.selection;if(!(n instanceof YI)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=QI(e),{map:i}=r;if(oL(i,r))return!1;if(t){let n=e.tr,a={},o=U.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{aL(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,{...JI(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=aL(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new YI(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function cL(e,t){let n=zI(e.schema);return lL(({node:e})=>n[e.type.spec.tableRole])(e,t)}function lL(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof YI){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=ote(r.$from),!i)return!1;a=VI(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=QI(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 YI&&u.setSelection(new YI(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function uL(e,t){return function(n,r){if(!HI(n))return!1;let i=UI(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof YI?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 dL(e){return function(t,n){if(!HI(t))return!1;if(n){let r=zI(t.schema),i=QI(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 fL(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 pL(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?dL(e):function(t,n){if(!HI(t))return!1;if(n){let r=zI(t.schema),i=QI(t),a=t.tr,o=fL(`row`,i,r),s=fL(`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}}pL(`row`,{useDeprecatedLogic:!0}),pL(`column`,{useDeprecatedLogic:!0});var mL=pL(`cell`,{useDeprecatedLogic:!0});function hL(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 gL(e){return function(t,n){if(!HI(t))return!1;let r=hL(UI(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(Iy.between(e,cte(e))).scrollIntoView())}return!0}}function _L(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 vL(e,t){let n=e.selection;if(!(n instanceof YI))return!1;if(t){let r=e.tr,i=zI(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 W(i,0,0))}),r.docChanged&&t(r)}return!0}function yL(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=xL(zI(o).row,new W(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?xL(zI(o).row,new W(t,n,r)).content:t);else return null;return bL(o,s)}function bL(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(U.empty),n[i]<r){let a=zI(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(U.from(o))}return{height:t.length,width:r,rows:t}}function xL(e,t){let n=e.createAndFill();return new Ay(n).replace(0,n.content.size,t).doc}function SL({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(qI(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(U.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(U.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function CL(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=zI(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,U.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 wL(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 TL(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,qI(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(qI(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function EL(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=RI.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=RI.get(a),f=d.mapping.maps.length}CL(d,o,a,n,l,u,f)&&p(),wL(d,o,a,n,c,l,s,f)&&p(),wL(d,o,a,n,c,l,u,f)&&p(),TL(d,o,a,n,s,u,c,f)&&p(),TL(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 W(i.rows[e-s],0,0))}p(),d.setSelection(new YI(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var DL=gT({ArrowLeft:kL(`horiz`,-1),ArrowRight:kL(`horiz`,1),ArrowUp:kL(`vert`,-1),ArrowDown:kL(`vert`,1),"Shift-ArrowLeft":AL(`horiz`,-1),"Shift-ArrowRight":AL(`horiz`,1),"Shift-ArrowUp":AL(`vert`,-1),"Shift-ArrowDown":AL(`vert`,1),Backspace:vL,"Mod-Backspace":vL,Delete:vL,"Mod-Delete":vL});function OL(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function kL(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof YI)return OL(n,r,My.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=PL(i,e,t);if(o==null)return!1;if(e==`horiz`)return OL(n,r,My.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=KI(i,e,t),s;return s=a?My.near(a,1):t<0?My.near(n.doc.resolve(i.before(-1)),-1):My.near(n.doc.resolve(i.after(-1)),1),OL(n,r,s)}}}function AL(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof YI)o=a;else{let r=PL(i,e,t);if(r==null)return!1;o=new YI(n.doc.resolve(r))}let s=KI(o.$headCell,e,t);return s?OL(n,r,new YI(o.$anchorCell,s)):!1}}function jL(e,t){let n=e.state.doc,r=VI(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new YI(r))),!0):!1}function ML(e,t,n){if(!HI(e.state))return!1;let r=yL(n),i=e.state.selection;if(i instanceof YI){r||={width:1,height:1,rows:[U.from(xL(zI(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=RI.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=SL(r,o.right-o.left,o.bottom-o.top),EL(e.state,e.dispatch,a,o,r),!0}else if(r){let t=UI(e.state),n=t.start(-1);return EL(e.state,e.dispatch,n,RI.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function NL(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=FL(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof YI)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=VI(e.state.selection.$anchor))!=null&&IL(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=IL(e,n),i=BI.getState(e.state)==null;if(!r||!GI(t,r))if(i)r=t;else return;let a=new YI(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(BI,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),BI.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(BI,-1))}function o(r){let o=r,s=BI.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(FL(e,o.target)!=n&&(c=IL(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 PL(e,t,n){if(!(e.state.selection instanceof Iy))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 FL(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function IL(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&&VI(e.state.doc.resolve(r))||VI(e.state.doc.resolve(i))}var LL=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`)),RL(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,RL(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 RL(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 zL=new rb(`tableColumnResizing`);function BL({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=LL,lastColumnResizable:i=!0}={}){let a=new eb({key:zL,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=zI(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new VL(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=zL.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{HL(t,n,e,i)},mouseleave:e=>{UL(e)},mousedown:(e,r)=>{WL(e,r,t,n)}},decorations:e=>{let t=zL.getState(e);if(t&&t.activeHandle>-1)return $L(e,t.activeHandle)},nodeViews:{}}});return a}var VL=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(zL);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 WI(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function HL(e,t,n,r){if(!e.editable)return;let i=zL.getState(e.state);if(i&&!i.dragging){let a=KL(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=qL(e,t,`left`,n):i-t.clientX<=n&&(o=qL(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=RI.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}YL(e,o)}}}function UL(e){if(!e.editable)return;let t=zL.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&YL(e,-1)}function WL(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=zL.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=GL(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(zL,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=zL.getState(e.state);r?.dragging&&(XL(e,r.activeHandle,JL(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(zL,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=zL.getState(e.state);if(i&&i.dragging){let a=JL(i.dragging,t,n);ZL(e,i.activeHandle,a,r)}}return ZL(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function GL(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 KL(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function qL(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=VI(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=RI.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 JL(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function YL(e,t){e.dispatch(e.state.tr.setMeta(zL,{setHandle:t}))}function XL(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=RI.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():QL(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function ZL(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=RI.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&&RL(a,c.firstChild,c,r,s,n)}function QL(e){return Array(e).fill(0)}function $L(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return jw.empty;let a=RI.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`,zL.getState(e)?.dragging&&n.push(Ow.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Ow.widget(s,c))}}return jw.create(e.doc,n)}function eR({allowTableNodeSelection:e=!1}={}){return new eb({key:BI,state:{init(){return null},apply(e,t){let n=e.getMeta(BI);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:dte,handleDOMEvents:{mousedown:NL},createSelectionBetween(e){return BI.getState(e.state)==null?null:e.state.selection},handleTripleClick:jL,handleKeyDown:DL,handlePaste:ML},appendTransaction(t,n,r){return mte(r,ZI(r,n),e)}})}function tR(e){return e===`left`||e===`right`||e===`center`?e:null}function nR(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return tR(t||n)}function rR(e){return tR(e?.align)}function iR(){return{default:null,parseHTML:e=>nR(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function aR(e){let t=e.parentElement,n=e.closest(`table`);if(!t||!n)return null;let r=Array.from(t.children).indexOf(e),i=n.querySelectorAll(`colgroup > col`)[r]?.getAttribute(`width`);return i?[parseInt(i,10)]:null}function oR(e){let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):aR(e)}var sR=/[ \t\r\n\f]+/g;function cR(e){return e.children.length>0?!1:(e.textContent??``).replace(sR,``)===``}function lR(e){let t=e.createAndFill();if(!t)throw Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}var uR=yk.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:oR},align:iR()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getAttrs:e=>cR(e)?{}:!1,getContent:(e,t)=>lR(t.nodes[this.name])},{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,XE(this.options.HTMLAttributes,e),0]}}),dR=yk.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:oR},align:iR()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getAttrs:e=>cR(e)?{}:!1,getContent:(e,t)=>lR(t.nodes[this.name])},{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,XE(this.options.HTMLAttributes,e),0]}}),fR=yk.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,XE(this.options.HTMLAttributes,e),0]}});function pR(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function mR(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l!==null)for(let e=0,n=0;e<l.childCount;e+=1){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e+=1,n+=1){let l=i===n?a:d&&d[e],u=l?`${l}px`:``;if(o+=l||r,l||(s=!1),c){if(c.style.width!==u){let[e,t]=pR(r,l);c.style.setProperty(e,t)}c=c.nextSibling}else{let e=document.createElement(`col`),[n,i]=pR(r,l);e.style.setProperty(n,i),t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);s&&!d?(n.style.width=`${o}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${o}px`)}var hR=class{constructor(e,t,n,r={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`));for(let[e,t]of Object.entries(r))t!=null&&(e===`style`?this.table.style.cssText=String(t):this.table.setAttribute(e,String(t)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),mR(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,mR(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function gR(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]=pR(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 _R(e,t){return t?e.createChecked(null,t):e.createAndFill()}function vR(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 yR(e,t,n,r,i){let a=vR(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=_R(a.cell,i);if(e&&s.push(e),r){let e=_R(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 bR(e){return e instanceof YI}var xR=({editor:e})=>{let{selection:t}=e.state;if(!bR(t))return!1;let n=0;return RE(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};function SR(e,t){let n=e.mapping.map(t);if(RE(e.selection.$from,e=>e.type.name===`table`)?.pos===n)return;let r=e.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;e.setSelection(Iy.near(e.doc.resolve(i),-1))}function CR(e){let t=``,n=0;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let r=0;for(;n+r<e.length&&e[n+r]==="`";)r+=1;let i=n+r,a=!1;for(;i<e.length;){if(e[i]!=="`"){i+=1;continue}let o=0;for(;i+o<e.length&&e[i+o]==="`";)o+=1;if(o===r){let o=e.slice(n+r,i);t+=e.slice(n,n+r)+o.replace(/\\\||\|/g,e=>e===`|`?`\\|`:e)+e.slice(i,i+r),n=i+r,a=!0;break}i+=o}a||(t+=e.slice(n,n+r),n+=r)}return t}function wR(e){return e.split(`
277
+ `).map(e=>!e.includes(`|`)||!e.includes("`")?e:CR(e)).join(`
278
+ `)}function TR(e){return(e||``).replace(/\s+/g,` `).trim()}function ER(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=TR(i.split(r).join(`
279
+ `).replace(/[ \t]*\r?\n[ \t]*/g,`<br>`)),o=e.type===`tableHeader`,s=rR(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array.from({length:a}).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array.from({length:a}).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
280
+ `,f=Array.from({length:a}).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |\n`,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |\n`,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array.from({length:a}).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |\n`}),d}var DR=yk.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:hR,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}=gR(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,XE(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=tR(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=tR(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>ER(e,t),markdownTokenizer:{name:`table`,level:`block`,start:e=>{let t=e.split(`
281
+ `);if(t.length<2)return-1;let n=t[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes(`|`)?-1:t[0].includes(`|`)?0:-1},tokenize(e,t,n){let r=e.indexOf(`
282
+
283
+ `),i=r>=0?e.slice(0,r):e,a=i.split(`
284
+ `);if(a.length<2)return;let o=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(o)||!o.includes(`|`))return;let s=wR(i);if(s===i)return;let c=n.blockTokens(s)[0];if(c?.type!==`table`||!c.raw)return;let l=c.raw.split(`
285
+ `).length,u=e.split(`
286
+ `).slice(0,l).join(`
287
+ `);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=yR(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(Iy.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>_te(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>vte(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=RE(e.selection.$from,e=>e.type.name===`table`);return bte(e,t&&(e=>{n&&SR(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>tL(e,t),addRowAfter:()=>({state:e,dispatch:t})=>nL(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=RE(e.selection.$from,e=>e.type.name===`table`);return iL(e,t&&(e=>{n&&SR(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>_L(e,t),mergeCells:()=>({state:e,dispatch:t})=>sL(e,t),splitCell:()=>({state:e,dispatch:t})=>cL(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>pL(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>pL(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>mL(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>sL(e,t)?!0:cL(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>uL(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>gL(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>gL(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&ZI(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=YI.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:xR,"Mod-Backspace":xR,Delete:xR,"Mod-Delete":xR}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[BL({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],eR({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n,HTMLAttributes:r})=>{let i=XE(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){return{tableRole:WE(BE(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});XO.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(DR.configure(this.options.table)),this.options.tableCell!==!1&&e.push(uR.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(dR.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(fR.configure(this.options.tableRow)),e}});var OR=(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))`)},kR=class extends hR{constructor(e,t,n){super(e,t,n),OR(this.table,e.attrs)}update(e){let t=super.update(e);return t&&OR(this.table,e.attrs),t}},AR=DR.extend({addOptions(){return{...this.parent?.(),resizable:!0,handleWidth:0,View:kR}},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}
288
+ color: var(--pie-text, black);
289
+ background-color: var(--pie-background, rgba(255, 255, 255))`,t[1].border=n||`1`,t}}),jR=`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`,MR=uR.extend({content:jR}),NR=dR.extend({content:jR}),PR=yk.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}}}}),FR=XO.create({name:`ensureEmptyRootIsDiv`,addProseMirrorPlugins(){return[new eb({key:new rb(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())}})]}}),IR=XO.create({name:`ensureListItemContentIsDiv`,addProseMirrorPlugins(){return[new eb({key:new rb(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 LR(e){return aa(`MuiIconButton`,e)}var RR=oa(`MuiIconButton`,[`root`,`disabled`,`colorInherit`,`colorPrimary`,`colorSecondary`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`,`edgeStart`,`edgeEnd`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`loading`,`loadingIndicator`,`loadingWrapper`]),zR=e=>{let{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e;return Oo({root:[`root`,o&&`loading`,n&&`disabled`,r!=="default"&&`color${V(r)}`,i&&`edge${V(i)}`,`size${V(a)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},LR,t)},BR=z(ih,{name:`MuiIconButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${V(n.color)}`],n.edge&&t[`edge${V(n.edge)}`],t[`size${V(n.size)}`]]}})(vf(({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}}]})),vf(({theme:e})=>({variants:[{props:{color:`inherit`},style:{color:`inherit`}},...Object.entries(e.palette).filter(ch()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(ch()).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)}}],[`&.${RR.disabled}`]:{backgroundColor:`transparent`,color:(e.vars||e).palette.action.disabled},[`&.${RR.loading}`]:{color:`transparent`}}))),VR=z(`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`}}]})),HR=F.forwardRef(function(e,t){let n=Ju({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=rp(u),h=f??(0,I.jsx)(bh,{"aria-labelledby":m,color:`inherit`,size:16}),g={...n,edge:r,color:o,disabled:s,disableFocusRipple:c,loading:d,loadingIndicator:h,size:l},_=zR(g);return(0,I.jsxs)(BR,{id:d?m:u,className:L(_.root,a),centerRipple:!0,focusRipple:!c,disabled:s||d,ref:t,...p,ownerState:g,children:[typeof d==`boolean`&&(0,I.jsx)(`span`,{className:_.loadingWrapper,style:{display:`contents`},children:(0,I.jsx)(VR,{className:_.loadingIndicator,ownerState:g,children:d&&h})}),i]})}),UR=ep((0,I.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`),WR=`pie-toolbar`,GR=ep((0,I.jsx)(`path`,{d:`M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z`}),`Check`),KR=z(HR)({verticalAlign:`top`,width:`28px`,height:`28px`,color:`var(--editable-html-toolbar-check, #00bb00)`,padding:`4px`}),qR=({onClick:e,doneButtonRef:t})=>(0,I.jsx)(KR,{"aria-label":`Done`,buttonRef:t,onClick:e,children:(0,I.jsx)(GR,{})});qR.propTypes={onClick:P.func,doneButtonRef:P.func};var JR=qR,YR=z(`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`}})),XR=z(HR)({width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`}),ZR=z(`div`)({display:`flex`});function QR(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,I.jsxs)(YR,{className:WR,showDone:c,toolbarAlignment:r.alignment,isFocused:r.alwaysVisible||a,autoWidth:i,isHidden:r.isHidden===!0,style:{...d,...u},children:[t,(0,I.jsxs)(ZR,{children:[n&&(0,I.jsx)(XR,{"aria-label":`Delete`,onMouseDown:e=>s?.(e),children:(0,I.jsx)(UR,{})}),c&&(0,I.jsx)(JR,{doneButtonRef:o,onClick:l})]})]})}var $R=`toolbarOpenedChanged`,ez=(e,t)=>{let n=!!t;e._toolbarOpened!==n&&(e._toolbarOpened=n,e?.view&&e?.state?.tr&&e.view.dispatch(e.state.tr.setMeta($R,!0)))},tz=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,F.useState)(!1),p=c([n,u],t,()=>{}),m=(0,F.useRef)(null),h;if(l){let e=l(),t=parseInt(o.index,10);h=!!e?.[t]?.[0]}return(0,F.useEffect)(()=>{let{selection:e}=t.state,r=e.from+n.nodeSize===e.to;a?r&&f(a):f(a)},[t,n,a]),(0,F.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,I.jsxs)(zA,{className:`drag-in-the-blank`,"data-selected":a,style:{display:`inline-flex`,minHeight:`55px`,position:`relative`,cursor:`pointer`},children:[(0,I.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,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(`div`,{ref:m,className:`absolute z-50 bg-white shadow-lg rounded p-2`,style:{zIndex:1},children:(0,I.jsx)(p,{})}),t._tiptapContainerEl&&gd.createPortal((0,I.jsx)(QR,{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),ez(t,!1),t.view.dispatch(e),f(!1),t.commands.focus()},showDone:!1}),t._tiptapContainerEl)]})]})};tz.propTypes={attributes:P.object,error:P.any,value:P.string,isFocused:P.bool};var nz=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function rz(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function iz(e){return`nodeType`in e}function az(e){return e?rz(e)?e:iz(e)?e.ownerDocument?.defaultView??window:window:window}function oz(e){let{Document:t}=az(e);return e instanceof t}function sz(e){return!rz(e)&&e instanceof az(e).HTMLElement}function cz(e){return e instanceof az(e).SVGElement}function lz(e){return e?rz(e)?e.document:iz(e)?oz(e)?e:sz(e)||cz(e)?e.ownerDocument:document:document:document}var uz=nz?F.useLayoutEffect:F.useEffect;function dz(e){let t=(0,F.useRef)(e);return uz(()=>{t.current=e}),(0,F.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 fz(e,t){t===void 0&&(t=[e]);let n=(0,F.useRef)(e);return uz(()=>{n.current!==e&&(n.current=e)},t),n}function pz(e){let t=dz(e),n=(0,F.useRef)(null);return[n,(0,F.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}var mz={};function hz(e,t){return(0,F.useMemo)(()=>{if(t)return t;let n=mz[e]==null?0:mz[e]+1;return mz[e]=n,e+`-`+n},[e,t])}function gz(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 _z=gz(1),vz=gz(-1);function yz(e){return`clientX`in e&&`clientY`in e}function bz(e){if(!e)return!1;let{KeyboardEvent:t}=az(e.target);return t&&e instanceof t}function xz(e){if(!e)return!1;let{TouchEvent:t}=az(e.target);return t&&e instanceof t}function Sz(e){if(xz(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 yz(e)?{x:e.clientX,y:e.clientY}:null}var Cz;(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`})(Cz||={});function wz(){}var Tz=Object.freeze({x:0,y:0});function Ez(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 Dz(e,t,n){let r=Ez(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 Oz={ignoreTransform:!1};function kz(e,t){t===void 0&&(t=Oz);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=az(e).getComputedStyle(e);t&&(n=Dz(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 Az(e,t){return t===void 0&&(t=az(e).getComputedStyle(e)),t.position===`fixed`}function jz(e,t){t===void 0&&(t=az(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)})}function Mz(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(oz(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!sz(i)||cz(i)||n.includes(i))return n;let a=az(e).getComputedStyle(i);return i!==e&&jz(i,a)&&n.push(i),Az(i,a)?n:r(i.parentNode)}return e?r(e):n}function Nz(e){let[t]=Mz(e,1);return t??null}var Pz;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Pz||={});function Fz(e){return!nz||!e?!1:e===document.scrollingElement}function Iz(e){let t={x:0,y:0},n=Fz(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}}function Lz(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 Rz(e,t){if(t===void 0&&(t=kz),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);Nz(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var zz=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 Bz(e){let{EventTarget:t}=az(e);return e instanceof t?e:lz(e)}function Vz(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}var Hz;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Hz||={});function Uz(e){e.preventDefault()}function Wz(e){e.stopPropagation()}var Gz;(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`})(Gz||={});var Kz={start:[Gz.Space,Gz.Enter],cancel:[Gz.Esc],end:[Gz.Space,Gz.Enter,Gz.Tab]},qz=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Gz.Right:return{...n,x:n.x+25};case Gz.Left:return{...n,x:n.x-25};case Gz.Down:return{...n,y:n.y+25};case Gz.Up:return{...n,y:n.y-25}}},Jz=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 zz(lz(t)),this.windowListeners=new zz(az(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Hz.Resize,this.handleCancel),this.windowListeners.add(Hz.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Hz.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Rz(n),t(Tz)}handleKeyDown(e){if(bz(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Kz,coordinateGetter:a=qz,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}:Tz;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=vz(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}=Iz(n),p=Lz(n),m={x:Math.min(i===Gz.Right?p.right-p.width/2:p.right,Math.max(i===Gz.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Gz.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Gz.Down?p.top:p.top+p.height/2,u.y))},h=i===Gz.Right&&!s||i===Gz.Left&&!c,g=i===Gz.Down&&!l||i===Gz.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Gz.Right&&e<=d.x||i===Gz.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===Gz.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===Gz.Down&&e<=d.y||i===Gz.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===Gz.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,_z(vz(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()}};Jz.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Kz,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 Yz(e){return!!(e&&`distance`in e)}function Xz(e){return!!(e&&`delay`in e)}var Zz=class{constructor(e,t,n){n===void 0&&(n=Bz(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=lz(i),this.documentListeners=new zz(this.document),this.listeners=new zz(n),this.windowListeners=new zz(az(i)),this.initialCoordinates=Sz(r)??Tz,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(Hz.Resize,this.handleCancel),this.windowListeners.add(Hz.DragStart,Uz),this.windowListeners.add(Hz.VisibilityChange,this.handleCancel),this.windowListeners.add(Hz.ContextMenu,Uz),this.documentListeners.add(Hz.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Xz(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Yz(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(Hz.Click,Wz,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Hz.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=Sz(e)??Tz,s=vz(n,o);if(!t&&a){if(Yz(a)){if(a.tolerance!=null&&Vz(s,a.tolerance))return this.handleCancel();if(Vz(s,a.distance))return this.handleStart()}if(Xz(a)&&Vz(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===Gz.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Qz={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},$z=class extends Zz{constructor(e){let{event:t}=e,n=lz(t.target);super(e,Qz,n)}};$z.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 eB={move:{name:`mousemove`},end:{name:`mouseup`}},tB;(function(e){e[e.RightClick=2]=`RightClick`})(tB||={});var nB=class extends Zz{constructor(e){super(e,eB,lz(e.event.target))}};nB.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===tB.RightClick?!1:(r?.({event:n}),!0)}}];var rB={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},iB=class extends Zz{constructor(e){super(e,rB)}static setup(){return window.addEventListener(rB.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(rB.move.name,e)};function e(){}}};iB.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 aB;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(aB||={});var oB;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(oB||={}),Pz.Backward,Pz.Forward,Pz.Backward,Pz.Forward;var sB;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(sB||={});var cB;(function(e){e.Optimized=`optimized`})(cB||={});function lB(e){let{callback:t,disabled:n}=e,r=dz(t),i=(0,F.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,F.useEffect)(()=>()=>i?.disconnect(),[i]),i}function uB(e,t){return(0,F.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}sB.WhileDragging,cB.Optimized;var dB={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:wz,draggableNodes:new Map,over:null,measureDroppableContainers:wz},fB=(0,F.createContext)(dB),pB=(0,F.createContext)({...Tz,scaleX:1,scaleY:1}),mB;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(mB||={});var hB=(0,F.createContext)(null),gB=`button`,_B=`Draggable`;function vB(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=hz(_B),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,F.useContext)(fB),{role:p=gB,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,F.useContext)(g?pB:hB),[v,y]=pz(),[b,x]=pz(),S=uB(o,t),C=fz(n);return uz(()=>(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,F.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===gB?!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 yB=`Droppable`,bB={timeout:25};function xB(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=hz(yB),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,F.useContext)(fB),u=(0,F.useRef)({disabled:n}),d=(0,F.useRef)(!1),f=(0,F.useRef)(null),p=(0,F.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...bB,...i},_=fz(h??r),v=lB({callback:(0,F.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]=pz((0,F.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=fz(t);return(0,F.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,F.useEffect)(()=>(s({type:Cz.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Cz.UnregisterDroppable,key:a,id:r})),[r]),(0,F.useEffect)(()=>{n!==u.current.disabled&&(s({type:Cz.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 SB=ep((0,I.jsx)(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`),CB=ep((0,I.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`),wB=e=>{switch(e){case`down`:return 90;case`up`:return-90;case`left`:return 180;default:return 0}},TB=e=>{let{direction:t,style:n}=e;return(0,I.jsx)(SB,{style:{transform:`rotate(${wB(t)}deg)`,...n}})};TB.propTypes={direction:P.string,style:P.object};var EB=({style:e})=>(0,I.jsxs)(`span`,{style:e,children:[(0,I.jsx)(CB,{style:{margin:`0 -16px`}}),(0,I.jsx)(CB,{})]});EB.propTypes={style:P.object},z(`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`}));var DB=z(`span`)(({theme:e})=>({border:`solid 0px ${e.palette.primary.main}`,"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{fontSize:`120% !important`},"& mjx-frac":{fontSize:`120% !important`}}));function OB({n:e,children:t,isDragging:n,isOver:r,dragItem:i,value:a,selected:o}){let[s,c]=(0,F.useState)(null),l=(0,F.useRef)(null),u=e=>{l.current&&(l.current.contains(e.target)?l.current.classList.add(`selected`):l.current.classList.remove(`selected`))};(0,F.useEffect)(()=>(document.addEventListener(`click`,u),()=>{document.removeEventListener(`click`,u)}),[]),(0,F.useEffect)(()=>{l.current&&typeof Ne==`function`&&Ne(l.current)},[a?.value,r,i?.value?.value]),(0,F.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 ${Lp()}`:m?`1px solid ${H.BORDER_DARK}`:`1px solid ${H.BORDER_LIGHT}`;return(0,I.jsxs)(`div`,{ref:l,className:o?`selected`:void 0,style:{display:`inline-flex`,minWidth:`178px`,minHeight:`36px`,background:m?`${H.BORDER_LIGHT}`:`${H.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,I.jsx)(EB,{style:{position:`absolute`,top:`6px`,left:`15px`,color:`#9B9B9B`},contentEditable:!1}),(0,I.jsx)(`span`,{dangerouslySetInnerHTML:{__html:f}}),t]})}OB.propTypes={n:P.object,children:P.node,isDragging:P.bool,isOver:P.bool,dragItem:P.object,value:P.object,selected:P.bool};function kB({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}=vB({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}=xB({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,I.jsx)(OB,{n:i,isDragging:p,isOver:h,dragItem:g?.data?.current,value:e,selected:l,children:r}),y=e?(0,I.jsx)(`span`,{ref:_,...u,...d,children:v}):(0,I.jsx)(`span`,{ref:m,children:v});return(0,I.jsx)(DB,{className:L(h&&`over`),children:y})}kB.propTypes={value:P.object,disabled:P.bool,instanceId:P.string,children:P.node,n:P.object.isRequired,onChange:P.func.isRequired,removeResponse:P.func.isRequired,duplicates:P.bool,selected:P.bool};var AB=(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)},jB=(e,t,n)=>{let{tr:r}=e.state;r.setNodeMarkup(n.pos,void 0,fc(t.attrs,[`value`,`id`])),r.isDone=!0,e.view.dispatch(r)},MB=e=>{let{editor:t,node:n,getPos:r,options:i,selected:a}=e,{attrs:o}=n,{inTable:s}=o,c=r();return(0,I.jsx)(zA,{className:`drag-in-the-blank`,"data-selected":a,style:{display:`inline`,whiteSpace:`normal`},children:(0,I.jsx)(`span`,{...o,style:{display:`inline-flex`,minHeight:`50px`,minWidth:`178px`,position:`relative`,margin:s?`10px`:`0 10px`,cursor:`pointer`},children:(0,I.jsx)(kB,{n:o,dragKey:o.id,targetId:`0`,pos:c,value:o,duplicates:i.duplicates,selected:a,onChange:e=>AB(t,n,c,e),removeResponse:e=>jB(t,n,e)})})})};MB.propTypes={attributes:P.object,data:P.object,n:P.object,nodeProps:P.object,opts:P.object};var NB=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,F.useRef)(null),f=(0,F.useRef)(null),p=(0,F.useRef)(!1),m=(0,F.useRef)(null),h=()=>t._holdInlineDropdownToolbarIndex!=null&&String(t._holdInlineDropdownToolbarIndex)===String(n.attrs.index),[g,_]=(0,F.useState)(!1),[v,y]=(0,F.useState)({top:0,left:0}),b=()=>{h()||(_(!1),i.onInlineDropdownToolbarClose?.(t))},x=i.respAreaToolbar([n,u],t,b),S=()=>{let{tr:e}=t.state,n=e.doc.nodeAt(u);if(!n)return;let{selection:r}=e;r.from===u&&r.to===u+n.nodeSize||(e.setSelection(Ry.create(e.doc,u)),t.view.dispatch(e))},C=()=>{p.current||(i.onToolbarCloseRequest?(p.current=!0,i.onToolbarCloseRequest([n,u],t,()=>{p.current=!1,delete t._holdInlineDropdownToolbarIndex,b()},()=>{p.current=!1,delete t._holdInlineDropdownToolbarIndex,_(!0),setTimeout(S,0)})):b())};(0,F.useEffect)(()=>{let{selection:e}=t.state,r=e.from+n.nodeSize===e.to;a?r&&_(!0):g&&C()},[t,n,a]);let w=e=>e.clientX>document.documentElement.clientWidth||e.clientY>document.documentElement.clientHeight||e.target===document.documentElement;return(0,F.useEffect)(()=>{m.current&&typeof Ne==`function`&&Ne(m.current)},[s]),(0,F.useEffect)(()=>{let e=document.body.getBoundingClientRect(),{from:n}=t.state.selection,r=t.view.coordsAtPos(n);y({top:r.top+Math.abs(e.top)+40,left:r.left});let i=e=>{if(w(e))return;let n=e.target.closest(`[data-toolbar-for]`);!e.target.closest(`[data-inline-dropdown-toolbar]`)&&(!n||n.dataset.toolbarFor!==f.current?.instanceId)&&!t._toolbarOpened&&d.current&&!d.current.contains(e.target)&&!e.target.closest(`[data-inline-node]`)&&C()};return g?document.addEventListener(`mousedown`,i):document.removeEventListener(`mousedown`,i),()=>document.removeEventListener(`mousedown`,i)},[g,n]),(0,I.jsxs)(zA,{className:`inline-dropdown`,"data-selected":a,style:{display:`inline-flex`,height:`50px`,cursor:`pointer`},children:[(0,I.jsxs)(`div`,{ref:m,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:()=>_(!0),children:[(0,I.jsx)(`div`,{style:{flex:1,overflow:`hidden`,padding:`0 25px 0 8px`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},children:(0,I.jsx)(`span`,{style:{display:`inline-block`,verticalAlign:`middle`},dangerouslySetInnerHTML:{__html:l}})}),(0,I.jsx)(TB,{direction:`down`,style:{position:`absolute`,top:`5px`,right:`5px`}})]}),g&&(0,I.jsxs)(F.Fragment,{children:[gd.createPortal((0,I.jsx)(`div`,{ref:d,children:(0,I.jsx)(x,{editorCallback:e=>{f.current=e}})}),t?._tiptapContainerEl||document.body),t._tiptapContainerEl&&gd.createPortal((0,I.jsx)(QR,{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),ez(t,!1),delete t._holdInlineDropdownToolbarIndex,t.view.dispatch(e),_(!1),t.commands.focus()},showDone:!1}),t._tiptapContainerEl)]})]})};NB.propTypes={attributes:P.object,selectedItem:P.oneOfType([P.string,P.object])};var PB=s({greaterThan:()=>LB,greaterThanEqual:()=>zB,lessThan:()=>IB,lessThanEqual:()=>RB}),FB=e=>({...e,category:`comparison`}),IB=FB({name:`Less than`,latex:`<`,command:`\\lt`}),LB=FB({name:`Greater than`,latex:`>`,command:`\\gt`}),RB=FB({name:`Less than or equal`,latex:`\\le`,symbol:`<=`,command:`\\le`,ariaLabel:`less than or equal to`}),zB=FB({name:`Greater than or equal`,symbol:`>=`,command:`\\ge`,latex:`\\ge`}),BB=e=>t=>({...t,category:e}),VB=(e=[])=>{let t=[];hc(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},HB=e=>t=>{let n=ic(e),r=n.some(e=>e.latex===t.latex),i=n.some(e=>e.name===t.name);return!r&&!i},UB=(e=[],t=[])=>{t=t.filter(HB(e));let n=[];hc(5-e.length,()=>e.push([])),hc(5,()=>n.push([]));let r=VB(t);for(let t=0;t<5;t++)n[t]=[...e[t],...r[t]];return n},WB=s({theta:()=>JB,x:()=>KB,y:()=>qB}),GB=BB(`vars`),KB=GB({name:`X`,latex:`x`,write:`x`}),qB=GB({name:`Y`,latex:`y`,write:`y`}),JB=GB({name:`Theta`,latex:`\\theta`,write:`\\theta`}),YB=s({blankOverBlank:()=>ZB,xBlankBlank:()=>$B,xOverBlank:()=>QB}),XB=BB(`fractions`),ZB=XB({name:`blank/blank`,latex:`\\frac{}{}`,command:`\\frac`,ariaLabel:`fraction`}),QB=XB({latex:`\\frac{x}{ }`,name:`X/blank`,label:`x/[]`,command:`/`,ariaLabel:`x over blank fraction`}),$B=XB({name:`X (blank/blank)`,latex:`x\\frac{}{}`,label:`x([]/[])`,command:`\\frac`,ariaLabel:`mixed number`}),eV=s({nthRoot:()=>aV,squareRoot:()=>iV,squared:()=>nV,xToPowerOfN:()=>rV}),tV=BB(`exponent`),nV=tV({name:`Squared`,latex:`x^2`,write:`^2`}),rV=tV({name:`X to the power of n`,latex:`x^{}`,command:`^`,ariaLabel:`exponent`}),iV=tV({name:`Square root`,latex:`\\sqrt{}`,command:`\\sqrt`}),aV=tV({name:`Nth root`,latex:`\\sqrt[{}]{}`,command:`\\nthroot`}),oV=s({absValue:()=>lV,approx:()=>pV,brackets:()=>dV,nApprox:()=>mV,notEqual:()=>hV,notSimilar:()=>_V,parenthesis:()=>uV,percentage:()=>fV,plusMinus:()=>cV,similar:()=>gV}),sV=BB(`misc`),cV=sV({name:`Plus or Minus`,latex:`\\pm`,write:`\\pm`}),lV=sV({name:`Absolute Value`,latex:`\\abs{}`,symbol:`| |`,command:`|`}),uV=sV({name:`Parenthesis`,latex:`\\left(\\right)`,symbol:`( )`,command:`(`}),dV=sV({name:`Brackets`,latex:`\\left[\\right]`,symbol:`[ ]`,command:`[`}),fV=sV({name:`Percent`,latex:`%`,command:`%`}),pV=sV({latex:`\\approx`,command:`\\approx`,ariaLabel:`Approximately equal to`}),mV=sV({latex:`\\napprox`,command:`\\napprox`,ariaLabel:`Not pproximately equal to`}),hV=sV({latex:`\\neq`,command:`\\neq`,ariaLabel:`Not equals`}),gV=sV({latex:`\\sim`,command:`\\sim`,ariaLabel:`Similar`}),_V=sV({latex:`\\nsim`,command:`\\nsim`,ariaLabel:`Not similar`}),vV=s({eulers:()=>xV,halfInfinity:()=>CV,infinity:()=>SV,pi:()=>bV}),yV=BB(`constants`),bV=yV({name:`Pi`,label:`π`,latex:`\\pi`,command:`\\pi`,category:`constants`}),xV=yV({name:`Eulers`,label:`e`,latex:`e`,command:`e`,category:`constants`}),SV=yV({name:`Infinity`,label:`\\infty`,latex:`\\infty`,command:`\\infty`,category:`constants`}),CV=yV({name:`Half Infinity`,label:`\\propto`,latex:`\\propto`,command:`\\propto`,category:`constants`}),wV=s({cos:()=>DV,cot:()=>jV,csc:()=>AV,sec:()=>kV,sin:()=>EV,tan:()=>OV}),TV=BB(`trigonometry`),EV=TV({name:`sine`,label:`sin`,command:`\\sin`,latex:`\\sin`}),DV=TV({name:`cosine`,label:`cos`,command:`\\cos`,latex:`\\cos`}),OV=TV({name:`tanget`,label:`tan`,command:`\\tan`,latex:`\\tan`}),kV=TV({name:`secant`,label:`sec`,command:`\\sec`,latex:`\\sec`}),AV=TV({name:`cosecant`,label:`csc`,command:`\\csc`,latex:`\\csc`}),jV=TV({name:`cotangent`,label:`cot`,command:`\\cot`,latex:`\\cot`}),MV=s({angle:()=>VV,circledDot:()=>qV,congruentTo:()=>XV,degree:()=>JV,doublePrimeArcSecond:()=>$V,leftArrow:()=>eH,leftrightArrow:()=>nH,measureOfAngle:()=>UV,notCongruentTo:()=>ZV,notParallel:()=>zV,overArc:()=>HV,overLeftRightArrow:()=>IV,overRightArrow:()=>FV,overline:()=>PV,parallel:()=>RV,parallelogram:()=>KV,perpindicular:()=>BV,primeArcminute:()=>QV,rightArrow:()=>tH,segment:()=>LV,similarTo:()=>YV,square:()=>GV,triangle:()=>WV}),NV=e=>({...e,category:`geometry`}),PV=NV({name:`Line`,latex:`\\overline{}`,command:`\\overline`}),FV=NV({name:`Ray`,latex:`\\overrightarrow{}`,command:`\\overrightarrow`}),IV=NV({name:`Segment`,latex:`\\overleftrightarrow{\\overline{}}`,symbol:`AB`,command:`\\overleftrightarrow`}),LV=NV({name:`Segment`,latex:`\\overleftrightarrow{AB}`,write:`\\overleftrightarrow{AB}`,label:`AB`}),RV=NV({name:`Parallel`,latex:`\\parallel`,command:`\\parallel`}),zV=NV({name:`Not Parallel`,latex:`\\nparallel`,command:`\\nparallel`}),BV=NV({name:`Perpendicular`,latex:`\\perp`,command:`\\perpendicular`}),VV=NV({name:`Angle`,latex:`\\angle`,command:`\\angle`}),HV=NV({name:`Over arc`,latex:`\\overarc{\\overline{}}`,command:`\\overarc`}),UV=NV({name:`Measured Angle`,latex:`\\measuredangle`,command:[`m`,`\\angle`]}),WV=NV({name:`Triangle`,latex:`\\triangle`,command:`\\triangle`}),GV=NV({name:`Square`,latex:`\\square`,command:`\\square`}),KV=NV({name:`Parallelogram`,latex:`\\parallelogram`,command:`\\parallelogram`}),qV=NV({name:`Circled Dot`,latex:`\\odot`,command:`\\odot`}),JV=NV({name:`Degree`,latex:`\\degree`,command:`\\degree`}),YV=NV({name:`Similar`,command:`\\sim`,latex:`\\sim`}),XV=NV({name:`Congruent To`,command:`\\cong`,latex:`\\cong`}),ZV=NV({name:`Not Congruent To`,command:`\\ncong`,latex:`\\ncong`}),QV=NV({name:`Prime`,label:`pam`,latex:`'`,write:`'`}),$V=NV({name:`Double Prime`,latex:`''`,write:`''`}),eH=NV({name:`Left Arrow`,latex:`\\leftarrow`,command:`\\leftarrow`}),tH=NV({name:`Right Arrow`,latex:`\\rightarrow`,command:`\\rightarrow`}),nH=NV({name:`Left and Right Arrow`,latex:`\\leftrightarrow`,command:`\\leftrightarrow`}),rH=s({circleDot:()=>iH}),iH=BB(`operators`)({name:`CircleDot`,label:`⋅`,write:`\\cdot`,ariaLabel:`Dot multiplier`}),aH=s({ln:()=>lH,log:()=>sH,logSubscript:()=>cH}),oH=BB(`log`),sH=oH({name:`Log`,label:`log`,command:`\\log`,latex:`\\log`}),cH=oH({name:`log base n`,label:`log s`,latex:`\\log_{}`,command:[`\\log`,`_`]}),lH=oH({name:`natural log`,label:`ln`,command:`\\ln`,latex:`\\ln`}),uH=s({subscript:()=>pH,superscript:()=>fH}),dH=BB(`sub-sup`),fH=dH({name:`Superscript`,latex:`x^{}`,command:`^`}),pH=dH({name:`Subscript`,latex:`x_{}`,command:`_`}),mH=s({mu:()=>vH,sigma:()=>yH,smallSigma:()=>bH,xBar:()=>gH,yBar:()=>_H}),hH=BB(`statistics`),gH=hH({name:`X Bar`,label:`x̄`,latex:`\\overline{x}`,write:`\\overline{x}`}),_H=hH({name:`Y Bar`,latex:`\\overline{y}`,write:`\\overline{y}`}),vH=hH({name:`mu`,label:`mu`,latex:`\\mu`,write:`\\mu`}),yH=hH({name:`Sigma`,ariaLabel:`Uppercase Sigma`,label:`\\Sigma`,latex:`\\Sigma`,write:`\\Sigma`}),bH=hH({name:`sigma`,ariaLabel:`Lowercase Sigma`,label:`\\sigma`,latex:`\\sigma`,write:`\\sigma`}),xH=s({divide:()=>EH,equals:()=>CH,minus:()=>TH,multiply:()=>DH,plus:()=>wH}),SH=BB(`operators`),CH=SH({write:`=`,label:`=`}),wH=SH({write:`+`,label:`+`}),TH=SH({write:`−`,label:`−`}),EH=SH({name:`divide`,label:`÷`,command:`\\divide`,otherNotation:`\\div`}),DH=SH({name:`multiply`,label:`×`,command:`\\times`}),OH=s({doubleCellMatrix:()=>jH,singleCellMatrix:()=>AH}),kH=BB(`matrices`),AH=kH({name:`Single Cell Matrix`,label:`[ ]`,write:`\\begin{pmatrix}\\end{pmatrix}`}),jH=kH({name:`Double Cell Matrix`,label:`[ ] [ ] \\\\newline [ ] [ ]`,write:`\\begin{bmatrix}&\\\\&\\end{bmatrix}`}),MH={0:`zero`,1:`one`,2:`two`,3:`three`,4:`four`,5:`five`,6:`six`,7:`seven`,8:`eight`,9:`nine`},NH=hc(10,String).map(e=>({name:MH[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`}}),PH=BB(`logic`),FH=PH({name:`Therefore`,label:`∴`,write:`∴`}),IH=PH({name:`Long division`,latex:`\\longdiv{}`,command:`\\longdiv`}),LH=BB(`navigation`),RH=LH({label:`◀`,keystroke:`Left`,ariaLabel:`Move cursor left`}),zH=LH({label:`▶`,keystroke:`Right`,ariaLabel:`Move cursor right`}),BH={label:`⌫`,category:`edit`,keystroke:`Backspace`,ariaLabel:`Delete`},VH=[[ZB,fV,KB,nV,iV],[iH,qB,pH,rV,aV],[cV,IB,LB,RB,zB],[bV,JB,uV,dV,lV],[hV,EV,DV,OV,JV]],HH=(()=>{let e=[...VH.map(e=>[...e])];return e[0].push({name:`i`,latex:`i`,write:`i`}),e[1].push(sH),e[2].push(cH),e[3].push(lH),e[4].push(xV),e})(),UH=(()=>{let e=[...VH.map(e=>[...e])];return e[0].push(vH),e[1].push(gH),e[2].push(_H),e[3].push(yH),e[4].push(bH),e})(),WH=[{predicate:e=>e>=3&&e<=5,set:[[IB,LB],[QB,$B],[KB,IH],[nV,rV]]},{predicate:e=>e>=6&&e<=7,set:[[JV,IB,LB],[iH,RB,zB],[KB,qB,nV,rV],[cV,QB,$B,iV],[bV,uV,lV,aV]]},{predicate:e=>e>=8||e===`HS`,set:VH},{predicate:`non-negative-integers`,set:[[NH.seven,NH.eight,NH.nine],[NH.four,NH.five,NH.six],[NH.one,NH.two,NH.three],[NH.zero,{name:``,latex:``,write:``},{name:``,latex:``,write:``}],[RH,zH,BH]]},{predicate:`integers`,set:[[NH.seven,NH.eight,NH.nine],[NH.four,NH.five,NH.six],[NH.one,NH.two,NH.three],[NH.zero,{name:``,latex:``,write:``},TH],[RH,zH,BH]]},{predicate:`decimals`,set:[[NH.seven,NH.eight,NH.nine],[NH.four,NH.five,NH.six],[NH.one,NH.two,NH.three],[NH.zero,NH.decimalPoint,TH],[RH,zH,BH]]},{predicate:`fractions`,set:[[NH.seven,NH.eight,NH.nine],[NH.four,NH.five,NH.six],[NH.one,NH.two,NH.three],[NH.zero,ZB,TH],[RH,zH,BH]]},{predicate:`geometry`,set:[[ZB,JV,QV,$V,XV,YV],[iH,VV,UV,WV,ZV,_V],[EV,DV,OV,bV,iV,aV],[AV,kV,jV,JB,pH,rV],[PV,FV,IV,HV,BV,RV]]},{predicate:`advanced-algebra`,set:HH},{predicate:`statistics`,set:UH},{predicate:`item-authoring`,set:[[EH,ZB,IH,CV,nV,iV,PV,FV,IV,sH],[DH,iH,{name:``,latex:``,write:``},pH,rV,aV,BV,RV,HV,cH],[cV,bV,JB,JV,VV,eH,tH,WV,GV,lH],[hV,lV,bH,vH,FH,yH,nH,EV,DV,OV],[RB,zB,{name:``,latex:``,write:``},{name:``,latex:``,write:``},SV,{name:``,latex:``,write:``},{name:``,latex:``,write:``},AV,kV,jV]]},{predicate:e=>e>=1&&e<=2,set:[]}],GH=e=>{let t=parseInt(e,10);if(e=isNaN(t)?e:t,!e)return[];let n=WH.find(t=>typeof t.predicate==`string`?t.predicate===e:t.predicate(e));if(n)return n.set||[];if(e!==`language`)return WH[2].set},KH=[...Object.values(xH),...Object.values(PB),...Object.values(vV),...Object.values(NH),...Object.values(eV),...Object.values(YB),...Object.values(MV),...Object.values(aH),...Object.values(OH),...Object.values(oV),...Object.values(rH),...Object.values(mH),...Object.values(uH),...Object.values(wV),...Object.values(WB)],qH=e=>(e||[]).map(e=>{let{latex:t}=e,n=(KH||[]).find(e=>t===e.latex||t===e.write||t===e.command||t===e.otherNotation);return t&&n||e}),JH=()=>{(Array.from(document.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:YH,two:XH,three:ZH,four:QH,five:$H,six:eU,seven:tU,eight:nU,nine:rU,zero:iU,comma:aU,decimalPoint:oU}=NH,sU=[[tU,nU,rU,EH],[QH,$H,eU,DH],[YH,XH,ZH,TH],[iU,oU,aU,wH],[RH,zH,BH,CH]];function K(e){this.elements=Array.isArray(e)?e:[e].filter(Boolean),this.length=this.elements.length;for(var t=0;t<this.elements.length;t++)this[t]=this.elements[t]}K.prototype.addClass=function(e){var t=(e||``).split(/\s+/).filter(Boolean);return this.elements.forEach(function(e){t.forEach(function(t){e.classList.add(t)})}),this},K.prototype.removeClass=function(e){return this.elements.forEach(function(t){e?(e||``).split(/\s+/).filter(Boolean).forEach(function(e){t.classList.remove(e)}):t.className=``}),this},K.prototype.toggleClass=function(e,t){var n=(e||``).split(/\s+/).filter(Boolean),r=arguments.length>1?!!t:null;return this.elements.forEach(function(e){n.forEach(function(t){r===null?e.classList.toggle(t):e.classList.toggle(t,r)})}),this},K.prototype.attr=function(e,t){return t===fU?this.elements[0]?this.elements[0].getAttribute(e):fU:(this.elements.forEach(function(n){n.setAttribute(e,t)}),this)},K.prototype.html=function(e){return e===fU?this.elements[0]?this.elements[0].innerHTML:``:(this.elements.forEach(function(t){t.innerHTML=e}),this)},K.prototype.append=function(e){var t=e instanceof K?e.elements[0]:e;return this.elements.forEach(function(e){e.appendChild(t)}),this},K.prototype.prepend=function(e){var t=e instanceof K?e.elements[0]:e;return this.elements.forEach(function(e,n){var r=n===0?t:t.cloneNode(!0);e.insertBefore(r,e.firstChild)}),this},K.prototype.wrapAll=function(e){if(!this.elements.length)return this;var t;if(typeof e==`string`&&e.trim().indexOf(`<`)===0){var n=document.createElement(`div`);n.innerHTML=e.trim(),t=n.firstChild}else if(e instanceof K)t=e.elements[0];else if(e&&e.nodeType)t=e;else return this;var r=this.elements[0],i=r.parentNode;return i&&(i.insertBefore(t,r),this.elements.forEach(function(e){t.appendChild(e)})),this},K.prototype.appendTo=function(e){var t=e instanceof K?e.elements[0]:e;return t&&this.elements.forEach(function(e){t.appendChild(e)}),this},K.prototype.prependTo=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.firstChild;return this.elements.forEach(function(e){t.insertBefore(e,n),n=e}),this},K.prototype.insertBefore=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.parentNode;return n&&this.elements.forEach(function(e){n.insertBefore(e,t)}),this},K.prototype.insertAfter=function(e){var t=e instanceof K?e.elements[0]:e;if(!t)return this;var n=t.parentNode,r=t.nextSibling;return n&&this.elements.forEach(function(e){n.insertBefore(e,r),r=e}),this},K.prototype.replaceWith=function(e){var t=[];return e instanceof K?t=e.elements.slice():e&&typeof e.length==`number`&&!e.tagName?t=Array.from(e):e&&e.nodeType&&(t=[e]),this.elements.forEach(function(e){var n=e.parentNode;n&&(t.forEach(function(t){n.insertBefore(t,e)}),n.removeChild(e))}),this},K.prototype.insDirOf=function(e,t){return e===-1?this.insertBefore(t.first()):this.insertAfter(t.last())},K.prototype.insAtDirEnd=function(e,t){return e===-1?this.prependTo(t):this.appendTo(t)},K.prototype.children=function(e){var t=[];return this.elements.forEach(function(n){var r;if(!e)r=Array.from(n.children);else if(e===`:first`)r=n.firstElementChild?[n.firstElementChild]:[];else if(e===`:last`)r=n.lastElementChild?[n.lastElementChild]:[];else{var i=/^:eq\((\d+)\)$/.exec(e);if(i){var a=parseInt(i[1],10),o=Array.from(n.children);r=o[a]?[o[a]]:[]}else r=Array.from(n.querySelectorAll(`:scope > `+e))}t.push.apply(t,r)}),new K(t)},K.prototype.find=function(e){var t=[];return this.elements.forEach(function(n){var r=Array.from(n.querySelectorAll(e));t.push.apply(t,r)}),new K(t)},K.prototype.closest=function(e){return new K(this.elements.map(function(t){return t.closest(e)}).filter(Boolean))},K.prototype.contents=function(){var e=[];return this.elements.forEach(function(t){var n=Array.from(t.childNodes);e.push.apply(e,n)}),new K(e)},K.prototype.filter=function(e){return new K(this.elements.filter(function(t,n){return e(n,t)}))},K.prototype.detach=function(){return this.elements.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this},K.prototype.remove=function(){return this.elements.forEach(function(e){e.remove()}),this},K.prototype.empty=function(){return this.elements.forEach(function(e){e.innerHTML=``}),this};function cU(e){return(e||``).split(`.`)[0]}K.prototype.on=function(e,t){var n=cU(e);return this.elements.forEach(function(e){e.addEventListener(n,t)}),this},K.prototype.bind=function(e,t,n){var r=this;if(typeof e==`object`){for(var i in e)e.hasOwnProperty(i)&&r.bind(i,e[i]);return this}var a=typeof t==`function`?t:n;return a===!1&&(a=function(e){e.preventDefault()}),(e||``).split(/\s+/).filter(Boolean).forEach(function(e){var t=cU(e);r.elements.forEach(function(e){e.addEventListener(t,a)})}),this},K.prototype.off=function(e,t){var n=cU(e);return this.elements.forEach(function(e){e.removeEventListener(n,t)}),this},K.prototype.unbind=function(e,t){if(e&&e.includes(`.`))this.elements.forEach(function(e){var t=e.cloneNode(!0);e.parentNode&&e.parentNode.replaceChild(t,e)});else if(e&&t){var n=cU(e);this.elements.forEach(function(e){e.removeEventListener(n,t)})}return this},K.prototype.trigger=function(e){var t=new Event(cU(e),{bubbles:!0,cancelable:!0});return this.elements.forEach(function(e){e.dispatchEvent(t)}),this},K.prototype.focus=function(e){return typeof e==`function`?this.on(`focus`,e):(this.elements.forEach(function(e){e.focus&&e.focus()}),this)},K.prototype.blur=function(e){return typeof e==`function`?this.on(`blur`,e):(this.elements.forEach(function(e){e.blur&&e.blur()}),this)},[`mousemove`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`click`,`keydown`,`keypress`,`keyup`,`focusout`,`paste`,`cut`,`copy`,`input`,`load`].forEach(function(e){K.prototype[e]=function(t){return this.on(e,t)}}),K.prototype.next=function(e){return new K(this.elements.map(function(e){return e.nextElementSibling}).filter(function(t){return!e||t&&t.matches(e)}))},K.prototype.prev=function(e){return new K(this.elements.map(function(e){return e.previousElementSibling}).filter(function(t){return!e||t&&t.matches(e)}))},K.prototype.parent=function(){return new K(this.elements.map(function(e){return e.parentElement}).filter(Boolean))},K.prototype.offset=function(){if(!this.elements[0])return{top:0,left:0};var e=this.elements[0].getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft)}},K.prototype.width=function(){var e=this.elements[0];if(!e)return 0;var t=window.getComputedStyle(e);return parseFloat(t.width)||e.getBoundingClientRect().width},K.prototype.height=function(){var e=this.elements[0];if(!e)return 0;var t=window.getComputedStyle(e);return parseFloat(t.height)||e.getBoundingClientRect().height},K.prototype.outerWidth=function(){return this.elements[0]?this.elements[0].offsetWidth:0},K.prototype.outerHeight=function(){return this.elements[0]?this.elements[0].offsetHeight:0},K.prototype.innerWidth=function(){return this.elements[0]?this.elements[0].clientWidth:0},K.prototype.innerHeight=function(){return this.elements[0]?this.elements[0].clientHeight:0},K.prototype.css=function(e,t){if(t===fU){if(typeof e==`string`){var n=this.elements[0];return n?window.getComputedStyle(n).getPropertyValue(e.replace(/([A-Z])/g,`-$1`).toLowerCase()):fU}}else this.elements.forEach(function(n){n.style[e]=t});return this},K.prototype.scrollTop=function(e){var t=this.elements[0];return e===fU?t?t===window?window.pageYOffset||document.documentElement.scrollTop:t.scrollTop:0:(t===window?window.scrollTo(window.pageXOffset||0,e):this.elements.forEach(function(t){t.scrollTop=e}),this)},K.prototype.scrollLeft=function(e){var t=this.elements[0];return e===fU?t?t===window?window.pageXOffset||document.documentElement.scrollLeft:t.scrollLeft:0:(t===window?window.scrollTo(e,window.pageYOffset||0):this.elements.forEach(function(t){t.scrollLeft=e}),this)},K.prototype.each=function(e){return this.elements.forEach(function(t,n){e.call(t,n,t)}),this},K.prototype.eq=function(e){return new K([this.elements[e]])},K.prototype.get=function(e){return e===fU?this.elements:e<0?this.elements[this.elements.length+e]:this.elements[e]},K.prototype.add=function(e){var t=this.elements.slice();return e instanceof K?t.push.apply(t,e.elements):Array.isArray(e)?t.push.apply(t,e):e&&e.nodeType&&t.push(e),new K(t)},K.prototype.first=function(){return new K([this.elements[0]])},K.prototype.last=function(){return new K([this.elements[this.elements.length-1]])},K.prototype.index=function(e){if(!e){var t=this.elements[0]&&this.elements[0].parentElement;return t?Array.from(t.children).indexOf(this.elements[0]):-1}var n=e instanceof K?e.elements[0]:e;return this.elements.indexOf(n)},K.prototype.is=function(e){return this.elements.some(function(t){return t.matches(e)})},K.prototype.text=function(e){return e===fU?this.elements.map(function(e){return e.textContent}).join(``):(this.elements.forEach(function(t){t.textContent=e}),this)},K.prototype.val=function(e){var t=this.elements[0];return t?e===fU?t.value===fU?t.textContent:t.value:(this.elements.forEach(function(t){t.value===fU?t.textContent=e:t.value=e}),this):fU};function lU(e){var t=Array.isArray(e)?e:[e].filter(Boolean),n=Object.create(K.prototype);n.elements=t,n.length=t.length;for(var r=0;r<t.length;r++)n[r]=t[r];return n}var uU=function(e,t){var n;if(!e)n=[];else if(e===window||e===document)n=[e];else if(e.nodeType)n=[e];else if(e&&e.current&&e.current.nodeType)n=[e.current];else if(typeof e==`string`&&e[0]===`<`){var r=document.createElement(`div`);r.innerHTML=e.trim(),n=Array.from(r.children)}else if(typeof e==`string`){var i=t instanceof K?t.elements[0]:t||document;n=Array.from(i.querySelectorAll(e))}else n=e instanceof K?e.elements:e.length===fU?[]:Array.from(e);return lU(n)};uU.contains=function(e,t){return e!==t&&e.contains(t)};var dU=uU,fU,pU=`mathquill-command-id`,mU=`mathquill-block-id`,hU=Math.min,gU=Math.max;function _U(){}var vU=[].slice;function yU(e){var t=e.length-1;return function(){var n=vU.call(arguments,0,t),r=vU.call(arguments,t);return e.apply(this,n.concat([r]))}}var bU=yU(function(e,t){return yU(function(n,r){if(e in n)return n[e].apply(n,t.concat(r))})});function xU(e){return yU(function(t,n){return typeof t!=`function`&&(t=bU(t)),e.call(this,function(e){return t.apply(e,[e].concat(n))})})}function q(e){var t=vU.call(arguments,1);return function(){return e.apply(this,t)}}function SU(e,t){if(!t)throw Error(`prayer failed: `+e)}var J=(function(e,t,n){function r(e){return typeof e==`object`}function i(e){return typeof e==`function`}function a(){}return function o(s,c){c===n&&(c=s,s=Object);function l(){var e=new u;return i(e.init)&&e.init.apply(e,arguments),e}function u(){}l.Bare=u;var d=a[e]=s[e],f=u[e]=l[e]=l.p=new a,p;return f.constructor=l,l.extend=function(e){return o(l,e)},(l.open=function(e){if(p={},i(e)?p=e.call(l,f,d,l,s):r(e)&&(p=e),r(p))for(var n in p)t.call(p,n)&&(f[n]=p[n]);return i(f.init)||(f.init=s),l})(c)}})(`prototype`,{}.hasOwnProperty),Y=-1,X=1;function CU(e){SU(`a direction was passed`,e===Y||e===X)}var wU=J(function(e){e.parent=0,e[Y]=0,e[X]=0,e.init=function(e,t,n){this.parent=e,this[Y]=t,this[X]=n},this.copy=function(e){return wU(e.parent,e[Y],e[X])}}),TU=J(function(e){e[Y]=0,e[X]=0,e.parent=0;var t=0;function n(){return t+=1}this.byId={},e.init=function(){this.id=n(),TU.byId[this.id]=this,this.ends={},this.ends[Y]=0,this.ends[X]=0},e.dispose=function(){delete TU.byId[this.id]},e.toString=function(){return`{{ MathQuill Node #`+this.id+` }}`},e.jQ=uU(),e.jQadd=function(e){return this.jQ=this.jQ.add(e)},e.jQize=function(e){var e=uU(e||this.html());function t(e){if(e.getAttribute){var n=e.getAttribute(`mathquill-command-id`),r=e.getAttribute(`mathquill-block-id`);n&&TU.byId[n].jQadd(e),r&&TU.byId[r].jQadd(e)}for(e=e.firstChild;e;e=e.nextSibling)t(e)}for(var n=0;n<e.length;n+=1)t(e[n]);return e},e.createDir=function(e,t){CU(e);var n=this;return n.jQize(),n.jQ.insDirOf(e,t.jQ),t[e]=n.adopt(t.parent,t[Y],t[X]),n},e.createLeftOf=function(e){return this.createDir(Y,e)},e.selectChildren=function(e,t){return jU(e,t)},e.bubble=xU(function(e){for(var t=this;t&&e(t)!==!1;t=t.parent);return this}),e.postOrder=xU(function(e){return(function t(n){n.eachChild(t),e(n)})(this),this}),e.isEmpty=function(){return this.ends[Y]===0&&this.ends[X]===0},e.isStyleBlock=function(){return!1},e.children=function(){return DU(this.ends[Y],this.ends[X])},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 DU(this,this).withDirAdopt(e,t,n,r),this},e.adopt=function(e,t,n){return DU(this,this).adopt(e,t,n),this},e.disown=function(){return DU(this,this).disown(),this},e.remove=function(){return this.jQ.remove(),this.postOrder(`dispose`),this.disown()}});function EU(e,t,n){SU(`a parent is always present`,e),t&&(t[X]!==n&&(t[X]=n),t.parent!==e&&(t.parent=e)),n&&(n[Y]!==t&&(n[Y]=t),n.parent!==e&&(n.parent=e)),SU(`leftward is properly set up`,(function(){return t?t[X]===n&&t.parent===e:e.ends[Y]===n})()),SU(`rightward is properly set up`,(function(){return n?n[Y]===t&&n.parent===e:e.ends[X]===t})())}var DU=J(function(e){e.init=function(e,t,n){if(n===fU&&(n=Y),CU(n),SU(`no half-empty fragments`,!e==!t),this.ends={},e){SU(`withDir is passed to Fragment`,e instanceof TU),SU(`oppDir is passed to Fragment`,t instanceof TU),SU(`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=uU(),e.withDirAdopt=function(e,t,n,r){return e===Y?this.adopt(t,n,r):this.adopt(t,r,n)},e.adopt=function(e,t,n){EU(e,t,n);var r=this;r.disowned=!1;var i=r.ends[Y];if(!i)return this;var a=r.ends[X];return t||(e.ends[Y]=i),n?n[Y]=a:e.ends[X]=a,r.ends[X][X]=n,r.each(function(n){n[Y]=t,n.parent=e,t&&(t[X]=n),t=n}),r},e.disown=function(){var e=this,t=e.ends[Y];if(!t||e.disowned)return e;e.disowned=!0;var n=e.ends[X],r=t.parent;return EU(r,t[Y],t),EU(r,n,n[X]),t[Y]?t[Y][X]=n[X]:r.ends[Y]=n[X],n[X]?n[X][Y]=t[Y]:r.ends[X]=t[Y],e},e.remove=function(){return this.jQ.remove(),this.each(`postOrder`,`dispose`),this.disown()},e.each=xU(function(e){var t=this,n=t.ends[Y];if(!n)return t;for(;n!==t.ends[X][X]&&e(n)!==!1;n=n[X]);return t}),e.fold=function(e,t){return this.each(function(n){e=t.call(this,e,n)}),e}}),Z={},OU={},kU={},AU=J(wU,function(e){e.init=function(e,t){this.parent=e,this.options=t;var n=this.jQ=this._jQ=uU(`<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[X]?this.selection&&this.selection.ends[Y][Y]===this[Y]?this.jQ.insertBefore(this.selection.jQ):this.jQ.insertBefore(this[X].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=uU(),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 CU(e),!t||!t.jQ?this:(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(Y,e)},e.insRightOf=function(e){return this.insDirOf(X,e)},e.insAtDirEnd=function(e,t){return CU(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(Y,e)},e.insAtRightEnd=function(e){return this.insAtDirEnd(X,e)},e.jumpUpDown=function(e,t){var n=this;n.upDownCache[e.id]=wU.copy(n);var r=n.upDownCache[t.id];if(r)r[X]?n.insLeftOf(r[X]):n.insAtRightEnd(r.parent);else{var i=n.offset().left;t.seek(i,n)}},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[X],r=this,i=e[Y];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[X])}),!this[X])if(this[Y])this[X]=this[Y][X];else for(;!this[X];)if(this.parent=this.parent[X],this.parent)this[X]=this.parent.ends[Y];else{this[X]=e[X],this.parent=t;break}this[X]?this.insLeftOf(this[X]):this.insAtRightEnd(t),e.jQ.remove(),e[Y].siblingDeleted&&e[Y].siblingDeleted(r.options,X),e[X].siblingDeleted&&e[X].siblingDeleted(r.options,Y)},e.startSelection=function(){for(var e=this.anticursor=wU.copy(this),t=e.ancestors={},n=e;n.parent;n=n.parent)t[n.parent.id]=n},e.endSelection=function(){delete this.anticursor},e.select=function(){var e=this.anticursor;if(!e||!e.ancestors||this[Y]===e[Y]&&this.parent===e.parent)return!1;for(var t,n=this;n.parent;n=n.parent)if(n.parent.id in e.ancestors){t=n.parent;break}if(!t)return!1;var r=e.ancestors[t.id],i,a,o=X;if(n[Y]!==r){for(var s=n;s;s=s[X])if(s[X]===r[X]){o=Y,i=n,a=r;break}}return o===X&&(i=r,a=n),i instanceof wU&&(i=i[X]),a instanceof wU&&(a=a[Y]),!i||!a?!1:(this.hide().selection=t.selectChildren(i,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[Y]=this.selection.ends[Y][Y],this[X]=this.selection.ends[X][X],this.selection.remove(),this.selectionChanged(),delete this.selection)},e.replaceSelection=function(){var e=this.selection;return e&&(this[Y]=e.ends[Y][Y],this[X]=e.ends[X][X],delete this.selection),e},e.depth=function(){for(var e=this,t=0;e=e.parent;)t+=+(e instanceof QU);return t},e.isTooDeep=function(e){if(this.options.maxDepth!==fU)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}}),jU=J(DU,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(){var e=this.jQ[0];return e&&this.jQ.replaceWith(e.childNodes),this},e.join=function(e){return this.fold(``,function(t,n){return t+n[e]()})}}),MU=J(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=AU(e,n)},e.handle=function(e,t){var n=this.options.handlers;if(n&&n.fns[e]){var r=n.APIClasses[this.KIND_OF_MQ](this);t===Y||t===X?n.fns[e](t,r):n.fns[e](r)}};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}}),NU={},PU=J(),FU={},IU=J(),LU={};function RU(){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:
290
+
291
+ MathQuill = MathQuill.getInterface(1);
292
+ // now MathQuill.MathField() works like it used to
293
+
294
+ See also the "\`dev\` branch (2014–2015) → v0.10.0 Migration Guide" at
295
+ https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide`)}function zU(e){return RU(),YW(e)}zU.prototype=IU.p,zU.VERSION=`v1.2.1-beta.1`,zU.interfaceVersion=function(e){if(e!==1)throw`Only interface version 1 supported. You specified: `+e;return RU=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:
296
+
297
+ MathQuill = MathQuill.getInterface(1);
298
+ // now MathQuill.MathField() works like it used to
299
+
300
+ See also the "\`dev\` branch (2014–2015) → v0.10.0 Migration Guide" at
301
+ https://github.com/mathquill/mathquill/wiki/%60dev%60-branch-(2014%E2%80%932015)-%E2%86%92-v0.10.0-Migration-Guide`)},RU(),zU},zU.getInterface=HU;var BU=HU.MIN=1,VU=HU.MAX=3;function HU(e){if(!(BU<=e&&e<=VU))throw`Only interface versions between `+BU+` and `+VU+` supported. You specified: `+e;if(e<3&&typeof window<`u`&&!window.jQuery)throw`MathQuill interface version `+e+` requires jQuery 1.5.2+ to be loaded first`;function t(e){if(!e||!e.nodeType)return null;var t=uU(e).children(`.mq-root-block`).attr(mU),r=t&&TU.byId[t].controller;return r?n[r.KIND_OF_MQ](r):null}var n={};t.L=Y,t.R=X,t.saneKeyboardEvents=KU;function r(e,t){for(var r in t&&t.handlers&&(t.handlers={fns:t.handlers,APIClasses:n}),t)if(t.hasOwnProperty(r)){var i=t[r],a=FU[r];e[r]=a?a(i):i}}t.config=function(e){return r(PU.p,e),this},t.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`;LU[e]=t};var i=n.AbstractMathQuill=J(IU,function(t){t.init=function(e){this.__controller=e,this.__options=e.options,this.id=e.id,this.data=e.data},t.parseLatex=function(e){return this.__controller.parseLatex(e)},t.__mathquillify=function(t){var n=this.__controller,r=n.root,i=n.container;n.createTextarea();var a=i.addClass(t).contents().detach();r.jQ=uU(`<span class="mq-root-block"/>`).attr(mU,r.id).appendTo(i),this.latex(a.text()),this.revert=function(){var t=i.empty().unbind(`.mathquill`).removeClass(`mq-editable-field mq-math-mode mq-text-mode`).append(a);return e>=3?t[0]:t}},t.config=function(e){return r(this.__options,e),this},t.el=function(){return this.__controller.container[0]},t.text=function(){return this.__controller.exportText()},t.latex=function(e){return arguments.length>0?(this.__controller.renderLatexMath(e),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this):this.__controller.exportLatex()},t.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,``)},t.reflow=function(){return this.__controller.root.postOrder(`reflow`),this}});for(var a in t.prototype=i.prototype,n.EditableField=J(i,function(e,t){e.__mathquillify=function(){return t.__mathquillify.apply(this,arguments),this.__controller.editable=!0,this.__controller.delegateMouseEvents(),this.__controller.editablesTextareaEvents(),this},e.focus=function(){return this.__controller.textarea.focus(),this},e.blur=function(){return this.__controller.textarea.blur(),this},e.write=function(e){return this.__controller.writeLatex(e),this.__controller.scrollHoriz(),this.__controller.blurred&&this.__controller.cursor.hide().parent.blur(),this},e.empty=function(){var e=this.__controller.root,t=this.__controller.cursor;return e.eachChild(`postOrder`,`dispose`),e.ends[Y]=e.ends[X]=0,e.jQ.empty(),delete t.selection,t.insAtRightEnd(e),this},e.cmd=function(e){var t=this.__controller.notify(),n=t.cursor;if(/^\\[a-z]+$/i.test(e)&&!n.isTooDeep()){e=e.slice(1);var r=Z[e];r&&(e=r(e),n.selection&&e.replaces(n.replaceSelection()),e.createLeftOf(n.show()),this.__controller.scrollHoriz())}else n.parent.write(n,e);return t.blurred&&n.hide().parent.blur(),this},e.select=function(){var e=this.__controller;for(e.notify(`move`).cursor.insAtRightEnd(e.root);e.cursor[Y];)e.selectLeft();return this},e.clearSelection=function(){return this.__controller.cursor.clearSelection(),this},e.moveToDirEnd=function(e){return this.__controller.notify(`move`).cursor.insAtDirEnd(e,this.__controller.root),this},e.moveToLeftEnd=function(){return this.moveToDirEnd(Y)},e.moveToRightEnd=function(){return this.moveToDirEnd(X)},e.keystroke=function(e){for(var e=e.replace(/^\s+|\s+$/g,``).split(/\s+/),t=0;t<e.length;t+=1)this.__controller.keystroke(e[t],{preventDefault:_U});return this},e.typedText=function(e){for(var t=0;t<e.length;t+=1)this.__controller.typedText(e.charAt(t));return this},e.dropEmbedded=function(e,t,n){var r=e-uU(window).scrollLeft(),i=t-uU(window).scrollTop(),a=document.elementFromPoint(r,i);this.__controller.seek(uU(a),e,t),qW().setOptions(n).createLeftOf(this.__controller.cursor)},e.clickAt=function(e,t,n){n||=document.elementFromPoint(e,t);var r=this.__controller,i=r.root;return dU.contains(i.jQ[0],n)||(n=i.jQ[0]),r.seek(uU(n),e+pageXOffset,t+pageYOffset),r.blurred&&this.focus(),this},e.ignoreNextMousedown=function(e){return this.__controller.cursor.options.ignoreNextMousedown=e,this}}),t.EditableField=function(){throw`wtf don't call me, I'm 'abstract'`},t.EditableField.prototype=n.EditableField.prototype,NU)(function(r,i){var a=n[r]=i(n);t[r]=function(n,i){var o=t(n);if(o instanceof a||!n||!n.nodeType)return o;var s=MU(a.RootBlock(),uU(n),PU());return s.KIND_OF_MQ=r,a(s).__mathquillify(i,e)},t[r].prototype=a.prototype})(a,NU[a]);return t}zU.noConflict=function(){return window.MathQuill=UU,zU};var UU=window.MathQuill;window.MathQuill=zU;function WU(e){for(var t=`moveOutOf deleteOutOf selectOutOf upOutOf downOutOf`.split(` `),n=0;n<t.length;n+=1)(function(t){e[t]=function(e){this.controller.handle(t,e)}})(t[n]);e.reflow=function(){this.controller.handle(`reflow`),this.controller.handle(`edited`),this.controller.handle(`edit`)}}var GU=J(function(e,t,n){function r(e,t){throw e=e?`'`+e+`'`:`EOF`,`Parse Error: `+t+` at `+e}e.init=function(e){this._=e},e.parse=function(e){return this.skip(o)._(``+e,t,r);function t(e,t){return t}},e.or=function(e){SU(`or is passed a parser`,e instanceof n);var t=this;return n(function(n,r,i){return t._(n,r,a);function a(t){return e._(n,r,i)}})},e.then=function(e){var t=this;return n(function(r,i,a){return t._(r,o,a);function o(t,r){var o=e instanceof n?e:e(r);return SU(`a parser is returned`,o instanceof n),o._(t,i,a)}})},e.many=function(){var e=this;return n(function(t,n,r){for(var i=[];e._(t,a,o););return n(t,i);function a(e,n){return t=e,i.push(n),!0}function o(){return!1}})},e.times=function(e,t){arguments.length<2&&(t=e);var r=this;return n(function(n,i,a){for(var o=[],s=!0,c,l=0;l<e;l+=1)if(s=r._(n,u,d),!s)return a(n,c);for(;l<t&&s;l+=1)s=r._(n,u,f);return i(n,o);function u(e,t){return o.push(t),n=e,!0}function d(e,t){return c=t,n=e,!1}function f(e,t){return!1}})},e.result=function(e){return this.then(a(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 a(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)})};var i=this.regex=function(e){SU(`regexp parser is anchored`,e.toString().charAt(1)===`^`);var t=`expected `+e;return n(function(n,r,i){var a=e.exec(n);if(a){var o=a[0];return r(n.slice(o.length),o)}else return i(n,t)})},a=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=i(/^[a-z]/i),n.letters=i(/^[a-z]*/i),n.digit=i(/^[0-9]/),n.digits=i(/^[0-9]*/),n.whitespace=i(/^\s+/),n.optWhitespace=i(/^\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)});var o=n.eof=n(function(e,t,n){return e?n(e,`expected EOF`):t(e,e)})}),KU=function(){var e={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`};function t(t){var n=t.which||t.keyCode,r=e[n],i,a=[];return t.ctrlKey&&a.push(`Ctrl`),t.originalEvent&&t.originalEvent.metaKey&&a.push(`Meta`),t.altKey&&a.push(`Alt`),t.shiftKey&&a.push(`Shift`),i=r||String.fromCharCode(n),!a.length&&!r?i:(a.push(i),a.join(`-`))}return function(e,n){var r=null,i=null,a=dU(e),o=dU(n.container||a),s=_U,c;function l(e){s=e,clearTimeout(c),c=setTimeout(e)}function u(e){l(function(t){s=_U,clearTimeout(c),e(t)})}o.bind(`keydown keypress input keyup focusout paste`,function(e){s(e)});function d(e){s(),s=_U,clearTimeout(c),a.val(e),e&&a[0]&&a[0].select&&a[0].select(),f=!!e}var f=!1;function p(){var e=a[0];return`selectionStart`in e&&e.selectionStart!==e.selectionEnd}function m(){n.keystroke(t(r),r)}function h(e){r=e,i=null,f&&u(function(e){!(e&&e.type===`focusout`)&&a[0]&&a[0].select&&a[0].select()}),m()}function g(e){r&&i&&m(),i=e,l(v)}function _(e){r&&!i&&l(v)}function v(){if(!p()){var e=a.val();e.length===1?(a.val(``),n.typedText(e)):e&&a[0]&&a[0].select&&a[0].select()}}function y(){r=i=null}function b(e){a.focus(),l(x)}function x(){var e=a.val();a.val(``),e&&n.paste(e)}return o.bind({keydown:h,keypress:g,keyup:_,focusout:y,cut:function(){u(function(){n.cut()})},copy:function(){u(function(){n.copy()})},paste:b}),{select:d}}}();MU.open(function(e,t){e.exportText=function(){return this.root.foldChildren(``,function(e,t){return e+t.text()})}}),MU.open(function(e){e.focusBlurEvents=function(){var e=this,t=e.root,n=e.cursor,r;e.textarea.focus(function(){e.blurred=!1,clearTimeout(r),e.container.addClass(`mq-focused`),n.parent||n.insAtRightEnd(t),n.selection?(n.selection.jQ.removeClass(`mq-blur`),e.selectionChanged()):n.show()}).blur(function(){e.blurred=!0,r=setTimeout(function(){t.postOrder(`intentionalBlur`),n.clearSelection().endSelection(),a()}),uU(window).bind(`blur`,i)});function i(){clearTimeout(r),n.selection&&n.selection.jQ.addClass(`mq-blur`),a()}function a(){n.hide().parent.blur(),e.container.removeClass(`mq-focused`),uU(window).unbind(`blur`,i)}e.blurred=!0,n.hide().parent.blur()}}),MU.open(function(e){e.keystroke=function(e,t){this.cursor.parent.keystroke(e,t,this)}}),TU.open(function(e){e.keystroke=function(e,t,n){var r=n.cursor;switch(e){case`Ctrl-Shift-Backspace`:case`Ctrl-Backspace`:n.ctrlDeleteDir(Y);break;case`Shift-Backspace`:case`Backspace`:n.backspace();break;case`Esc`:case`Tab`:n.escapeDir(X,e,t);return;case`Shift-Tab`:case`Shift-Esc`:n.escapeDir(Y,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[X];)n.selectRight();break;case`Ctrl-Shift-End`:for(;r[X]||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[Y];)n.selectLeft();break;case`Ctrl-Shift-Home`:for(;r[Y]||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[Y])for(;r[Y];)n.selectLeft();else n.selectLeft();case`Shift-Down`:if(r[X])for(;r[X];)n.selectRight();else n.selectRight();case`Ctrl-Up`:break;case`Ctrl-Down`:break;case`Ctrl-Shift-Del`:case`Ctrl-Del`:n.ctrlDeleteDir(X);break;case`Shift-Del`:case`Del`:n.deleteForward();break;case`Meta-A`:case`Ctrl-A`:for(n.notify(`move`).cursor.insAtRightEnd(n.root);r[Y];)n.selectLeft();break;default:return}t.preventDefault(),n.scrollHoriz()},e.moveOutOf=e.moveTowards=e.deleteOutOf=e.deleteTowards=e.unselectInto=e.selectOutOf=e.selectTowards=function(){SU(`overridden or never called on this node`)}}),MU.open(function(e){this.onNotify(function(e){(e===`move`||e===`upDown`)&&this.show().clearSelection()}),e.escapeDir=function(e,t,n){CU(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`)},FU.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){CU(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(Y)},e.moveRight=function(){return this.moveDir(X)},e.moveUp=function(){return t(this,`up`)},e.moveDown=function(){return t(this,`down`)};function t(e,t){var n=e.notify(`upDown`).cursor,r=t+`Into`,i=t+`OutOf`;return n[X][r]?n.insAtLeftEnd(n[X][r]):n[Y][r]?n.insAtRightEnd(n[Y][r]):n.parent.bubble(function(e){var t=e[i];if(t&&(typeof t==`function`&&(t=e[i](n)),t instanceof TU&&n.jumpUpDown(e,t),t!==!0))return!1}),e}this.onNotify(function(e){e!==`upDown`&&(this.upDownCache={})}),this.onNotify(function(e){e===`edit`&&this.show().deleteSelection()}),e.deleteDir=function(e){CU(e);var t=this.cursor,n=t.selection;return this.notify(`edit`),n||(t[e]?t[e].deleteTowards(e,t):t.parent.deleteOutOf(e,t)),t[Y].siblingDeleted&&t[Y].siblingDeleted(t.options,X),t[X].siblingDeleted&&t[X].siblingDeleted(t.options,Y),t.parent.bubble(`reflow`),this},e.ctrlDeleteDir=function(e){CU(e);var t=this.cursor;return!t[e]||t.selection?this.deleteDir(e):(this.notify(`edit`),e===Y?DU(t.parent.ends[Y],t[Y]).remove():DU(t[X],t.parent.ends[X]).remove(),t.insAtDirEnd(e,t.parent),t[Y].siblingDeleted&&t[Y].siblingDeleted(t.options,X),t[X].siblingDeleted&&t[X].siblingDeleted(t.options,Y),t.parent.bubble(`reflow`),this)},e.backspace=function(){return this.deleteDir(Y)},e.deleteForward=function(){return this.deleteDir(X)},this.onNotify(function(e){e!==`select`&&this.endSelection()}),e.selectDir=function(e){var t=this.notify(`select`).cursor,n=t.selection;CU(e),t.anticursor||t.startSelection();var r=t[e];r?n&&n.ends[e]===r&&t.anticursor[-e]!==r?r.unselectInto(e,t):r.selectTowards(e,t):t.parent.selectOutOf(e,t),t.clearSelection(),t.select()||t.show()},e.selectLeft=function(){return this.selectDir(Y)},e.selectRight=function(){return this.selectDir(X)}});var qU=/[\\]{2,}/gm,JU=(function(){function e(e){var t=QU();return e.adopt(t,0,0),t}function t(e){for(var t=e[0]||QU(),n=1;n<e.length;n+=1)e[n].children().adopt(t,t.ends[X],0);return t}var n=GU.string,r=GU.regex,i=GU.letter,a=GU.any,o=GU.optWhitespace,s=GU.succeed,c=GU.fail,l=i.map(function(e){return sW(e)}),u=r(/^[^${}\\_^]/).map(function(e){return Q(e)}),d=r(/^\\not\\[a-z]+/).then(function(e){return kU[e]&&kU[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=Z[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})();MU.open(function(e,t){e.exportLatex=function(){return this.root.latex().replace(/(\\[a-z]+) (?![a-z])/gi,`$1`)},e.parseLatex=function(e){return JU.parse(e).postOrder(`finalizeTree`,PU.p).join(`latex`).trim()},FU.maxDepth=function(e){return typeof e==`number`?e:fU},e.writeLatex=function(e){var t=this.notify(`edit`).cursor,n=GU.all,r=GU.eof,i=JU.skip(r).or(n.result(!1)).parse(e);return i&&!i.isEmpty()&&i.prepareInsertionAt(t)&&(i.children().adopt(t.parent,t[Y],t[X]),i.jQize().insertBefore(t.jQ),t[Y]=i.ends[X],i.finalizeInsert(t.options,t),i.ends[X][X].siblingCreated&&i.ends[X][X].siblingCreated(t.options,Y),i.ends[Y][Y].siblingCreated&&i.ends[Y][Y].siblingCreated(t.options,X),t.parent.bubble(`reflow`)),this},e.renderLatexMath=function(e){e&&e.replace&&(e=e.replace(qU,`\\`));var t=this.root,n=this.cursor;n.options;var r=t.jQ,i=GU.all,a=GU.eof,o=JU.skip(a).or(i.result(!1)).parse(e);if(t.eachChild(`postOrder`,`dispose`),t.ends[Y]=t.ends[X]=0,o&&o.prepareInsertionAt(n)){o.children().adopt(t,0,0);var s=o.join(`html`);r.html(s),t.jQize(r.children()),t.finalizeInsert(n.options)}else r.empty();delete n.selection,n.insAtRightEnd(t)},e.renderLatexText=function(e){var t=this.root,n=this.cursor;t.jQ.children().slice(1).remove(),t.eachChild(`postOrder`,`dispose`),t.ends[Y]=t.ends[X]=0,delete n.selection,n.show().insAtRightEnd(t);var r=GU.regex,i=GU.string,a=GU.eof,o=GU.all,s=i(`$`).then(JU).skip(i(`$`).or(a)).map(function(e){var t=rW(n);t.createBlocks();var r=t.ends[Y];return e.children().adopt(r,0,0),t}),c=i(`\\$`).result(`$`).or(r(/^[^$]/)).map(Q),l=s.or(c).many().skip(a).or(o.result(!1)).parse(e);if(l){for(var u=0;u<l.length;u+=1)l[u].adopt(t,t.ends[X],0);t.jQize().appendTo(t.jQ),t.finalizeInsert(n.options)}}}),MU.open(function(e){PU.p.ignoreNextMousedown=_U,e.delegateMouseEvents=function(){var e=this.root.jQ;this.container.bind(`mousedown.mathquill`,function(t){var n=uU(t.target).closest(`.mq-root-block`),r=TU.byId[n.attr(mU)||e.attr(mU)].controller,i=r.cursor;i.blink;var a=r.textareaSpan,o=r.textarea;if(t.preventDefault(),t.target.unselectable=!0,i.options.ignoreNextMousedown(t))return;i.options.ignoreNextMousedown=_U;function s(e){i.anticursor||i.startSelection(),r.seek(uU(e.target),e.pageX,e.pageY).cursor.select(),e.target&&uU(e.target.ownerDocument).unbind(`mousemove`,c)}function c(e){return delete e.target,s(e)}function l(e){!i.selection&&!r.editable&&a.detach(),n.unbind(`mousemove`,s),uU(e.target.ownerDocument).unbind(`mousemove`,c).unbind(`mouseup`,l)}if(a.parent().length===0)return!1;r.blurred&&(r.editable||n.prepend(a),document.body.focus(),o.focus()),t.preventDefault(),t.target.unselectable=!0,i.show(),r.seek(uU(t.target),t.pageX,t.pageY).cursor.startSelection(),n.mousemove(s),uU(t.target.ownerDocument).mousemove(c).mouseup(l)})}}),MU.open(function(e){e.seek=function(e,t,n){var r=this.notify(`select`).cursor;if(e){var i=e.attr(mU)||e.attr(pU);if(!i){var a=e.parent();i=a.attr(mU)||a.attr(pU)}}var o=i&&TU.byId[i]?TU.byId[i]:this.root;return r.clearSelection().show(),o.seek(t,r),this.scrollHoriz(),this}}),MU.open(function(e){e.scrollHoriz=function(){var e=this.cursor,t=e.selection,n=this.root.jQ[0].getBoundingClientRect();if(t){var r=t.jQ[0].getBoundingClientRect(),i=r.left-(n.left+20),a=r.right-(n.right-20);if(t.ends[Y]===e[X])if(i<0)var o=i;else if(a>0)if(r.left-a<n.left+20)var o=i;else var o=a;else return;else if(a>0)var o=a;else if(i<0)if(r.right-i>n.right-20)var o=a;else var o=i;else return}else{var s=e.jQ[0].getBoundingClientRect().left;if(s>n.right-20)var o=s-(n.right-20);else if(s<n.left+20)var o=s-(n.left+20);else return}this.root.jQ.stop&&typeof this.root.jQ.stop==`function`&&this.root.jQ.stop().animate({scrollLeft:`+=`+o},100)}}),MU.open(function(e){PU.p.substituteTextarea=function(){return uU(`<textarea autocapitalize=off autocomplete=off autocorrect=off spellcheck=false x-palm-disable-ste-all=true />`)[0]},e.createTextarea=function(){var e=this.textareaSpan=uU(`<span class="mq-textarea"></span>`),t=this.options.substituteTextarea();if(!t.nodeType)throw`substituteTextarea() must return a DOM element, got `+t;t=this.textarea=uU(t).appendTo(e);var n=this;n.cursor.selectionChanged=function(){n.selectionChanged()}},e.selectionChanged=function(){var e=this;xW(e.container[0]),e.textareaSelectionTimeout===fU&&(e.textareaSelectionTimeout=setTimeout(function(){e.setTextareaSelection()}))},e.setTextareaSelection=function(){this.textareaSelectionTimeout=fU;var e=``;this.cursor.selection&&(e=this.cursor.selection.join(`latex`),this.options.statelessClipboard&&(e=`$`+e+`$`)),this.selectFn(e)},e.staticMathTextareaEvents=function(){var e=this;e.root;var t=e.cursor,n=e.textarea,r=e.textareaSpan;this.container.prepend(dU(`<span class="mq-selectable">`).text(`$`+e.exportLatex()+`$`)),e.blurred=!0,n.bind(`cut paste`,!1).bind(`copy`,function(){e.setTextareaSelection()}).focus(function(){e.blurred=!1}).blur(function(){t.selection&&t.selection.clear(),setTimeout(i)});function i(){r.detach(),e.blurred=!0}e.selectFn=function(e){n.val(e),e&&n.select()}},PU.p.substituteKeyboardEvents=KU,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===`
302
+ `)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()}});var YU=J(TU,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[X].siblingCreated&&n[X].siblingCreated(e,Y),n[Y].siblingCreated&&n[Y].siblingCreated(e,X),n.bubble(`reflow`)},e.prepareInsertionAt=function(e){var t=e.options.maxDepth;if(t!==fU){var n=e.depth();if(n>t)return!1;this.removeNodesDeeperThan(t-n)}return!0},e.removeNodesDeeperThan=function(e){for(var t=0,n=[[this,t]],r;n.length;)r=n.shift(),r[0].children().each(function(i){var a=+(i instanceof QU);t=r[1]+a,t<=e?n.push([i,t]):(a?i.children():i).remove()})}}),XU=J(YU,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=JU.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[X],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[Y],0,0),r.jQ.appendTo(n.ends[Y].jQ),n.placeCursor(e),n.prepareInsertionAt(e)),n.finalizeInsert(e.options),n.placeCursor(e)},e.createBlocks=function(){for(var e=this,t=e.numBlocks(),n=e.blocks=Array(t),r=0;r<t;r+=1)(n[r]=QU()).adopt(e,e.ends[X],0)},e.placeCursor=function(e){e.insAtRightEnd(this.foldChildren(this.ends[Y],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 jU(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[Y]=e.jQ.offset().left,t[X]=t[Y]+e.jQ.outerWidth(),t}var r=this,i=n(r);if(e<i[Y])return t.insLeftOf(r);if(e>i[X])return t.insRightOf(r);var a=i[Y];r.eachChild(function(o){var s=n(o);if(e<s[Y])return e-a<s[Y]-e?o[Y]?t.insAtRightEnd(o[Y]):t.insLeftOf(r):t.insAtLeftEnd(o),!1;if(e>s[X])o[X]?a=s[X]:i[X]-e<e-s[X]?t.insRightOf(r):t.insAtRightEnd(o);else return 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=this,t=e.blocks,n=` mathquill-command-id=`+e.id,r=e.htmlTemplate.match(/<[^<>]+>|[^<>]+/g);SU(`no unmatched angle brackets`,r.join(``)===this.htmlTemplate);for(var i=0,a=r[0];a;i+=1,a=r[i])if(a.slice(-2)===`/>`)r[i]=a.slice(0,-2)+n+`/>`;else if(a.charAt(0)===`<`){SU(`not an unmatched top-level close tag`,a.charAt(1)!==`/`),r[i]=a.slice(0,-1)+n+`>`;var o=1;do i+=1,a=r[i],SU(`no missing close tags`,a),a.slice(0,2)===`</`?--o:a.charAt(0)===`<`&&a.slice(-2)!==`/>`&&(o+=1);while(o>0)}return r.join(``).replace(/>&(\d+)/g,function(e,n){return` mathquill-block-id=`+t[n].id+`>`+t[n].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]||``)})}}),ZU=J(XU,function(e,t){e.init=function(e,n,r){r||=e&&e.length>1?e.slice(1):e,t.init.call(this,e,n,[r])},e.parser=function(){return GU.succeed(this)},e.numBlocks=function(){return 0},e.replaces=function(e){e.remove()},e.createBlocks=_U,e.moveTowards=function(e,t){t.jQ.insDirOf(e,this.jQ),t[-e]=this,t[e]=this[e]},e.deleteTowards=function(e,t){t[e]=this.remove()[e]},e.seek=function(e,t){e-this.jQ.offset().left<this.jQ.outerWidth()/2?t.insLeftOf(this):t.insRightOf(this)},e.latex=function(){return this.ctrlSeq},e.text=function(){return this.textTemplate},e.placeCursor=_U,e.isEmpty=function(){return!0}}),Q=J(ZU,function(e,t){e.init=function(e,n){t.init.call(this,e,`<span>`+(n||e)+`</span>`)}}),$=J(ZU,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<span class="mq-binary-operator">`+n+`</span>`,r)}}),QU=J(YU,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[Y]===this.ends[X]&&this.ends[Y]!==0?this.ends[Y].text():this.join(`text`)},e.keystroke=function(e,n,r){if(r.options.spaceBehavesLikeTab&&(e===`Spacebar`||e===`Shift-Spacebar`)){n.preventDefault(),r.escapeDir(e===`Shift-Spacebar`?Y:X,e,n);return}return t.keystroke.apply(this,arguments)},e.moveOutOf=function(e,t,n){!(n&&this.parent[n+`Into`])&&this[e]?t.insAtDirEnd(-e,this[e]):t.insDirOf(e,this.parent)},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[X];if(!n||n.jQ.offset().left+n.jQ.outerWidth()<e)return t.insAtRightEnd(this);if(e<this.ends[Y].jQ.offset().left)return t.insAtLeftEnd(this);for(;e<n.jQ.offset().left;)n=n[Y];return n.seek(e,t)},e.chToCmd=function(e,t){var n;return e.match(/^[a-eg-zA-Z]$/)?sW(e):/^\d$/.test(e)?aW(e):t&&t.typingSlashWritesDivisionSymbol&&e===`/`?Z[`÷`](e):t&&t.typingAsteriskWritesTimesSymbol&&e===`*`?Z[`×`](e):(n=OU[e]||Z[e])?n(e):Q(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}});PU.p.mouseEvents=!0,NU.StaticMath=function(e){return J(e.AbstractMathQuill,function(t,n){this.RootBlock=QU,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}})};var $U=J(QU,WU);NU.MathField=function(e){return J(e.EditableField,function(e,t){this.RootBlock=$U,e.__mathquillify=function(e,n){return this.config(e),n>1&&(this.__controller.root.reflow=_U),t.__mathquillify.call(this,`mq-editable-field mq-math-mode`),delete this.__controller.root.reflow,this}})};var eW=J(TU,function(e,t){e.ctrlSeq=`\\text`,e.replaces=function(e){e instanceof DU?this.replacedText=e.remove().jQ.text():typeof e==`string`&&(this.replacedText=e)},e.jQadd=function(e){t.jQadd.call(this,e),this.ends[Y]&&this.ends[Y].jQadd(this.jQ[0].firstChild)},e.createLeftOf=function(e){var n=this;if(t.createLeftOf.call(this,e),n[X].siblingCreated&&n[X].siblingCreated(e.options,Y),n[Y].siblingCreated&&n[Y].siblingCreated(e.options,X),n.bubble(`reflow`),e.insAtRightEnd(n),n.replacedText)for(var r=0;r<n.replacedText.length;r+=1)n.write(e,n.replacedText.charAt(r))},e.parser=function(){var e=this,t=GU.string,n=GU.regex;return GU.optWhitespace.then(t(`{`)).then(n(/^[^}]*/)).skip(t(`}`)).map(function(t){return t.length===0?DU():(tW(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=XU.prototype.selectTowards,e.deleteTowards=XU.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){if(e.show().deleteSelection(),n!==`$`)e[Y]?(e[Y].appendText(n),this.bubble(`reflow`)):tW(n).createLeftOf(e);else if(this.isEmpty())e.insRightOf(this),Q(`\\$`,`$`).createLeftOf(e);else if(!e[X])e.insRightOf(this);else if(!e[Y])e.insLeftOf(this);else{var r=eW(),i=this.ends[Y];i.disown().jQ.detach(),i.adopt(r,0,0),e.insLeftOf(this),t.createLeftOf.call(r,e)}},e.seek=function(e,t){t.hide();var 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));for(var o=e-t.show().offset().left,s=o&&o<0?Y:X,c=s;t[s]&&o*c>0;)t[s].moveTowards(s,t),c=o,o=e-t.offset().left;if(s*o<-s*c&&t[-s].moveTowards(-s,t),!t.anticursor)this.anticursorPosition=t[Y]&&t[Y].text.length;else if(t.anticursor.parent===this){var l=t[Y]&&t[Y].text.length;if(this.anticursorPosition===l)t.anticursor=wU.copy(t);else{if(this.anticursorPosition<l){var u=t[Y].splitRight(this.anticursorPosition);t[Y]=u}else var u=t[X].splitRight(this.anticursorPosition-l);t.anticursor=wU(this,u[Y],u)}}},e.blur=function(e){QU.prototype.blur.call(this),e&&(this.textContents()===``?(this.remove(),e[Y]===this?e[Y]=this[Y]:e[X]===this&&(e[X]=this[X])):n(this))};function n(e){e.jQ[0].normalize();var t=e.jQ.contents().filter(function(e,t){return t.nodeType===3})[0];t||={data:``},SU(`only node in TextBlock span is Text node`,t.nodeType===3);var n=tW(t.data);return n.jQadd(t),e.children().disown(),n.adopt(e,0,0)}e.focus=QU.prototype.focus}),tW=J(TU,function(e,t){e.init=function(e){t.init.call(this),this.text=e},e.jQadd=function(e){this.dom=e,this.jQ=uU(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){CU(t),t===X?this.appendText(e):this.prependText(e)},e.splitRight=function(e){var t=tW(this.text.slice(e)).adopt(this.parent,this,this[X]);return t.jQadd(this.dom.splitText(e)),this.text=this.text.slice(0,e),t};function n(e,t){return t.charAt(e===Y?0:-1+t.length)}e.moveTowards=function(e,t){CU(e);var r=n(-e,this.text),i=this[-e];return i?i.insTextAtDirEnd(r,e):tW(r).createDir(-e,t),this.deleteTowards(e,t)},e.latex=function(){return this.text},e.deleteTowards=function(e,t){this.text.length>1?e===X?(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){CU(e);var r=t.anticursor,i=n(-e,this.text);if(r[e]===this){var a=tW(i).createDir(e,t);r[e]=a,t.insDirOf(e,a)}else{var o=this[-e];if(o)o.insTextAtDirEnd(i,e);else{var a=tW(i).createDir(-e,t);a.jQ.insDirOf(-e,t.selection.jQ)}this.text.length===1&&r[-e]===this&&(r[-e]=this[-e])}return this.deleteTowards(e,t)}});Z.text=Z.textnormal=Z.textrm=Z.textup=Z.textmd=eW;function nW(e,t,n){return J(eW,{ctrlSeq:e,htmlTemplate:`<`+t+` `+n+`>&0</`+t+`>`})}Z.em=Z.italic=Z.italics=Z.emph=Z.textit=Z.textsl=nW(`\\textit`,`i`,`class="mq-text-mode"`),Z.strong=Z.bold=Z.textbf=nW(`\\textbf`,`b`,`class="mq-text-mode"`),Z.sf=Z.textsf=nW(`\\textsf`,`span`,`class="mq-sans-serif mq-text-mode"`),Z.tt=Z.texttt=nW(`\\texttt`,`span`,`class="mq-monospace mq-text-mode"`),Z.textsc=nW(`\\textsc`,`span`,`style="font-variant:small-caps" class="mq-text-mode"`),Z.uppercase=nW(`\\uppercase`,`span`,`style="text-transform:uppercase" class="mq-text-mode"`),Z.lowercase=nW(`\\lowercase`,`span`,`style="text-transform:lowercase" class="mq-text-mode"`);var rW=J(XU,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[Y].cursor=this.cursor,this.ends[Y].write=function(e,t){t===`$`?this.isEmpty()?(e.insRightOf(this.parent),this.parent.deleteTowards(dir,e),Q(`\\$`,`$`).createLeftOf(e.show())):e[X]?e[Y]?QU.prototype.write.call(this,e,t):e.insLeftOf(this.parent):e.insRightOf(this.parent):QU.prototype.write.call(this,e,t)}},e.latex=function(){return`$`+this.ends[Y].latex()+`$`}}),iW=J($U,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===`$`)rW(e).createLeftOf(e);else{var n;t===`<`?n=`&lt;`:t===`>`&&(n=`&gt;`),Q(t,n).createLeftOf(e)}}});NU.TextField=function(e){return J(e.EditableField,function(e,t){this.RootBlock=iW,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()}})},OU[`\\`]=J(XU,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[Y].focus=function(){return this.parent.jQ.addClass(`mq-hasCursor`),this.isEmpty()&&this.parent.jQ.removeClass(`mq-empty`),this},this.ends[Y].blur=function(){return this.parent.jQ.removeClass(`mq-hasCursor`),this.isEmpty()&&this.parent.jQ.addClass(`mq-empty`),this},this.ends[Y].write=function(e,t){e.show().deleteSelection(),t.match(/[a-z]/i)?Q(t).createLeftOf(e):(this.parent.renderCommand(e),(t!==`\\`||!this.isEmpty())&&e.parent.write(e,t))},this.ends[Y].keystroke=function(e,n,r){if(e===`Tab`||e===`Enter`||e===`Spacebar`){this.parent.renderCommand(r.cursor),n.preventDefault();return}return 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 uU(e.target=n).trigger(e),!1}).insertBefore(this.jQ).add(this.jQ)}},e.latex=function(){return`\\`+this.ends[Y].latex()+` `},e.renderCommand=function(e){this.jQ=this.jQ.last(),this.remove(),this[X]?e.insLeftOf(this[X]):e.insAtRightEnd(this.parent);var t=this.ends[Y].latex();t||=` `;var n=Z[t];n?(n=n(t),this._replacedFragment&&n.replaces(this._replacedFragment),n.createLeftOf(e)):(n=eW(),n.replaces(t),n.createLeftOf(e),e.insRightOf(n),this._replacedFragment&&this._replacedFragment.remove())}}),Z[`∉`]=Z.notin=q($,`\\notin `,`&#8713;`),Z[`≅`]=Z.cong=q($,`\\cong `,`&#8773;`),Z[`≡`]=Z.equiv=q($,`\\equiv `,`&#8801;`),Z[`⊕`]=Z.oplus=q($,`\\oplus `,`&#8853;`),Z[`⊗`]=Z.otimes=q($,`\\otimes `,`&#8855;`),Z[`≠`]=Z.ne=Z.neq=q($,`\\ne `,`&ne;`),Z[`≇`]=Z.ncong=q($,`\\ncong `,`&ncong;`),Z[`∗`]=Z.ast=Z.star=Z.loast=Z.lowast=q($,`\\ast `,`&lowast;`),Z.therefor=Z.therefore=q($,`\\therefore `,`&there4;`),Z.cuz=Z.because=q($,`\\because `,`&#8757;`),Z.prop=Z.propto=q($,`\\propto `,`&prop;`),Z[`≈`]=Z.asymp=Z.approx=q($,`\\approx `,`&asymp;`),Z[`≉`]=Z.nasymp=Z.napprox=q($,`\\napprox `,`&nap;`),Z.isin=Z.in=q($,`\\in `,`&isin;`),Z.ni=Z.contains=q($,`\\ni `,`&ni;`),Z.notni=Z.niton=Z.notcontains=Z.doesnotcontain=kU[`\\not\\ni`]=q($,`\\not\\ni `,`&#8716;`),Z.sub=Z.subset=q($,`\\subset `,`&sub;`),Z.sup=Z.supset=Z.superset=q($,`\\supset `,`&sup;`),Z.nsub=Z.notsub=Z.nsubset=Z.notsubset=kU[`\\not\\subset`]=q($,`\\not\\subset `,`&#8836;`),Z.nsup=Z.notsup=Z.nsupset=Z.notsupset=Z.nsuperset=Z.notsuperset=kU[`\\not\\supset`]=q($,`\\not\\supset `,`&#8837;`),Z.sube=Z.subeq=Z.subsete=Z.subseteq=q($,`\\subseteq `,`&sube;`),Z.supe=Z.supeq=Z.supsete=Z.supseteq=Z.supersete=Z.superseteq=q($,`\\supseteq `,`&supe;`),Z.nsube=Z.nsubeq=Z.notsube=Z.notsubeq=Z.nsubsete=Z.nsubseteq=Z.notsubsete=Z.notsubseteq=kU[`\\not\\subseteq`]=q($,`\\not\\subseteq `,`&#8840;`),Z.nsupe=Z.nsupeq=Z.notsupe=Z.notsupeq=Z.nsupsete=Z.nsupseteq=Z.notsupsete=Z.notsupseteq=Z.nsupersete=Z.nsuperseteq=Z.notsupersete=Z.notsuperseteq=kU[`\\not\\supseteq`]=q($,`\\not\\supseteq `,`&#8841;`),Z.N=Z.naturals=Z.Naturals=q(Q,`\\mathbb{N}`,`&#8469;`),Z.P=Z.primes=Z.Primes=Z.projective=Z.Projective=Z.probability=Z.Probability=q(Q,`\\mathbb{P}`,`&#8473;`),Z.Z=Z.integers=Z.Integers=q(Q,`\\mathbb{Z}`,`&#8484;`),Z.Q=Z.rationals=Z.Rationals=q(Q,`\\mathbb{Q}`,`&#8474;`),Z.R=Z.reals=Z.Reals=q(Q,`\\mathbb{R}`,`&#8477;`),Z.C=Z.complex=Z.Complex=Z.complexes=Z.Complexes=Z.complexplane=Z.Complexplane=Z.ComplexPlane=q(Q,`\\mathbb{C}`,`&#8450;`),Z.H=Z.Hamiltonian=Z.quaternions=Z.Quaternions=q(Q,`\\mathbb{H}`,`&#8461;`),Z.quad=Z.emsp=q(Q,`\\quad `,` `),Z.qquad=q(Q,`\\qquad `,` `),Z.diamond=q(Q,`\\diamond `,`&#9671;`),Z.bigtriangleup=q(Q,`\\bigtriangleup `,`&#9651;`),Z.ominus=q(Q,`\\ominus `,`&#8854;`),Z.uplus=q(Q,`\\uplus `,`&#8846;`),Z.bigtriangledown=q(Q,`\\bigtriangledown `,`&#9661;`),Z.sqcap=q(Q,`\\sqcap `,`&#8851;`),Z.triangleleft=q(Q,`\\triangleleft `,`&#8882;`),Z.sqcup=q(Q,`\\sqcup `,`&#8852;`),Z.triangleright=q(Q,`\\triangleright `,`&#8883;`),Z.odot=Z.circledot=q(Q,`\\odot `,`&#8857;`),Z.bigcirc=q(Q,`\\bigcirc `,`&#9711;`),Z.dagger=q(Q,`\\dagger `,`&#0134;`),Z.ddagger=q(Q,`\\ddagger `,`&#135;`),Z.wr=q(Q,`\\wr `,`&#8768;`),Z.amalg=q(Q,`\\amalg `,`&#8720;`),Z.models=q(Q,`\\models `,`&#8872;`),Z.prec=q(Q,`\\prec `,`&#8826;`),Z.succ=q(Q,`\\succ `,`&#8827;`),Z.preceq=q(Q,`\\preceq `,`&#8828;`),Z.succeq=q(Q,`\\succeq `,`&#8829;`),Z.simeq=q(Q,`\\simeq `,`&#8771;`),Z.mid=q(Q,`\\mid `,`&#8739;`),Z.ll=q(Q,`\\ll `,`&#8810;`),Z.gg=q(Q,`\\gg `,`&#8811;`),Z.parallel=q(Q,`\\parallel `,`&#8741;`),Z.nparallel=q(Q,`\\nparallel `,`&#8742;`),Z.bowtie=q(Q,`\\bowtie `,`&#8904;`),Z.sqsubset=q(Q,`\\sqsubset `,`&#8847;`),Z.sqsupset=q(Q,`\\sqsupset `,`&#8848;`),Z.smile=q(Q,`\\smile `,`&#8995;`),Z.sqsubseteq=q(Q,`\\sqsubseteq `,`&#8849;`),Z.sqsupseteq=q(Q,`\\sqsupseteq `,`&#8850;`),Z.doteq=q(Q,`\\doteq `,`&#8784;`),Z.frown=q(Q,`\\frown `,`&#8994;`),Z.vdash=q(Q,`\\vdash `,`&#8870;`),Z.dashv=q(Q,`\\dashv `,`&#8867;`),Z.nless=q(Q,`\\nless `,`&#8814;`),Z.ngtr=q(Q,`\\ngtr `,`&#8815;`),Z.longleftarrow=q(Q,`\\longleftarrow `,`&#8592;`),Z.longrightarrow=q(Q,`\\longrightarrow `,`&#8594;`),Z.Longleftarrow=q(Q,`\\Longleftarrow `,`&#8656;`),Z.Longrightarrow=q(Q,`\\Longrightarrow `,`&#8658;`),Z.longleftrightarrow=q(Q,`\\longleftrightarrow `,`&#8596;`),Z.updownarrow=q(Q,`\\updownarrow `,`&#8597;`),Z.Longleftrightarrow=q(Q,`\\Longleftrightarrow `,`&#8660;`),Z.Updownarrow=q(Q,`\\Updownarrow `,`&#8661;`),Z.mapsto=q(Q,`\\mapsto `,`&#8614;`),Z.nearrow=q(Q,`\\nearrow `,`&#8599;`),Z.hookleftarrow=q(Q,`\\hookleftarrow `,`&#8617;`),Z.hookrightarrow=q(Q,`\\hookrightarrow `,`&#8618;`),Z.searrow=q(Q,`\\searrow `,`&#8600;`),Z.leftharpoonup=q(Q,`\\leftharpoonup `,`&#8636;`),Z.rightharpoonup=q(Q,`\\rightharpoonup `,`&#8640;`),Z.swarrow=q(Q,`\\swarrow `,`&#8601;`),Z.leftharpoondown=q(Q,`\\leftharpoondown `,`&#8637;`),Z.rightharpoondown=q(Q,`\\rightharpoondown `,`&#8641;`),Z.nwarrow=q(Q,`\\nwarrow `,`&#8598;`),Z.ldots=q(Q,`\\ldots `,`&#8230;`),Z.cdots=q(Q,`\\cdots `,`&#8943;`),Z.vdots=q(Q,`\\vdots `,`&#8942;`),Z.ddots=q(Q,`\\ddots `,`&#8945;`),Z.surd=q(Q,`\\surd `,`&#8730;`),Z.triangle=q(Q,`\\triangle `,`&#9651;`),Z.ell=q(Q,`\\ell `,`&#8467;`),Z.top=q(Q,`\\top `,`&#8868;`),Z.flat=q(Q,`\\flat `,`&#9837;`),Z.natural=q(Q,`\\natural `,`&#9838;`),Z.sharp=q(Q,`\\sharp `,`&#9839;`),Z.wp=q(Q,`\\wp `,`&#8472;`),Z.bot=q(Q,`\\bot `,`&#8869;`),Z.clubsuit=q(Q,`\\clubsuit `,`&#9827;`),Z.diamondsuit=q(Q,`\\diamondsuit `,`&#9826;`),Z.heartsuit=q(Q,`\\heartsuit `,`&#9825;`),Z.spadesuit=q(Q,`\\spadesuit `,`&#9824;`),Z.circledot=q(Q,`\\circledot `,`&#8857;`),Z.middot=q(Q,`\\middot `,`&middot;`),Z.dottedsquare=q(Q,`\\dottedsquare `,`&#11034;`),Z.square=q(Q,`\\square `,`&#11036;`),Z.rectangle=q(Q,`\\rectangle `,`&#9647;`),Z.oint=q(Q,`\\oint `,`&#8750;`),Z.bigcap=q(Q,`\\bigcap `,`&#8745;`),Z.bigcup=q(Q,`\\bigcup `,`&#8746;`),Z.bigsqcup=q(Q,`\\bigsqcup `,`&#8852;`),Z.bigvee=q(Q,`\\bigvee `,`&#8744;`),Z.bigwedge=q(Q,`\\bigwedge `,`&#8743;`),Z.bigodot=q(Q,`\\bigodot `,`&#8857;`),Z.bigotimes=q(Q,`\\bigotimes `,`&#8855;`),Z.bigoplus=q(Q,`\\bigoplus `,`&#8853;`),Z.biguplus=q(Q,`\\biguplus `,`&#8846;`),Z.lfloor=q(Q,`\\lfloor `,`&#8970;`),Z.rfloor=q(Q,`\\rfloor `,`&#8971;`),Z.lceil=q(Q,`\\lceil `,`&#8968;`),Z.rceil=q(Q,`\\rceil `,`&#8969;`),Z.opencurlybrace=Z.lbrace=q(Q,`\\lbrace `,`{`),Z.closecurlybrace=Z.rbrace=q(Q,`\\rbrace `,`}`),Z.lbrack=q(Q,`[`),Z.rbrack=q(Q,`]`),Z.mug=q(Q,`\\mug `,`µg`),Z.mus=q(Q,`\\mus `,`µs`),Z.mum=q(Q,`\\mum `,`µm`),Z.muL=q(Q,`\\muL `,`µL`),Z.slash=q(Q,`/`),Z.vert=q(Q,`|`),Z.perp=Z.perpendicular=q(Q,`\\perp `,`&perp;`),Z.nabla=Z.del=q(Q,`\\nabla `,`&nabla;`),Z.hbar=q(Q,`\\hbar `,`&#8463;`),Z.AA=Z.Angstrom=Z.angstrom=q(Q,`\\text\\AA `,`&#8491;`),Z.ring=Z.circ=Z.circle=q(Q,`\\circ `,`&#8728;`),Z.bull=Z.bullet=q(Q,`\\bullet `,`&bull;`),Z.setminus=Z.smallsetminus=q(Q,`\\setminus `,`&#8726;`),Z.not=Z[`¬`]=Z.neg=q(Q,`\\neg `,`&not;`),Z[`…`]=Z.dots=Z.ellip=Z.hellip=Z.ellipsis=Z.hellipsis=q(Q,`\\dots `,`&hellip;`),Z.converges=Z.darr=Z.dnarr=Z.dnarrow=Z.downarrow=q(Q,`\\downarrow `,`&darr;`),Z.dArr=Z.dnArr=Z.dnArrow=Z.Downarrow=q(Q,`\\Downarrow `,`&dArr;`),Z.diverges=Z.uarr=Z.uparrow=q(Q,`\\uparrow `,`&uarr;`),Z.uArr=Z.Uparrow=q(Q,`\\Uparrow `,`&uArr;`),Z.to=q($,`\\to `,`&rarr;`),Z.rarr=Z.rightarrow=q(Q,`\\rightarrow `,`&rarr;`),Z.implies=q($,`\\Rightarrow `,`&rArr;`),Z.rArr=Z.Rightarrow=q(Q,`\\Rightarrow `,`&rArr;`),Z.gets=q($,`\\gets `,`&larr;`),Z.larr=Z.leftarrow=q(Q,`\\leftarrow `,`&larr;`),Z.impliedby=q($,`\\Leftarrow `,`&lArr;`),Z.lArr=Z.Leftarrow=q(Q,`\\Leftarrow `,`&lArr;`),Z.harr=Z.lrarr=Z.leftrightarrow=q(Q,`\\leftrightarrow `,`&harr;`),Z.iff=q($,`\\Leftrightarrow `,`&hArr;`),Z.hArr=Z.lrArr=Z.Leftrightarrow=q(Q,`\\Leftrightarrow `,`&hArr;`),Z.Re=Z.Real=Z.real=q(Q,`\\Re `,`&real;`),Z.Im=Z.imag=Z.image=Z.imagin=Z.imaginary=Z.Imaginary=q(Q,`\\Im `,`&image;`),Z.part=Z.partial=q(Q,`\\partial `,`&part;`),Z.infty=Z.infin=Z.infinity=q(Q,`\\infty `,`&infin;`),Z.pounds=q(Q,`\\pounds `,`&pound;`),Z.alef=Z.alefsym=Z.aleph=Z.alephsym=q(Q,`\\aleph `,`&alefsym;`),Z.xist=Z.xists=Z.exist=Z.exists=q(Q,`\\exists `,`&exist;`),Z.nexists=Z.nexist=q(Q,`\\nexists `,`&#8708;`),Z.and=Z.land=Z.wedge=q($,`\\wedge `,`&and;`),Z.or=Z.lor=Z.vee=q($,`\\vee `,`&or;`),Z.o=Z.O=Z.empty=Z.emptyset=Z.oslash=Z.Oslash=Z.nothing=Z.varnothing=q($,`\\varnothing `,`&empty;`),Z.cup=Z.union=q($,`\\cup `,`&cup;`),Z.cap=Z.intersect=Z.intersection=q($,`\\cap `,`&cap;`),Z.deg=Z.degree=q(Q,`\\degree `,`&deg;`),Z.ang=Z.angle=q(Q,`\\angle `,`&ang;`),Z.measuredangle=q(Q,`\\measuredangle `,`m&ang;`);var aW=J(Q,function(e,t){e.createLeftOf=function(e){e.options.autoSubscriptNumerals&&e.parent!==e.parent.parent.sub&&(e[Y]instanceof oW&&e[Y].isItalic!==!1||e[Y]instanceof FW&&e[Y][Y]instanceof oW&&e[Y][Y].isItalic!==!1)?(Z._().createLeftOf(e),t.createLeftOf.call(this,e),e.insRightOf(e.parent.parent)):t.createLeftOf.call(this,e)}}),oW=J(ZU,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[Y]&&!(this[Y]instanceof oW)&&!(this[Y]instanceof $)&&this[Y].ctrlSeq!==`\\ `&&(e=`*`+e),this[X]&&!(this[X]instanceof $)&&!(this[X]instanceof FW)&&(e+=`*`)),e}});PU.p.autoCommands={_maxLength:0},FU.autoCommands=function(e){if(!/^[a-z]+(?: [a-z]+)*$/i.test(e))throw`"`+e+`" not a space-delimited list of only letters`;for(var t=e.split(` `),n={},r=0,i=0;i<t.length;i+=1){var a=t[i];if(a.length<2)throw`autocommand "`+a+`" not minimum length of 2`;if(Z[a]===dW)throw`"`+a+`" is a built-in operator name`;n[a]=1,r=gU(r,a.length)}return n._maxLength=r,n};var sW=J(oW,function(e,t){e.init=function(e){return t.init.call(this,this.letter=e)},e.createLeftOf=function(e){t.createLeftOf.apply(this,arguments);var n=e.options.autoCommands,r=n._maxLength;if(r>0){for(var i=``,a=this,o=0;a instanceof sW&&a.ctrlSeq===a.letter&&o<r;)i=a.letter+i,a=a[Y],o+=1;for(;i.length;){if(n.hasOwnProperty(i)){for(var o=1,a=this;o<i.length;o+=1,a=a[Y]);return DU(a,this).remove(),e[Y]=a[Y],Z[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!==Y&&this[X]instanceof sW||this.autoUnItalicize(e)},e.autoUnItalicize=function(e){var t=e.autoOperatorNames;if(t._maxLength!==0){for(var r=this.letter,i=this[Y];i instanceof sW;i=i[Y])r=i.letter+r;for(var a=this[X];a instanceof sW;a=a[X])r+=a.letter;DU(i[X]||this.parent.ends[Y],a[Y]||this.parent.ends[X]).each(function(e){e.italicize(!0).jQ.removeClass(`mq-first mq-last mq-followed-by-supsub`),e.ctrlSeq=e.letter});outer:for(var o=0,s=i[X]||this.parent.ends[Y];o<r.length;o+=1,s=s[X])for(var c=hU(t._maxLength,r.length-o);c>0;--c){var l=r.slice(o,o+c);if(t.hasOwnProperty(l)){for(var u=0,d=s;u<c;u+=1,d=d[X]){d.italicize(!1);var f=d}var p=cW.hasOwnProperty(l);if(s.ctrlSeq=(p?`\\`:`\\operatorname{`)+s.ctrlSeq,f.ctrlSeq+=p?` `:`}`,uW.hasOwnProperty(l)&&f[Y][Y][Y].jQ.addClass(`mq-last`),n(s[Y])||s.jQ.addClass(`mq-first`),!n(f[X]))if(f[X]instanceof FW){var m=f[X];(m.siblingCreated=m.siblingDeleted=function(){m.jQ.toggleClass(`mq-after-operator-name`,!(m[X]instanceof WW))})()}else f.jQ.toggleClass(`mq-last`,!(f[X]instanceof WW));o+=c-1,s=f;continue outer}}}};function n(e){return!e||e instanceof $||e instanceof RW}}),cW={},lW=PU.p.autoOperatorNames={_maxLength:9},uW={limsup:1,liminf:1,projlim:1,injlim:1};(function(){for(var e=`arg deg det dim exp gcd hom inf ker lg ln log max min sup limsup liminf injlim projlim Pr`.split(` `),t=0;t<e.length;t+=1)cW[e[t]]=lW[e[t]]=1;for(var n=`sin cos tan arcsin arccos arctan sinh cosh tanh sec csc cot coth`.split(` `),t=0;t<n.length;t+=1)cW[n[t]]=1;for(var r=`sin cos tan sec cosec csc cotan cot ctg`.split(` `),t=0;t<r.length;t+=1)lW[r[t]]=lW[`arc`+r[t]]=lW[r[t]+`h`]=lW[`ar`+r[t]+`h`]=lW[`arc`+r[t]+`h`]=1;for(var i=`gcf hcf lcm proj span`.split(` `),t=0;t<i.length;t+=1)lW[i[t]]=1})(),FU.autoOperatorNames=function(e){if(!/^[a-z]+(?: [a-z]+)*$/i.test(e))throw`"`+e+`" not a space-delimited list of only letters`;for(var t=e.split(` `),n={},r=0,i=0;i<t.length;i+=1){var a=t[i];if(a.length<2)throw`"`+a+`" not minimum length of 2`;n[a]=1,r=gU(r,a.length)}return n._maxLength=r,n};var dW=J(ZU,function(e,t){e.init=function(e){this.ctrlSeq=e},e.createLeftOf=function(e){for(var t=this.ctrlSeq,n=0;n<t.length;n+=1)sW(t.charAt(n)).createLeftOf(e)},e.parser=function(){for(var e=this.ctrlSeq,t=QU(),n=0;n<e.length;n+=1)sW(e.charAt(n)).adopt(t,t.ends[X],0);return GU.succeed(t.children())}});for(var fW in lW)lW.hasOwnProperty(fW)&&(Z[fW]=dW);Z.operatorname=J(XU,function(e){e.createLeftOf=_U,e.numBlocks=function(){return 1},e.parser=function(){return JU.block.map(function(e){return e.children()})}}),Z.f=J(sW,function(e,t){e.init=function(){ZU.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)}}),Z[` `]=Z.space=q(Q,`\\ `,`&nbsp;`),Z[`'`]=Z.prime=q(Q,`'`,`&prime;`),Z[`″`]=Z.dprime=q(Q,`″`,`&Prime;`),Z[`"`]=Z.doublePrime=q(Q,`"`,`&Prime;`),Z.backslash=q(Q,`\\backslash `,`\\`),OU[`\\`]||=Z.backslash,Z.$=q(Q,`\\$`,`$`);var pW=J(ZU,function(e,t){e.init=function(e,n){t.init.call(this,e,`<span class="mq-nonSymbola">`+(n||e)+`</span>`)}});Z[`@`]=pW,Z[`&`]=q(pW,`\\&`,`&amp;`),Z[`%`]=q(pW,`\\%`,`%`),Z.alpha=Z.beta=Z.gamma=Z.delta=Z.zeta=Z.eta=Z.theta=Z.iota=Z.kappa=Z.mu=Z.nu=Z.xi=Z.rho=Z.sigma=Z.tau=Z.chi=Z.psi=Z.omega=J(oW,function(e,t){e.init=function(e){t.init.call(this,`\\`+e+` `,`&`+e+`;`)}}),Z.phi=q(oW,`\\phi `,`&#981;`),Z.phiv=Z.varphi=q(oW,`\\varphi `,`&phi;`),Z.epsilon=q(oW,`\\epsilon `,`&#1013;`),Z.epsiv=Z.varepsilon=q(oW,`\\varepsilon `,`&epsilon;`),Z.piv=Z.varpi=q(oW,`\\varpi `,`&piv;`),Z.sigmaf=Z.sigmav=Z.varsigma=q(oW,`\\varsigma `,`&sigmaf;`),Z.thetav=Z.vartheta=Z.thetasym=q(oW,`\\vartheta `,`&thetasym;`),Z.upsilon=Z.upsi=q(oW,`\\upsilon `,`&upsilon;`),Z.gammad=Z.Gammad=Z.digamma=q(oW,`\\digamma `,`&#989;`),Z.kappav=Z.varkappa=q(oW,`\\varkappa `,`&#1008;`),Z.rhov=Z.varrho=q(oW,`\\varrho `,`&#1009;`),Z.pi=Z.π=q(pW,`\\pi `,`&pi;`),Z.lambda=q(pW,`\\lambda `,`&lambda;`),Z.Upsilon=Z.Upsi=Z.upsih=Z.Upsih=q(ZU,`\\Upsilon `,`<var style="font-family: serif">&upsih;</var>`),Z.Gamma=Z.Delta=Z.Theta=Z.Lambda=Z.Xi=Z.Pi=Z.Sigma=Z.Phi=Z.Psi=Z.Omega=J(Q,function(e,t){e.init=function(e){t.init.call(this,`\\`+e+` `,`&`+e+`;`)}}),Z.forall=Z[`∀`]=q(Q,`\\forall `,`&#8704;`);var mW=J(XU,function(e){e.init=function(e){this.latex=e},e.createLeftOf=function(e){var t=JU.parse(this.latex);t.children().adopt(e.parent,e[Y],e[X]),e[Y]=t.ends[X],t.jQize().insertBefore(e.jQ),t.finalizeInsert(e.options,e),t.ends[X][X].siblingCreated&&t.ends[X][X].siblingCreated(e.options,Y),t.ends[Y][Y].siblingCreated&&t.ends[Y][Y].siblingCreated(e.options,X),e.parent.bubble(`reflow`)},e.parser=function(){var e=JU.parse(this.latex).children();return GU.succeed(e)}});Z[`¹`]=q(mW,`^1`),Z[`²`]=q(mW,`^2`),Z[`³`]=q(mW,`^3`),Z[`¼`]=q(mW,`\\frac14`),Z[`½`]=q(mW,`\\frac12`),Z[`¾`]=q(mW,`\\frac34`);var hW=J($,function(e){e.init=Q.prototype.init,e.contactWeld=e.siblingCreated=e.siblingDeleted=function(e,t){function n(e){if(e[Y]){if(e[Y]instanceof $||/^[,;:\(\[]$/.test(e[Y].ctrlSeq))return``}else if(e.parent&&e.parent.parent&&e.parent.parent.isStyleBlock())return n(e.parent.parent);else return``;return`mq-binary-operator`}if(t!==X)return this.jQ[0].className=n(this),this}});Z[`+`]=q(hW,`+`,`+`),Z[`–`]=Z[`-`]=q(hW,`-`,`&minus;`),Z[`±`]=Z.pm=Z.plusmn=Z.plusminus=q(hW,`\\pm `,`&plusmn;`),Z.mp=Z.mnplus=Z.minusplus=q(hW,`\\mp `,`&#8723;`),OU[`*`]=Z.sdot=Z.cdot=q($,`\\cdot `,`&middot;`,`*`);var gW=J($,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===Y&&!this.strict){this.swap(!0),this.bubble(`reflow`);return}t.deleteTowards.apply(this,arguments)}}),_W={ctrlSeq:`\\le `,html:`&le;`,text:`≤`,ctrlSeqStrict:`<`,htmlStrict:`&lt;`,textStrict:`<`},vW={ctrlSeq:`\\ge `,html:`&ge;`,text:`≥`,ctrlSeqStrict:`>`,htmlStrict:`&gt;`,textStrict:`>`};Z[`<`]=Z.lt=q(gW,_W,!0),Z[`>`]=Z.gt=q(gW,vW,!0),Z[`≤`]=Z.le=Z.leq=q(gW,_W,!1),Z[`≥`]=Z.ge=Z.geq=q(gW,vW,!1);var yW=J($,function(e,t){e.init=function(){t.init.call(this,`=`,`=`)},e.createLeftOf=function(e){if(e[Y]instanceof gW&&e[Y].strict){e[Y].swap(!1),e[Y].bubble(`reflow`);return}t.createLeftOf.apply(this,arguments)}});Z[`=`]=yW,Z[`×`]=Z.times=q($,`\\times `,`&times;`,`[x]`),Z[`÷`]=Z.div=Z.divide=Z.divides=q($,`\\div `,`&divide;`,`[/]`),OU[`~`]=Z.sim=q($,`\\sim `,`~`,`~`),OU[`≁`]=Z.nsim=q($,`\\nsim `,`≁`,`≁`),Z.complement=Z[`∁`]=q(Q,`\\complement `,`&#8705;`),Z.nexists=Z[`∄`]=q(Q,`\\nexists `,`&#8708;`),Z.sphericalangle=Z[`∢`]=q(Q,`\\sphericalangle `,`&#8738;`),Z.iint=Z[`∬`]=q(Q,`\\iint `,`&#8748;`),Z.iiint=Z[`∭`]=q(Q,`\\iiint `,`&#8749;`),Z.oiint=Z[`∯`]=q(Q,`\\oiint `,`&#8751;`),Z.oiiint=Z[`∰`]=q(Q,`\\oiiint `,`&#8752;`),Z.backsim=Z[`∽`]=q(Q,`\\backsim `,`&#8765;`),Z.backsimeq=Z[`⋍`]=q(Q,`\\backsimeq `,`&#8909;`),Z.eqsim=Z[`≂`]=q(Q,`\\eqsim `,`&#8770;`),Z.ncong=Z[`≇`]=q(Q,`\\ncong `,`&#8775;`),Z.approxeq=Z[`≊`]=q(Q,`\\approxeq `,`&#8778;`),Z.bumpeq=Z[`≏`]=q(Q,`\\bumpeq `,`&#8783;`),Z.Bumpeq=Z[`≎`]=q(Q,`\\Bumpeq `,`&#8782;`),Z.doteqdot=Z[`≑`]=q(Q,`\\doteqdot `,`&#8785;`),Z.fallingdotseq=Z[`≒`]=q(Q,`\\fallingdotseq `,`&#8786;`),Z.risingdotseq=Z[`≓`]=q(Q,`\\risingdotseq `,`&#8787;`),Z.eqcirc=Z[`≖`]=q(Q,`\\eqcirc `,`&#8790;`),Z.circeq=Z[`≗`]=q(Q,`\\circeq `,`&#8791;`),Z.triangleq=Z[`≜`]=q(Q,`\\triangleq `,`&#8796;`),Z.leqq=Z[`≦`]=q(Q,`\\leqq `,`&#8806;`),Z.geqq=Z[`≧`]=q(Q,`\\geqq `,`&#8807;`),Z.lneqq=Z[`≨`]=q(Q,`\\lneqq `,`&#8808;`),Z.gneqq=Z[`≩`]=q(Q,`\\gneqq `,`&#8809;`),Z.between=Z[`≬`]=q(Q,`\\between `,`&#8812;`),Z.nleq=Z[`≰`]=q(Q,`\\nleq `,`&#8816;`),Z.ngeq=Z[`≱`]=q(Q,`\\ngeq `,`&#8817;`),Z.lesssim=Z[`≲`]=q(Q,`\\lesssim `,`&#8818;`),Z.gtrsim=Z[`≳`]=q(Q,`\\gtrsim `,`&#8819;`),Z.lessgtr=Z[`≶`]=q(Q,`\\lessgtr `,`&#8822;`),Z.gtrless=Z[`≷`]=q(Q,`\\gtrless `,`&#8823;`),Z.preccurlyeq=Z[`≼`]=q(Q,`\\preccurlyeq `,`&#8828;`),Z.succcurlyeq=Z[`≽`]=q(Q,`\\succcurlyeq `,`&#8829;`),Z.precsim=Z[`≾`]=q(Q,`\\precsim `,`&#8830;`),Z.succsim=Z[`≿`]=q(Q,`\\succsim `,`&#8831;`),Z.nprec=Z[`⊀`]=q(Q,`\\nprec `,`&#8832;`),Z.nsucc=Z[`⊁`]=q(Q,`\\nsucc `,`&#8833;`),Z.subsetneq=Z[`⊊`]=q(Q,`\\subsetneq `,`&#8842;`),Z.supsetneq=Z[`⊋`]=q(Q,`\\supsetneq `,`&#8843;`),Z.vDash=Z[`⊨`]=q(Q,`\\vDash `,`&#8872;`),Z.Vdash=Z[`⊩`]=q(Q,`\\Vdash `,`&#8873;`),Z.Vvdash=Z[`⊪`]=q(Q,`\\Vvdash `,`&#8874;`),Z.VDash=Z[`⊫`]=q(Q,`\\VDash `,`&#8875;`),Z.nvdash=Z[`⊬`]=q(Q,`\\nvdash `,`&#8876;`),Z.nvDash=Z[`⊭`]=q(Q,`\\nvDash `,`&#8877;`),Z.nVdash=Z[`⊮`]=q(Q,`\\nVdash `,`&#8878;`),Z.nVDash=Z[`⊯`]=q(Q,`\\nVDash `,`&#8879;`),Z.vartriangleleft=Z[`⊲`]=q(Q,`\\vartriangleleft `,`&#8882;`),Z.vartriangleright=Z[`⊳`]=q(Q,`\\vartriangleright `,`&#8883;`),Z.trianglelefteq=Z[`⊴`]=q(Q,`\\trianglelefteq `,`&#8884;`),Z.trianglerighteq=Z[`⊵`]=q(Q,`\\trianglerighteq `,`&#8885;`),Z.multimap=Z[`⊸`]=q(Q,`\\multimap `,`&#8888;`),Z.Subset=Z[`⋐`]=q(Q,`\\Subset `,`&#8912;`),Z.Supset=Z[`⋑`]=q(Q,`\\Supset `,`&#8913;`),Z.Cap=Z[`⋒`]=q(Q,`\\Cap `,`&#8914;`),Z.Cup=Z[`⋓`]=q(Q,`\\Cup `,`&#8915;`),Z.pitchfork=Z[`⋔`]=q(Q,`\\pitchfork `,`&#8916;`),Z.lessdot=Z[`⋖`]=q(Q,`\\lessdot `,`&#8918;`),Z.gtrdot=Z[`⋗`]=q(Q,`\\gtrdot `,`&#8919;`),Z.lll=Z[`⋘`]=q(Q,`\\lll `,`&#8920;`),Z.ggg=Z[`⋙`]=q(Q,`\\ggg `,`&#8921;`),Z.lesseqgtr=Z[`⋚`]=q(Q,`\\lesseqgtr `,`&#8922;`),Z.gtreqless=Z[`⋛`]=q(Q,`\\gtreqless `,`&#8923;`),Z.curlyeqprec=Z[`⋞`]=q(Q,`\\curlyeqprec `,`&#8926;`),Z.curlyeqsucc=Z[`⋟`]=q(Q,`\\curlyeqsucc `,`&#8927;`),Z.nsim=Z[`≁`]=q(Q,`\\nsim `,`&#8769;`),Z.lnsim=Z[`⋦`]=q(Q,`\\lnsim `,`&#8934;`),Z.gnsim=Z[`⋧`]=q(Q,`\\gnsim `,`&#8935;`),Z.precnsim=Z[`⋨`]=q(Q,`\\precnsim `,`&#8936;`),Z.succnsim=Z[`⋩`]=q(Q,`\\succnsim `,`&#8937;`),Z.ntriangleleft=Z[`⋪`]=q(Q,`\\ntriangleleft `,`&#8938;`),Z.ntriangleright=Z[`⋫`]=q(Q,`\\ntriangleright `,`&#8939;`),Z.ntrianglelefteq=Z[`⋬`]=q(Q,`\\ntrianglelefteq `,`&#8940;`),Z.ntrianglerighteq=Z[`⋭`]=q(Q,`\\ntrianglerighteq `,`&#8941;`),Z.blacksquare=Z[`∎`]=q(Q,`\\blacksquare `,`&#8718;`),Z.colon=Z[`∶`]=q(Q,`\\colon `,`&#8758;`),Z.llcorner=Z[`∟`]=q(Q,`\\llcorner `,`&#8735;`),Z.dotplus=Z[`∔`]=q($,`\\dotplus `,`&#8724;`),Z.nmid=Z[`∤`]=q($,`
303
+ mid `,`&#8740;`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`&#8890;`),Z.veebar=Z[`⊻`]=q($,`\\veebar `,`&#8891;`),Z.barwedge=Z[`⊼`]=q($,`\\barwedge `,`&#8892;`),Z.ltimes=Z[`⋉`]=q($,`\\ltimes `,`&#8905;`),Z.rtimes=Z[`⋊`]=q($,`\\rtimes `,`&#8906;`),Z.leftthreetimes=Z[`⋋`]=q($,`\\leftthreetimes `,`&#8907;`),Z.rightthreetimes=Z[`⋌`]=q($,`\\rightthreetimes `,`&#8908;`),Z.curlyvee=Z[`⋎`]=q($,`\\curlyvee `,`&#8910;`),Z.curlywedge=Z[`⋏`]=q($,`\\curlywedge `,`&#8911;`),Z.circledcirc=Z[`⊚`]=q($,`\\circledcirc `,`&#8858;`),Z.circledast=Z[`⊛`]=q($,`\\circledast `,`&#8859;`),Z.circleddash=Z[`⊝`]=q($,`\\circleddash `,`&#8861;`),Z.boxplus=Z[`⊞`]=q($,`\\boxplus `,`&#8862;`),Z.boxminus=Z[`⊟`]=q($,`\\boxminus `,`&#8863;`),Z.boxtimes=Z[`⊠`]=q($,`\\boxtimes `,`&#8864;`),Z.boxdot=Z[`⊡`]=q($,`\\boxdot `,`&#8865;`),Z[`∂`]=Z.partial,Z[`∃`]=Z.exists,Z[`∅`]=Z.varnothing,Z[`∆`]=Z.triangle,Z[`∇`]=Z.nabla,Z[`∈`]=Z.in,Z[`∊`]=Z.in,Z[`∋`]=Z.ni,Z[`∌`]=Z.notni,Z[`∍`]=Z.ni,Z[`∐`]=Z.amalg,Z[`−`]=Z[`-`],Z[`∓`]=Z.mp,Z[`∖`]=Z.setminus,Z[`∘`]=Z.circ,Z[`∙`]=Z.bullet,Z[`∝`]=Z.propto,Z[`∞`]=Z.infty,Z[`∠`]=Z.angle,Z[`∡`]=Z.measuredangle,Z[`∣`]=Z.divides,Z[`∥`]=Z.parallel,Z[`∦`]=Z.nparallel,Z[`∧`]=Z.wedge,Z[`∨`]=Z.vee,Z[`∩`]=Z.cap,Z[`∪`]=Z.cup,Z[`∮`]=Z.oint,Z[`∴`]=Z.therefore,Z[`∵`]=Z.because,Z[`∼`]=Z.sim,Z[`≀`]=Z.wr,Z[`≃`]=Z.simeq,Z[`≍`]=Z.asymp,Z[`≐`]=Z.doteq,Z[`≪`]=Z.ll,Z[`≫`]=Z.gg,Z[`≺`]=Z.prec,Z[`≻`]=Z.succ,Z[`⊂`]=Z.subset,Z[`⊃`]=Z.supset,Z[`⊆`]=Z.subseteq,Z[`⊇`]=Z.supseteq,Z[`⊈`]=Z.nsubseteq,Z[`⊉`]=Z.nsupseteq,Z[`⊏`]=Z.sqsubset,Z[`⊐`]=Z.sqsupset,Z[`⊓`]=Z.sqcap,Z[`⊔`]=Z.sqcup,Z[`⊖`]=Z.ominus,Z[`⊘`]=Z.oslash,Z[`⊙`]=Z.odot,Z[`⊢`]=Z.vdash,Z[`⊣`]=Z.dashv,Z[`⊤`]=Z.top,Z[`⊥`]=Z.bot,Z[`⊧`]=Z.models,Z[`⋀`]=Z.wedge,Z[`⋁`]=Z.vee,Z[`⋂`]=Z.cap,Z[`⋃`]=Z.cup,Z[`⋄`]=Z.diamond,Z[`⋅`]=Z.cdot,Z[`⋆`]=Z.star,Z[`⋈`]=Z.bowtie,Z[`⋮`]=Z.vdots,Z[`⋯`]=Z.cdots,Z[`⋱`]=Z.ddots;var bW,xW=_U,SW=document.createElement(`div`).style,CW={transform:1,WebkitTransform:1,MozTransform:1,OTransform:1,msTransform:1},wW;for(var TW in CW)if(TW in SW){wW=TW;break}wW?bW=function(e,t,n){e.css(wW,`scale(`+t+`,`+n+`)`)}:`filter`in SW?(xW=function(e){e.className=e.className},bW=function(e,t,n){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>`);var r=e.children().css(`filter`,`progid:DXImageTransform.Microsoft.Matrix(M11=`+t+`,SizingMethod='auto expand')`);function i(){e.css(`marginRight`,(r.width()-1)*(t-1)/t+`px`)}i();var a=setInterval(i);uU(window).load(function(){clearTimeout(a),i()})}):bW=function(e,t,n){e.css(`fontSize`,n+`em`)};var EW=J(XU,function(e,t){e.init=function(e,n,r){t.init.call(this,e,`<`+n+` `+r+`>&0</`+n+`>`)}}),DW=J(XU,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 JU.optBlock.then(function(t){return JU.block.map(function(n){var r=OW.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))}}),OW=J(DW,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+`>`,XU.prototype.init.call(this,e),this.textTemplate=[e.replace(`\\`,``)+`[`,`](`,`)`]},e.latex=function(){return this.ctrlSeq+`[`+this.ends[Y].latex()+`]{`+this.ends[X].latex()+`}`},e.finalizeTree=function(){this.downInto=this.ends[Y].upOutOf=this.ends[X],this.upInto=this.ends[X].downOutOf=this.ends[Y]}}),kW=function(e){var t=`<span class="`+e+`-inner-right">g</span><span class="`+e+`-inner-left">h</span>`;return J(XU,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+`>`)}})},AW=J(XU,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>`)}}),jW=J(XU,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>`)}}),MW=J(XU,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>`)}}),NW=J(XU,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>`)}}),PW=function(e,t){return J(ZU,function(n,r){n.init=function(n,i,a){r.init.call(this,n,`<`+i+` `+a+`><`+i+` class="`+e+`-inner">`+t+`</`+i+`></`+i+`>`)}})};Z.mathrm=q(EW,`\\mathrm`,`span`,`class="mq-roman mq-font"`),Z.mathit=q(EW,`\\mathit`,`i`,`class="mq-font"`),Z.mathbf=q(EW,`\\mathbf`,`b`,`class="mq-font"`),Z.mathsf=q(EW,`\\mathsf`,`span`,`class="mq-sans-serif mq-font"`),Z.mathtt=q(EW,`\\mathtt`,`span`,`class="mq-monospace mq-font"`),Z.underline=q(EW,`\\underline`,`span`,`class="mq-non-leaf mq-underline"`),Z.overline=Z.bar=q(kW(`mq-overline`),`\\overline`,`span`,`class="mq-non-leaf mq-overline"`),Z.longdiv=q(AW,`\\longdiv`,`span`,`class="mq-non-leaf mq-longdiv"`),Z.overrightarrow=q(kW(`mq-overarrow`),`\\overrightarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-right"`),Z.overleftarrow=q(kW(`mq-overarrow`),`\\overleftarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-left"`),Z.xleftarrow=q(DW,`\\xleftarrow`,`span`,`class="mq-non-leaf mq-xarrow mq-arrow-left"`),Z.xrightarrow=q(DW,`\\xrightarrow`,`span`,`class="mq-non-leaf mq-xarrow mq-arrow-right"`),Z.overleftrightarrow=q(EW,`\\overleftrightarrow`,`span`,`class="mq-non-leaf mq-overarrow mq-arrow-both"`),Z.overarc=q(EW,`\\overarc`,`span`,`class="mq-non-leaf mq-overarc"`),Z.dot=J(XU,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>`)}}),Z.addmatrixrow=q(jW,`\\addmatrixrow`,`span`,`+`),Z.addmatrixcol=q(NW,`\\addmatrixcol`,`span`,`+`),Z.ngtr=Z[`≯`]=q(PW(`mq-ngtr`,`&#8815;`),`\\ngtr `,`span`,`class="mq-non-leaf mq-ngtr"`),Z.nless=Z[`≮`]=q(PW(`mq-nless`,`&#8814;`),`\\nless `,`span`,`class="mq-non-leaf mq-nless"`),Z.dot=q(MW,`\\dot`),Z.parallelogram=q(PW(`mq-parallelogram`,`&#9649;`),`\\parallelogram `,`span`,`class="mq-non-leaf mq-parallelogram"`),Z.textcolor=J(XU,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=GU.optWhitespace,r=GU.string,i=GU.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}}),Z.class=J(XU,function(e,t){e.parser=function(){var e=this,n=GU.string,r=GU.regex;return GU.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}});var FW=J(XU,function(e,t){e.ctrlSeq=`_{...}^{...}`,e.createLeftOf=function(e){if(!(!this.replacedFragment&&!e[Y]&&e.options.supSubsRequireOperand))return t.createLeftOf.apply(this,arguments)},e.contactWeld=function(e){for(var t=Y;t;t=t===Y&&X)if(this[t]instanceof FW){for(var n=`sub`;n;n=n===`sub`&&`sup`){var r=this[n],i=this[t][n];if(r){if(!i)this[t].addBlock(r.disown());else if(r.isEmpty())var a=wU(i,0,i.ends[Y]);else{r.jQ.children().insAtDirEnd(-t,i.jQ);var o=r.children().disown(),a=wU(i,o.ends[X],i.ends[Y]);t===Y?o.adopt(i,i.ends[X],0):o.adopt(i,0,i.ends[Y])}this.placeCursor=function(e,n){return function(r){r.insAtDirEnd(-t,e||n)}}(i,r)}}this.remove(),e&&e[Y]===this&&(t===X&&a?a[Y]?e.insRightOf(a[Y]):e.insAtLeftEnd(a.parent):e.insRightOf(this[t]));break}},PU.p.charsThatBreakOutOfSupSub=``,e.finalizeTree=function(){this.ends[Y].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 ZU?e.deleteSelection():e.clearSelection().insRightOf(this.parent),n.createLeftOf(e.show())}e[Y]&&!e[X]&&!e.selection&&e.options.charsThatBreakOutOfSupSub.indexOf(t)>-1&&e.insRightOf(this.parent),QU.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 ZU?r.remove():r&&r.deleteTowards(e,n.insAtDirEnd(-e,this.sub)),this.sub.isEmpty()&&(this.sub.deleteOutOf(Y,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.length===1?n:`{`+(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=uU(`<span class="mq-sup"/>`).append(e.jQ.children()).attr(mU,e.id).prependTo(this.jQ)):(this.sub=this.downInto=this.sup.downOutOf=e,e.adopt(this,0,this.sup).upOutOf=this.sup,e.jQ=uU(`<span class="mq-sub"></span>`).append(e.jQ.children()).attr(mU,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`]=IW,delete e[n].deleteOutOf,t===`sub`&&uU(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=this.jQ,t=e.prev();if(t.length){var n=e.children(`.mq-sup`);if(n.length){var r=parseInt(n.css(`font-size`)),i=n.offset().top+n.height()-t.offset().top-.7*r,a=parseInt(n.css(`margin-bottom`));n.css(`margin-bottom`,a+i)}}}});function IW(e){var t=this.parent,n=e;do{if(n[X])return e.insLeftOf(t);n=n.parent.parent}while(n!==t);e.insRightOf(t)}Z.subscript=Z._=J(FW,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[Y],this.sub.upOutOf=IW,t.finalizeTree.call(this)}}),Z.superscript=Z.supscript=Z[`^`]=J(FW,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[X],this.sup.downOutOf=IW,t.finalizeTree.call(this)}});var LW=J(XU,function(e,t){e.parser=function(){for(var e=GU.string,t=GU.optWhitespace,n=GU.succeed,r=JU.block,i=this,a=i.blocks=[QU(),QU()],o=0;o<a.length;o+=1)a[o].adopt(i,i.ends[X],0);return t.then(e(`_`).or(e(`^`))).then(function(e){var t=a[e===`_`?0:1];return r.then(function(e){return e.children().adopt(t,t.ends[X],0),n(i)})}).many().result(i)},e.finalizeTree=function(){this.downInto=this.ends[Y],this.upInto=this.ends[X],this.ends[Y].upOutOf=this.ends[X],this.ends[X].downOutOf=this.ends[Y]}}),RW=J(LW,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>`;ZU.prototype.init.call(this,e,n)},e.latex=function(){function e(e){return e.length===1?e:`{`+(e||` `)+`}`}return this.ctrlSeq+`_`+e(this.ends[Y].latex())+`^`+e(this.ends[X].latex())},e.createLeftOf=function(e){t.createLeftOf.apply(this,arguments),e.options.sumStartsWithNEquals&&(sW(`n`).createLeftOf(e),yW().createLeftOf(e))}});Z[`∑`]=Z.sum=Z.summation=q(RW,`\\sum `,`&sum;`),Z[`∏`]=Z.prod=Z.product=q(RW,`\\prod `,`&prod;`),Z.coprod=Z.coproduct=q(RW,`\\coprod `,`&#8720;`),Z[`∫`]=Z.int=Z.integral=J(RW,function(e,t){e.init=function(){ZU.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=XU.p.createLeftOf}),Z.lim=Z.limit=J(LW,function(e,t){e.init=function(){ZU.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(){function e(e){return e.length===1?e:`{`+(e||` `)+`}`}return this.ctrlSeq+`_`+e(this.ends[Y].latex())}});var zW=Z.over=OU[`/`]=J(Z.frac=Z.dfrac=Z.cfrac=Z.fraction=J(XU,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[X].upOutOf=this.ends[Y],this.downInto=this.ends[Y].downOutOf=this.ends[X]}}),function(e,t){e.createLeftOf=function(e){if(!this.replacedFragment){for(var n=e[Y];n&&!(n instanceof $||n instanceof(Z.text||_U)||n instanceof RW||n.ctrlSeq===`\\ `||/^[,;:]$/.test(n.ctrlSeq));)n=n[Y];n instanceof RW&&n[X]instanceof FW&&(n=n[X],n[X]instanceof FW&&n[X].ctrlSeq!=n.ctrlSeq&&(n=n[X])),n!==e[Y]&&!e.isTooDeep(1)&&(this.replaces(DU(n[X]||e.parent.ends[Y],e[Y])),e[Y]=n)}t.createLeftOf.call(this,e)}});Z.underset=J(XU,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[Y].upOutOf=this.ends[X],this.upInto=this.ends[X].downOutOf=this.ends[Y]}}),Z.overset=J(XU,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[X].upOutOf=this.ends[Y],this.upInto=this.ends[Y].downOutOf=this.ends[X]}});var BW=Z.sqrt=Z[`√`]=J(XU,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 JU.optBlock.then(function(e){return JU.block.map(function(t){var n=VW();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[X].jQ.parent();bW(e.prev(),1,e.innerHeight()/+e.css(`fontSize`).slice(0,-2)-.1)}});Z.hat=J(XU,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(`,`)`]});var VW=Z.nthroot=J(BW,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[Y].latex()+`]{`+this.ends[X].latex()+`}`}}),HW=J(XU,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)}});Z.vec=q(HW,`\\vec`,`&rarr;`,[`vec(`,`)`]),Z.tilde=q(HW,`\\tilde`,`~`,[`tilde(`,`)`]),Z.lrncuberoot=J(BW,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[Y].latex()+`}`}}),Z.abs=J(XU,function(e){e.ctrlSeq=`\\abs`,e.htmlTemplate=`<span class="mq-abs mq-non-leaf"><span class="mq-empty-box">&0</span></span>`,e.textTemplate=[`|`,`|`]}),Z.lrnplaceholder=J(XU,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[Y].latex()}}),Z.lrnexponent=J(XU,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[X].latex();return e.length>1?e=`{`+e+`}`:e.length===0&&(e=`{ }`),this.ends[Y].latex()+`^`+e}}),Z.lrnsquaredexponent=J(XU,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[Y].latex()+`^2`}}),Z.lrnsubscript=J(XU,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[Y].latex()+`_`+this.ends[X].latex()}});function UW(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`));bW(this.delimjQs,hU(1+.2*(e-1),1.2),1.2*e)}}var WW=J(J(XU,UW),function(e,t){e.init=function(e,n,r,i,a){t.init.call(this,`\\left`+i,fU,[n,r]),this.side=e,this.sides={},this.sides[Y]={ch:n,ctrlSeq:i},this.sides[X]={ch:r,ctrlSeq:a}},e.numBlocks=function(){return 1},e.html=function(){return this.htmlTemplate=`<span class="mq-non-leaf"><span class="mq-scaled mq-paren`+(this.side===X?` mq-ghost`:``)+`">`+this.sides[Y].ch+`</span><span class="mq-non-leaf">&0</span><span class="mq-scaled mq-paren`+(this.side===Y?` mq-ghost`:``)+`">`+this.sides[X].ch+`</span></span>`,t.html.call(this)},e.latex=function(){return`\\left`+this.sides[Y].ctrlSeq+this.ends[Y].latex()+`\\right`+this.sides[X].ctrlSeq},e.matchBrack=function(e,t,n){return n instanceof WW&&n.side&&n.side!==-t&&(!e.restrictMismatchedBrackets||GW[this.sides[this.side].ch]===n.sides[n.side].ch||{"(":`]`,"[":`)`}[this.sides[Y].ch]===n.sides[X].ch)&&n},e.closeOpposing=function(e){e.side=0,e.sides[this.side]=this.sides[this.side],e.delimjQs.eq(this.side===Y?0:1).removeClass(`mq-ghost`).html(this.sides[this.side].ch)},e.createLeftOf=function(e){if(!this.replacedFragment){var n=e.options;if(this.sides[Y].ch===`|`)var r=this.matchBrack(n,X,e[X])||this.matchBrack(n,Y,e[Y])||this.matchBrack(n,0,e.parent.parent);else var r=this.matchBrack(n,-this.side,e[-this.side])||this.matchBrack(n,-this.side,e.parent.parent)}if(r){var i=this.side=-r.side;this.closeOpposing(r),r===e.parent.parent&&e[i]&&DU(e[i],e.parent.ends[i],-i).disown().withDirAdopt(-i,r.parent,r,r[i]).jQ.insDirOf(i,r.jQ),r.bubble(`reflow`)}else r=this,i=r.side,r.replacedFragment?r.side=0:e[-i]&&(r.replaces(DU(e[-i],e.parent.ends[-i],i)),e[-i]=0),t.createLeftOf.call(r,e);i===Y?e.insAtLeftEnd(r.ends[Y]):e.insRightOf(r)},e.placeCursor=_U,e.unwrap=function(){this.ends[Y].children().disown().adopt(this.parent,this,this[X]).jQ.insertAfter(this.jQ),this.remove()},e.deleteSide=function(e,t,n){var r=this.parent,i=this[e],a=r.ends[e];if(e===this.side){this.unwrap(),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r);return}var o=n.options,s=!this.side;if(this.side=-e,this.matchBrack(o,e,this.ends[Y].ends[this.side])){this.closeOpposing(this.ends[Y].ends[this.side]);var c=this.ends[Y].ends[e];this.unwrap(),c.siblingCreated&&c.siblingCreated(n.options,e),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r)}else{if(this.matchBrack(o,e,this.parent.parent))this.parent.parent.closeOpposing(this),this.parent.parent.unwrap();else if(t&&s){this.unwrap(),i?n.insDirOf(-e,i):n.insAtDirEnd(e,r);return}else this.sides[e]={ch:GW[this.sides[this.side].ch],ctrlSeq:GW[this.sides[this.side].ctrlSeq]},this.delimjQs.removeClass(`mq-ghost`).eq(e===Y?0:1).addClass(`mq-ghost`).html(this.sides[e].ch);if(i){var c=this.ends[Y].ends[e];DU(i,a,-e).disown().withDirAdopt(-e,this.ends[Y],c,0).jQ.insAtDirEnd(e,this.ends[Y].jQ.removeClass(`mq-empty`)),c.siblingCreated&&c.siblingCreated(n.options,e),n.insDirOf(-e,i)}else t?n.insDirOf(e,this):n.insAtDirEnd(e,this.ends[Y])}},e.deleteTowards=function(e,t){this.deleteSide(-e,!1,t)},e.finalizeTree=function(){this.ends[Y].deleteOutOf=function(e,t){this.parent.deleteSide(e,!0,t)},this.finalizeTree=this.intentionalBlur=function(){this.delimjQs.eq(+(this.side===Y)).removeClass(`mq-ghost`),this.side=0}},e.siblingCreated=function(e,t){t===-this.side&&this.finalizeTree()}}),GW={"(":`)`,")":`(`,"[":`]`,"]":`[`,"{":`}`,"}":`{`,"\\{":`\\}`,"\\}":`\\{`,"&lang;":`&rang;`,"&rang;":`&lang;`,"\\langle ":`\\rangle `,"\\rangle ":`\\langle `,"|":`|`,"\\lVert ":`\\rVert `,"\\rVert ":`\\lVert `};function KW(e,t){var t=t||e,n=GW[e],r=GW[t];OU[e]=q(WW,Y,e,n,t,r),OU[n]=q(WW,X,e,n,t,r)}KW(`(`),KW(`[`),KW(`{`,`\\{`),Z.langle=q(WW,Y,`&lang;`,`&rang;`,`\\langle `,`\\rangle `),Z.rangle=q(WW,X,`&lang;`,`&rang;`,`\\langle `,`\\rangle `),OU[`|`]=q(WW,Y,`|`,`|`,`|`,`|`),Z.lVert=q(WW,Y,`&#8741;`,`&#8741;`,`\\lVert `,`\\rVert `),Z.rVert=q(WW,X,`&#8741;`,`&#8741;`,`\\lVert `,`\\rVert `),Z.left=J(XU,function(e){e.parser=function(){var e=GU.regex,t=GU.string;GU.succeed;var n=GU.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+=` `),JU.then(function(a){return t(`\\right`).skip(n).then(e(/^(?:[\])|]|\\\}|\\rangle(?![a-zA-Z])|\\rVert(?![a-zA-Z]))/)).map(function(e){var t=e.charAt(0)===`\\`?e.slice(1):e;e==`\\rangle`&&(t=`&rang;`,e+=` `),e==`\\rVert`&&(t=`&#8741;`,e+=` `);var n=WW(0,i,t,r,e);return n.blocks=[a],a.adopt(n,0,0),n})})})}}),Z.right=J(XU,function(e){e.parser=function(){return GU.fail(`unmatched \\right`)}}),Z.choose=J(Z.binom=Z.binomial=J(J(XU,UW),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(`,`,`,`)`]}),function(e){e.createLeftOf=zW.prototype.createLeftOf}),Z.editable=Z.MathQuillMathField=J(XU,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=GU.string,r=GU.regex,i=GU.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=MU(this.ends[Y],this.jQ,e);t.KIND_OF_MQ=`MathField`,t.editable=!0,t.createTextarea(),t.editablesTextareaEvents(),t.cursor.insAtRightEnd(t.root),WU(t.root)},e.registerInnerField=function(e,t){e.push(e[this.name]=t(this.ends[Y].controller))},e.latex=function(){return this.ends[Y].latex()},e.text=function(){return this.ends[Y].text()}});var qW=Z.embed=J(ZU,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=GU.string,n=GU.regex,r=GU.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(LU[i](t))})})}});Z.MathQuillResponseContainer=J(XU,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[Y].text()}}),Z.MathQuillResponseContainerIcon=J(XU,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[Y].text()}});var JW=Z.matrix=J(XU,function(e,t){var n=J(QU,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=this,t=e.blocks=[],r,i,a=0;this.htmlTemplate.replace(/&\d+/g,function(o,s){var c=e.htmlTemplate.substring(0,s).match(/<tr[^>]*>/gi).length-1;i=r===c?i+1:0,t[a]=n(i,c),t[a].adopt(e,e.ends[X],0),r=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&&bW(n,hU(1+.2*(t-1),1.2),1.05*t)},e.latex=function(){var e=this.getMatrixName(),t=`\\begin{`+e+`}`,n,i,a;for(a=0;a<this.blocks.length;a++)n=this.blocks[a].row,i!==void 0&&(i===n?t+=r.column:t+=r.row),i=n,t+=this.blocks[a].latex();return t+=`\\end{`+e+`}`,t},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){var n=`<span class="mq-matrix mq-non-leaf">`+o(this.parentheses.left);n+=`<table class="mq-non-leaf">`,e=Math.min(e,this.maximum.rows),t=Math.min(t,this.maximum.columns);for(var r=0,i=0;i<e;i++){n+=`<tr>`;for(var a=0;a<t;a++)n+=`<td>&`+r+`</td>`,r++;n+=`</tr>`}return n+=`</table>`,n+=o(this.parentheses.right)+`</span>`,n;function o(e){return e?`<span class="mq-paren mq-scaled">`+e+`</span>`:``}},e.htmlTemplate=e.generateHtmlTemplate(1,1),e.parser=function(){var e=GU.regex,t=this,i=this.getMatrixName(),a=RegExp(`^(.*?)\\\\end{`+i+`}`),o=RegExp(`\\\\end{`+i+`}`);return e(a).then(function(e){var i=e.replace(o,``),a=[],s=i.split(r.row),c=Math.min(s.length,t.maximum.rows),l=0,u,d;for(d=0;d<c;d++)u=s[d].split(r.column),l=Math.max(l,u.length);for(l=Math.min(l,t.maximum.columns),d=0;d<c;d++){u=s[d].split(r.column);for(var e=0;e<l;e++){var f=n(e,d);JU.parse(u[e]||` `).children().adopt(f,f.ends[X],0),a.push(f)}}t.htmlTemplate=t.generateHtmlTemplate(c,l),t.blocks=a;for(var d=0;d<a.length;d+=1)a[d].adopt(t,t.ends[X],0);return GU.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=TU.byId[e.first().attr(mU)],n=TU.byId[e.last().attr(mU)],r=e.eq(0).closest(`tr`),i=[];e.each(function(t){var n=TU.byId[uU(this).attr(mU)],a=e.eq(t+1),o=uU(this).closest(`tr`).next(`tr`),s=uU(this).closest(`tr`).index(),c=uU(this).index(),l;if(a.length){var u=TU.byId[a.attr(mU)];n[X]=u,u[Y]=n}if(l=o.length?o.find(`td`).eq(c):r.find(`td`).eq(c+1),l.length){var d=TU.byId[l.attr(mU)];n.downOutOf=d,d.upOutOf=n}n.column=c,n.row=s,i.push(n)}),this.ends[Y]=t,this.ends[X]=n,t&&t[Y]&&delete t[Y],n&&n[X]&&delete n[X],this.blocks=i},e.deleteCell=function(e){var t=e.jQ.closest(`tr`),n=e.jQ.index(),r=t.index(),i=t.find(`td`).not(e.jQ),a=this.jQ.find(`tr`).not(t).map(function(){return uU(this).find(`td`)[n]}),o=this.jQ.find(`td`).length===1,s;function c(){return TU.byId[uU(this).attr(mU)].isEmpty()}return i.filter(c).length===i.length&&a.length&&(i.remove(),e.jQ.remove(),t.remove(),this.finalizeTree()),a.filter(c).length===a.length&&i.length&&(a.remove(),e.jQ.remove(),this.finalizeTree()),o||(r=Math.min(r,this.jQ.find(`tr`).length-1),n=Math.min(n,this.jQ.find(`tr`).eq(r).find(`td`).length-1),s=TU.byId[this.jQ.find(`tr`).eq(r).find(`td`).eq(n).attr(mU)]),s},e.addRow=function(e){if(!(this.jQ.find(`tr`).length>=this.maximum.rows)){for(var t=e.find(`td`).length,r=uU(`<tr></tr>`),i,a,o=0;o<t;o++)i=n(),i.parent=this,i.jQ=uU(`<td class="mq-empty">`).attr(mU,i.id),r.append(i.jQ),a||=i;return r.insertAfter(e),a}},e.addColumn=function(e){if(!(e.closest(`tr`).find(`td`).length>=this.maximum.columns)){var t=e.index(),r=e.closest(`tr`).index(),i=this,a,o=[];return this.jQ.find(`tr`).each(function(){a=n(),a.parent=i,a.jQ=uU(`<td class="mq-empty">`).attr(mU,a.id),a.jQ.insertAfter(uU(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`)}}});Z.pmatrix=J(JW,function(e,t){e.ctrlSeq=`\\pmatrix`,e.parentheses={left:`(`,right:`)`}}),Z.bmatrix=J(JW,function(e,t){e.ctrlSeq=`\\bmatrix`,e.parentheses={left:`[`,right:`]`}}),Z.Bmatrix=J(JW,function(e,t){e.ctrlSeq=`\\Bmatrix`,e.parentheses={left:`{`,right:`}`}}),Z.vmatrix=J(JW,function(e,t){e.ctrlSeq=`\\vmatrix`,e.parentheses={left:`|`,right:`|`}}),Z.Vmatrix=J(JW,function(e,t){e.ctrlSeq=`\\Vmatrix`,e.parentheses={left:`‖`,right:`‖`}});var YW=HU(3);for(var XW in YW)(function(e,t){typeof t==`function`?(zU[e]=function(){return RU(),t.apply(this,arguments)},zU[e].prototype=t.prototype):zU[e]=t})(XW,YW[XW]);var ZW=function(e){e.registerEmbed(`newLine`,()=>({htmlString:`<div class="newLine"></div>`,text:()=>`testText`,latex:()=>`\\embed{newLine}[]`}))},QW;typeof window<`u`&&(QW=zU.getInterface(3),QW&&QW.registerEmbed&&ZW(QW));var $W=Cm(`math-input:mq:input`),eG=z(`span`)({}),tG=class extends F.Component{static propTypes={className:P.string,onClick:P.func,onChange:P.func,latex:P.string,onFocus:P.func,onBlur:P.func};componentDidMount(){if(!QW)throw Error(`MQ is not defined - but component has mounted?`);this.mathField=QW.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(){$W(`blur mathfield`),this.mathField.blur()}focus(){$W(`focus mathfield...`),this.mathField.focus()}command(e){return $W(`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 $W(`write: `,e),this.mathField.write(e),this.mathField.focus(),this.mathField.latex()}onInputEdit=()=>{$W(`[onInputEdit] ...`);let{onChange:e}=this.props;this.mathField&&e&&e(this.mathField.latex())};refresh=()=>{this.blur(),this.focus()};onKeyPress=e=>{if(Object.keys(this.mathField.__controller.options).indexOf(`ignoreNextMousedown`)<0&&this.refresh(),e.charCode===13){e.preventDefault();return}};onClick=e=>{let{onClick:t}=this.props;this.refresh(),t&&t(e)};shouldComponentUpdate(e){return $W(`next: `,e.latex),$W(`current: `,this.mathField.latex()),e.latex!==this.mathField.latex()}render(){let{onFocus:e,onBlur:t,className:n}=this.props;return(0,I.jsx)(eG,{className:n,onKeyDown:this.onKeyPress,onClick:this.onClick,onFocus:e,onBlur:t,ref:e=>this.input=e})}},nG=Cm(`pie-lib:math-input:mq:static`),rG=/\\MathQuillMathField\[r\d*\]\{(.*?)\}/g,iG=/ /g;function aG(e=``){return e.replace(iG,``)}function oG(e){let t=0;for(let n=0;n<(e||``).length;n++)e[n]===`{`&&t++;return t}var sG=class extends F.Component{static propTypes={latex:P.string.isRequired,onFocus:P.func,onBlur:P.func,className:P.string,getFieldName:P.func,onSubFieldChange:P.func,onSubFieldFocus:P.func,setInput:P.func};static defaultProps={getFieldName:()=>{}};constructor(e){super(e),this.state={announcement:``,previousLatex:``,inputSource:null,isDeleteKeyPressed:!1},this.inputRef=F.createRef()}componentDidMount(){this.update(),JH(),this.createLiveRegion(),this.addEventListeners()}componentDidUpdate(){this.update(),JH()}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||this._isProgrammaticUpdate)return;let t=this.props.getFieldName(e,this.mathField.innerFields);if(this.props.onSubFieldChange){let n=e.latex().match(/[0-9]\\ \\frac\{[^\{]*\}\{ \}/);if(this.inputRef?.current&&n&&n?.length)try{e.__controller.cursor.insLeftOf(e.__controller.cursor.parent[-1].parent),e.el().dispatchEvent(new KeyboardEvent(`keydown`,{keyCode:8}))}catch(e){console.error(e.toString())}else 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(oG(e)>oG(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.state.previousLatex!==e||this.state.isDeleteKeyPressed)&&this.setState({previousLatex:e,isDeleteKeyPressed:!1})};announceMessage=e=>{this.setState({previousLatex:``}),this.liveRegion&&(this.liveRegion.textContent=e,setTimeout(()=>{this.liveRegion.textContent=``},500))};update=()=>{if(!QW)throw Error(`MQ is not defined - but component has mounted?`);this.mathField||=QW.StaticMath(this.inputRef?.current,{handlers:{edit:this.onInputEdit.bind(this)}});try{this._isProgrammaticUpdate=!0,this.mathField.parseLatex(this.props.latex),this.mathField.latex(this.props.latex)}catch{this.mathField.latex(`\\MathQuillMathField[r1]{}`)}finally{this._isProgrammaticUpdate=!1}};blur=()=>{nG(`blur mathfield`),this.mathField.blur()};focus=()=>{nG(`focus mathfield...`),this.mathField.focus()};shouldComponentUpdate(e){try{let t=aG(this.mathField.parseLatex(e.latex)),n=(e.latex.match(rG)||[]).length,r=t!==aG(this.mathField.latex().trim())||n!==Object.keys(this.mathField.innerFields).length/2;return nG(`[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,I.jsx)(`span`,{className:t,onFocus:this.onFocus,onBlur:e,ref:this.inputRef})}},cG={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`}},lG={"& .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`}},uG={"& .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`}},dG={"& *":{...cG,...lG,"& .mq-math-mode .mq-sqrt-prefix":{top:`0 !important`},"& .mq-math-mode .mq-empty":{padding:`9px 1px !important`},"& .mq-math-mode .mq-longdiv-inner .mq-empty":{padding:`0 !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`}}},fG={commonMqFontStyles:cG,longdivStyles:lG,supsubStyles:uG,commonMqKeyboardStyles:dG},pG=e=>(hc(5-e.length,()=>e.push([])),_c.apply(null,e)),mG=Cm(`pie-lib:math-inline:keypad`),hG=z(sG)(({latex:e})=>{let t={pointerEvents:`none`,textTransform:`none !important`,color:Sp(),"& .mq-scaled.mq-sqrt-prefix":{transform:`scale(1, 0.9) !important`},"& .mq-sup-only .mq-sup":{marginBottom:`0.9px !important`},"& .mq-empty":{backgroundColor:`${pm()} !important`},"& .mq-overline .mq-overline-inner":{borderTop:`2px solid black`},"& .mq-non-leaf.mq-overline":{borderTop:`none !important`},"& .mq-overarrow":{width:`30px`,marginTop:`0 !important`,borderTop:`2px solid black`,fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`,"&.mq-arrow-both":{top:`0px !important`,"& *":{lineHeight:`1 !important`,borderTop:`none !important`},"&:before":{fontSize:`80%`,left:`calc(-13%) !important`,top:`-0.31em !important`},"&:after":{fontSize:`80% !important`,right:`calc(-13%) !important`,top:`-1.5em`},"&.mq-empty:before":{fontSize:`80%`,left:`calc(-13%)`,top:`-0.26em`},"&.mq-empty:after":{fontSize:`80%`,right:`calc(-13%)`,top:`-0.26em`},"&.mq-empty":{minHeight:`1.4em`}},"&.mq-arrow-right:before":{fontSize:`80%`,right:`calc(-13%) !important`,top:`-0.26em !important`},"& .mq-overarrow-inner":{border:`none !important`},"& .mq-overarrow-inner .mq-overarrow-inner-right":{display:`none !important`}},"& .mq-root-block":{padding:`5px !important`},"& .mq-overarrow.mq-arrow-both.mq-empty:after":{right:`-6px`,fontSize:`80% !important`,top:`-3px`},"& .mq-overarrow.mq-arrow-right.mq-empty:before":{right:`-5px`,fontSize:`80% !important`,top:`-3px`},"& .mq-overarrow.mq-arrow-both.mq-empty:before":{left:`-6px`,fontSize:`80% !important`,top:`-3px`},"& .mq-longdiv-inner":{borderTop:`1px solid !important`,paddingTop:`1.5px !important`},"& .mq-parallelogram":{lineHeight:.85},"& .mq-overarc":{borderTop:`2px solid black !important`,"& .mq-overline":{borderTop:`none !important`},"& .mq-overline-inner":{borderTop:`none !important`,paddingTop:`0 !important`}}};return e===`\\parallel`?{...t,fontStyle:`italic !important`}:e===`\\overleftrightarrow{\\overline{}}`?{...t,"& .mq-overarrow.mq-arrow-both":{"& .mq-overline-inner":{borderTop:`none !important`,paddingTop:`0 !important`},"&:after":{position:`absolute !important`,top:`0px !important`}}}:t});hG.propTypes={latex:P.string.isRequired};var gG=e=>e?{gridTemplateColumns:`repeat(${e.columns}, minmax(min-content, 150px))`,gridTemplateRows:`repeat(${e.rows}, minmax(40px, 60px))`,gridAutoFlow:`initial`}:{},_G=z(`div`)(()=>({...dG,width:`100%`,display:`grid`,gridTemplateRows:`repeat(5, minmax(40px, 60px))`,gridRowGap:`0px`,gridColumnGap:`0px`,gridAutoFlow:`column`,"&.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`}}})),vG=z(Mh)(({category:e,isDelete:t,isComma:n,isDot:r})=>({minWidth:`auto`,textTransform:`none`,fontSize:n||r?`200% !important`:`140% !important`,lineHeight:n||r?`100%`:`normal`,color:Sp(),backgroundColor:e===`operators`?fm():dm(),"&:hover":{backgroundColor:e===`operators`?hm():mm()},borderRadius:0,...t&&{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}})),yG=z(Mh)(({category:e})=>({textTransform:`none`,padding:0,margin:0,fontSize:`110% !important`,minWidth:`auto`,borderRadius:0,backgroundColor:e===`operators`?fm():dm(),"&:hover":{backgroundColor:e===`operators`?hm():mm()}})),bG=z(HR)(({category:e})=>({minWidth:`auto`,backgroundColor:e===`operators`?fm():dm(),"&:hover":{backgroundColor:e===`operators`?hm():mm()},borderRadius:0,"& .icon":{height:`30px`}})),xG=class extends F.Component{static propTypes={className:P.string,controlledKeypadMode:P.bool,baseSet:P.array,additionalKeys:P.array,layoutForKeyPad:P.object,onPress:P.func.isRequired,onFocus:P.func,noDecimal:P.bool,setKeypadInteraction:P.func,mode:P.oneOfType([P.string,P.number])};static defaultProps={baseSet:sU,noDecimal:!1};constructor(e){super(e),this.keypadRef=F.createRef()}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);if(i<0){let n=e.height+e.top-i;t&&(t.style.height=`${n}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)};buttonClick=e=>{mG(`[buttonClick]`,e);let{onPress:t}=this.props;t(e)};flowKeys=(e,t)=>ic([...pG(e),...pG(t)]);keyIsNotAllowed=e=>{let{noDecimal:t}=this.props;return!!((e.write===`.`&&e.label===`.`||e.write===`,`&&e.label===`,`)&&t)};render(){let{className:e,baseSet:t,additionalKeys:n,layoutForKeyPad:r,onFocus:i,mode:a}=this.props,o=[`non-negative-integers`,`integers`,`decimals`,`fractions`,`item-authoring`,`language`].includes(a),s=o?this.flowKeys([],n||[]):this.flowKeys(t,n||[]),c=s.length%5?1:0,l={gridTemplateColumns:`repeat(${Math.floor(s.length/5)+c}, minmax(min-content, 150px))`,...gG(r)};return(0,I.jsx)(_G,{ref:this.keypadRef,className:[e,a].filter(Boolean).join(` `),style:l,onFocus:i,children:s.map((e,t)=>{let n=this.buttonClick.bind(this,e);if(!e)return(0,I.jsx)(`span`,{},`empty-${t}`);let r={onClick:n,disabled:this.keyIsNotAllowed(e),key:`${e.label||e.latex||e.command}-${t}`,...e.actions||{},...e.extraProps||{}};if(e.latex)return(0,I.jsx)(yG,{onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{},children:(0,I.jsx)(hG,{latex:e.latex})},r.key);if(e.label)return(0,I.jsx)(vG,{onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,isDelete:e.label===`⌫`,isComma:e.label===`,`,isDot:e.label===`.`,"aria-label":e.ariaLabel?e.ariaLabel:e.name||e.label,...e.actions||{},...e.extraProps||{},children:e.label},r.key);{let t=e.icon?e.icon:`div`;return(0,I.jsx)(bG,{tabIndex:`-1`,onClick:r.onClick,disabled:r.disabled,category:o?void 0:e.category,size:`large`,...e.actions||{},...e.extraProps||{},children:(0,I.jsx)(t,{className:`icon`})},r.key)}})})}},SG=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}},CG=class extends F.Component{static propTypes={className:P.string,controlledKeypadMode:P.bool,mode:P.oneOfType([P.string,P.number]),layoutForKeyPad:P.object,onClick:P.func.isRequired,onFocus:P.func,noDecimal:P.bool,additionalKeys:P.array,setKeypadInteraction:P.func};static defaultProps={mode:`scientific`,noDecimal:!1,additionalKeys:[]};keypadPress=e=>{let{onClick:t}=this.props;t(SG(e))};render(){let{mode:e,onFocus:t,controlledKeypadMode:n,noDecimal:r,className:i,additionalKeys:a,layoutForKeyPad:o,setKeypadInteraction:s}=this.props,c=qH(a);return(0,I.jsx)(xG,{className:i,controlledKeypadMode:n,onFocus:t,noDecimal:r,layoutForKeyPad:o,additionalKeys:UB(GH(e),c),onPress:this.keypadPress,mode:e,setKeypadInteraction:s})}},wG=z(`span`)(()=>({display:`inline-flex`,border:`1px solid ${Zp()}`,margin:`1px 5px`,cursor:`pointer`,alignItems:`center`,justifyContent:`center`,minWidth:`50px`,minHeight:`36px`,height:`fit-content`})),TG=z(`div`)(()=>({background:Gp(),color:Sp(),display:`inline-flex`,borderRight:`2px solid ${Zp()}`,boxSizing:`border-box`,overflow:`hidden`,fontSize:`12px`,minHeight:`36px`,height:`100%`,alignItems:`center`,fontFamily:`Symbola, Times New Roman, serif`,padding:`0 2px`})),EG=z(`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`}})),DG=e=>{let{node:t,options:n,selected:r}=e,{attrs:i}=t,{value:a,index:o}=i,s=`R ${parseInt(o)+1}`;return(0,I.jsx)(zA,{className:`math-templated`,"data-selected":r,style:{display:`inline-flex`,minHeight:`36px`,minWidth:`50px`,cursor:`pointer`},children:(0,I.jsxs)(wG,{...i,children:[(0,I.jsx)(TG,{children:s}),(0,I.jsx)(EG,{children:(0,I.jsx)(sG,{latex:a})})]})})};DG.propTypes={attributes:P.object,value:P.string,keyToDisplay:P.string};var OG={},kG=e=>String(e||``).replace(/-/g,`_`),AG=e=>e&&e.attrs&&e.attrs.index!=null?String(e.attrs.index):null,jG=(e,t)=>{let n=[];return e.descendants((e,r)=>{if(e.type&&e.type.name===t){let t=AG(e);t!=null&&n.push({index:t,pos:r,node:e})}return!0}),n},MG=(e,t)=>{let n=0;return e.descendants(e=>(e.type&&e.type.name===t&&(n+=1),!0)),n},NG=({schema:e,typeName:t,index:n})=>{let r=e.nodes[t];return r?r.create({index:String(n),id:String(n),value:``}):null},PG=(e,t)=>{let n=e.resolve(Math.min(t,e.content.size));return Iy.near(n,1)},FG=XO.create({name:`responseArea`,addOptions(){return{maxResponseAreas:null,error:null,options:null,respAreaToolbar:null,onHandleAreaChange:null}},addProseMirrorPlugins(){if(!this.options.type)return[];let e=kG(this.options.type);return[new eb({key:new rb(`response-area-watcher:${e}`),view:t=>(OG[e]===void 0&&(OG[e]=0,t.state.doc.descendants(t=>{if(t.type&&t.type.name===e){let n=AG(t);if(n!=null){let t=parseInt(n,10);!Number.isNaN(t)&&t>OG[e]&&(OG[e]=t)}}return!0})),{update:(t,n)=>{let r=t.state;if(n.doc.eq(r.doc))return;let i=jG(r.doc,e),a=jG(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=kG(e);if(MG(n.doc,a)>=this.options.maxResponseAreas)return!1;OG[a]===void 0&&(OG[a]=0);let o=OG[a]+1;OG[a]+=1;let s=NG({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([`inline_dropdown`,`explicit_constructed_response`].includes(a))t.setSelection(Ry.create(t.doc,d));else{let e=d+s.nodeSize;t.setSelection(PG(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(Ry.create(e.doc,o)),r&&(n.focus(),r(e)),!0}}}}),IG=yk.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 $A(e=>(0,I.jsx)(tz,{...e,options:this.options}))}}),LG=yk.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 $A(e=>(0,I.jsx)(DG,{...e,options:this.options}))}}),RG=yk.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 $A(e=>(0,I.jsx)(MB,{...e,options:this.options}))}}),zG=yk.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 $A(e=>(0,I.jsx)(NB,{...e,options:this.options}))}}),BG=oa(`MuiDivider`,[`root`,`absolute`,`fullWidth`,`inset`,`middle`,`flexItem`,`light`,`vertical`,`withChildren`,`withChildrenVertical`,`textAlignRight`,`textAlignLeft`,`wrapper`,`wrapperVertical`]),VG=oa(`MuiListItemIcon`,[`root`,`alignItemsFlexStart`]);function HG(e){return aa(`MuiTypography`,e)}oa(`MuiTypography`,[`root`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`subtitle1`,`subtitle2`,`body1`,`body2`,`inherit`,`button`,`caption`,`overline`,`alignLeft`,`alignRight`,`alignCenter`,`alignJustify`,`noWrap`,`gutterBottom`,`paragraph`]);var UG={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},WG=qu(),GG=e=>{let{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:a,classes:o}=e;return Oo({root:[`root`,a,e.align!==`inherit`&&`align${V(t)}`,n&&`gutterBottom`,r&&`noWrap`,i&&`paragraph`]},HG,o)},KG=z(`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${V(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(vf(({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(ch()).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${V(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}}]}))),qG={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,subtitle1:`h6`,subtitle2:`h6`,body1:`p`,body2:`p`,inherit:`p`},JG=F.forwardRef(function(e,t){let{color:n,...r}=Ju({props:e,name:`MuiTypography`}),i=!UG[n],a=WG({...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=qG,...m}=a,h={...a,align:o,color:n,className:s,component:c,gutterBottom:l,noWrap:u,paragraph:d,variant:f,variantMapping:p},g=c||(d?`p`:p[f]||qG[f])||`span`,_=GG(h);return(0,I.jsx)(KG,{as:g,ref:t,className:L(_.root,s),...m,ownerState:h,style:{...o!==`inherit`&&{"--Typography-textAlign":o},...m.style}})}),YG=oa(`MuiListItemText`,[`root`,`multiline`,`dense`,`inset`,`primary`,`secondary`]);function XG(e){return aa(`MuiMenuItem`,e)}var ZG=oa(`MuiMenuItem`,[`root`,`focusVisible`,`dense`,`disabled`,`divider`,`gutters`,`selected`]);function QG(e){return aa(`MuiNativeSelect`,e)}var $G=oa(`MuiNativeSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]),eK=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return Oo({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${V(n)}`,a&&`iconOpen`,r&&`disabled`]},QG,t)},tK=z(`select`,{name:`MuiNativeSelect`})(({theme:e})=>({MozAppearance:`none`,WebkitAppearance:`none`,userSelect:`none`,borderRadius:0,cursor:`pointer`,"&:focus":{borderRadius:0},[`&.${$G.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}}}]})),nK=z(tK,{name:`MuiNativeSelect`,slot:`Select`,shouldForwardProp:Us,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${$G.multiple}`]:t.multiple}]}})({}),rK=z(`svg`,{name:`MuiNativeSelect`})(({theme:e})=>({position:`absolute`,right:0,top:`calc(50% - .5em)`,pointerEvents:`none`,color:(e.vars||e).palette.action.active,[`&.${$G.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}}]})),iK=z(rK,{name:`MuiNativeSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${V(n.variant)}`],n.open&&t.iconOpen]}})({}),aK=F.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=eK(l);return(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(nK,{ownerState:l,className:L(u.select,n),disabled:r,ref:o||t,...c}),e.multiple?null:(0,I.jsx)(iK,{as:a,ownerState:l,className:u.icon})]})});function oK(e){return aa(`MuiSelect`,e)}var sK=oa(`MuiSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`focused`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]);function cK(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 lK(e){return e==null||typeof e==`string`&&!e.trim()}function uK(e,t){return typeof t==`object`&&t?e===t:String(e)===String(t)}var dK=F.createContext(null);function fK(){return F.useContext(dK)}var pK=dK.Provider,mK,hK=z(tK,{name:`MuiSelect`,slot:`Select`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`&.${sK.select}`]:t.select},{[`&.${sK.select}`]:t[n.variant]},{[`&.${sK.error}`]:t.error},{[`&.${sK.multiple}`]:t.multiple}]}})({[`&.${sK.select}`]:{height:`auto`,minHeight:`1.4375em`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`}}),gK=z(rK,{name:`MuiSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${V(n.variant)}`],n.open&&t.iconOpen]}})({}),_K=z(`input`,{shouldForwardProp:e=>Hs(e)&&e!==`classes`,name:`MuiSelect`,slot:`NativeInput`})({bottom:0,left:0,position:`absolute`,opacity:0,pointerEvents:`none`,width:`100%`,boxSizing:`border-box`}),vK=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return Oo({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${V(n)}`,a&&`iconOpen`,r&&`disabled`],nativeInput:[`nativeInput`]},oK,t)},yK=F.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:ee,variant:N=`standard`,...te}=e,[ne,re]=ap({controlled:ee,default:l,name:`Select`}),[ie,ae]=ap({controlled:E,default:c,name:`Select`}),oe=F.useRef(null),se=F.useRef(null),[ce,le]=F.useState(null),{current:ue}=F.useRef(E!=null),[de,fe]=F.useState(),[pe,me]=F.useState(null),he=Vd(t,m),ge=F.useCallback(e=>{se.current=e,e&&le(e)},[]),_e=ce?.parentNode;F.useImperativeHandle(he,()=>({focus:()=>{se.current.focus()},node:oe.current,value:ne}),[ne]);let ve=ce!==null&&ie;F.useEffect(()=>{if(!ve||!_e||a||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{fe(_e.clientWidth)});return e.observe(_e),()=>{e.disconnect()}},[ve,_e,a]),F.useEffect(()=>{c&&ie&&ce&&!ue&&(fe(a?null:_e.clientWidth),se.current.focus())},[ce,a]),F.useEffect(()=>{i&&se.current.focus()},[i]),F.useEffect(()=>{if(!h)return;let e=Qu(se.current).getElementById(h);if(e){let t=()=>{getSelection().isCollapsed&&se.current.focus()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}},[h]);let ye=(e,t)=>{e?(me(cK(t)),T&&T(t)):(me(null),x&&x(t)),ue||(fe(a?null:_e.clientWidth),ae(e))},be=e=>{w?.(e),e.button===0&&(e.preventDefault(),se.current.focus(),ye(!0,e))},xe=e=>{ye(!1,e)},Se=F.Children.toArray(o),Ce=e=>{let t=Se.find(t=>t.props.value===e.target.value);t!==void 0&&(re(t.props.value),b&&b(e,t))},we=e=>t=>{let n;if(t.currentTarget.hasAttribute(`tabindex`)){if(_){n=Array.isArray(ne)?ne.slice():[];let t=ne.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),ne!==n&&(re(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)}_||ye(!1,t)}},Te=e=>{D||([` `,`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),ye(!0,e)),C?.(e))},Ee=e=>{!ve&&y&&(Object.defineProperty(e,"target",{writable:!0,value:{value:ne,name:v}}),y(e))};delete te[`aria-invalid`];let De,Oe,ke=[],Ae=!1;(og({value:ne})||d)&&(O?De=O(ne):Ae=!0);let je=Se.map(e=>{if(!F.isValidElement(e))return null;let t;if(_){if(!Array.isArray(ne))throw Error(it(2));t=ne.some(t=>uK(t,e.props.value)),t&&Ae&&ke.push(e.props.children)}else t=uK(ne,e.props.value),t&&Ae&&(Oe=e.props.children);return F.cloneElement(e,{"aria-selected":t?`true`:`false`,onClick:we(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})});Ae&&(De=_?ke.length===0?null:ke.reduce((e,t,n)=>(e.push(t),n<ke.length-1&&e.push(`, `),e),[]):Oe);let Me=de;!a&&ue&&ce&&(Me=_e.clientWidth);let Ne;Ne=j===void 0?u?null:0:j;let Pe=A.id||(v?`mui-component-select-${v}`:void 0),Fe={...e,variant:N,value:ne,open:ve,error:f},Ie=vK(Fe),Le={...g.PaperProps,...typeof g.slotProps?.paper==`function`?g.slotProps.paper(Fe):g.slotProps?.paper},Re={...g.MenuListProps,...typeof g.slotProps?.list==`function`?g.slotProps.list(Fe):g.slotProps?.list},ze=eo();return(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(hK,{as:`div`,ref:ge,tabIndex:Ne,role:`combobox`,"aria-controls":ve?ze:void 0,"aria-disabled":u?`true`:void 0,"aria-expanded":ve?`true`:`false`,"aria-haspopup":`listbox`,"aria-label":r,"aria-labelledby":[h,Pe].filter(Boolean).join(` `)||void 0,"aria-describedby":n,"aria-required":k?`true`:void 0,"aria-invalid":f?`true`:void 0,onKeyDown:Te,onMouseDown:u||D?null:be,onBlur:Ee,onFocus:S,...A,ownerState:Fe,className:L(A.className,Ie.select,s),id:Pe,children:lK(De)?mK||=(0,I.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):De}),(0,I.jsx)(_K,{"aria-invalid":f,value:Array.isArray(ne)?ne.join(`,`):ne,name:v,ref:oe,"aria-hidden":!0,onChange:Ce,tabIndex:-1,disabled:u,className:Ie.nativeInput,autoFocus:i,required:k,...te,ownerState:Fe}),(0,I.jsx)(gK,{as:p,className:Ie.icon,ownerState:Fe}),(0,I.jsx)(pK,{value:pe,children:(0,I.jsx)(Jg,{id:`menu-${v||``}`,anchorEl:_e,open:ve,onClose:xe,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:ze,...Re},paper:{...Le,style:{minWidth:Me,...Le==null?null:Le.style}}},children:je})})]})}),bK=ep((0,I.jsx)(`path`,{d:`M7 10l5 5 5-5z`}),`ArrowDropDown`);function xK(e){return parseInt(e,10)||0}var SK={shadow:{visibility:`hidden`,position:`absolute`,overflow:`hidden`,height:0,top:0,left:0,transform:`translateZ(0)`}};function CK(e){for(let t in e)return!1;return!0}function wK(e){return CK(e)||e.outerHeightStyle===0&&!e.overflowing}var TK=F.forwardRef(function(e,t){let{onChange:n,maxRows:r,minRows:i=1,style:a,value:o,...s}=e,{current:c}=F.useRef(o!=null),l=F.useRef(null),u=Bd(t,l),d=F.useRef(null),f=F.useRef(null),p=F.useCallback(()=>{let t=l.current,n=f.current;if(!t||!n)return;let a=$u(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)===`
304
+ `&&(n.value+=` `);let o=a.boxSizing,s=xK(a.paddingBottom)+xK(a.paddingTop),c=xK(a.borderBottomWidth)+xK(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=Mf(()=>{let e=l.current,t=p();if(!e||!t||wK(t))return!1;let n=t.outerHeightStyle;return d.current!=null&&d.current!==n}),h=F.useCallback(()=>{let e=l.current,t=p();if(!e||!t||wK(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=F.useRef(-1);return ba(()=>{let e=Yu(h),t=l?.current;if(!t)return;let n=$u(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]),ba(()=>{h()}),(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(`textarea`,{value:o,onChange:e=>{c||h();let t=e.target,r=t.value.length,i=t.value.endsWith(`
305
+ `),a=t.selectionStart===r;i&&a&&t.setSelectionRange(r,r),n&&n(e)},ref:u,rows:i,style:a,...s}),(0,I.jsx)(`textarea`,{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:{...SK.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function EK(e){return aa(`MuiInputBase`,e)}var DK=oa(`MuiInputBase`,[`root`,`formControl`,`focused`,`disabled`,`adornedStart`,`adornedEnd`,`error`,`sizeSmall`,`multiline`,`colorSecondary`,`fullWidth`,`hiddenLabel`,`readOnly`,`input`,`inputSizeSmall`,`inputMultiline`,`inputTypeSearch`,`inputAdornedStart`,`inputAdornedEnd`,`inputHiddenLabel`]),OK,kK=`mui-auto-fill`,AK=`mui-auto-fill-cancel`,jK=(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${V(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},MK=(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]},NK=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 Oo({root:[`root`,`color${V(n)}`,r&&`disabled`,i&&`error`,c&&`fullWidth`,o&&`focused`,s&&`formControl`,f&&f!==`medium`&&`size${V(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`]},EK,t)},PK=z(`div`,{name:`MuiInputBase`,slot:`Root`,overridesResolver:jK})(vf(({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`,[`&.${DK.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%`}}]}))),FK=z(`input`,{name:`MuiInputBase`,slot:`Input`,overridesResolver:MK})(vf(({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] + .${DK.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},[`&.${DK.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:AK,animationDuration:`10ms`,"&:-webkit-autofill":{animationDuration:`5000s`,animationName:kK}}},{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`}}]}})),IK=Ku({[`@keyframes ${kK}`]:{from:{animationName:kK}},[`@keyframes ${AK}`]:{from:{animationName:AK}}}),LK=F.forwardRef(function(e,t){let n=Ju({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:ee,rows:N,size:te,slotProps:ne={},slots:re={},startAdornment:ie,type:ae=`text`,value:oe,...se}=n,ce=v.value==null?oe:v.value,{current:le}=F.useRef(ce!=null),ue=F.useRef(),de=F.useCallback(e=>{},[]),fe=Vd(ue,y,v.ref,de),[pe,me]=F.useState(!1),he=Jh(),ge=Kh({props:n,muiFormControl:he,states:[`color`,`disabled`,`error`,`hiddenLabel`,`size`,`required`,`filled`]});ge.focused=he?he.focused:pe,F.useEffect(()=>{!he&&d&&pe&&(me(!1),T&&T())},[he,d,pe,T]);let _e=he&&he.onFilled,ve=he&&he.onEmpty,ye=F.useCallback(e=>{og(e)?_e&&_e():ve&&ve()},[_e,ve]);np(()=>{le&&ye({value:ce})},[ce,ye,le]),np(()=>{if(!a)return;let e=ue.current;if(!e)return;let t=Qu(e),n=af(t),r=n==null||n===t.body||n===t.documentElement;e===n?he&&he.onFocus?he.onFocus():me(!0):r&&e.focus()},[a]);let be=e=>{O&&O(e),v.onFocus&&v.onFocus(e),he&&he.onFocus?he.onFocus(e):me(!0)},xe=e=>{T&&T(e),v.onBlur&&v.onBlur(e),he&&he.onBlur?he.onBlur(e):me(!1)},Se=(e,...t)=>{if(!le){let t=e.target||ue.current;if(t==null)throw Error(it(1));ye({value:t.value})}v.onChange&&v.onChange(e,...t),E&&E(e,...t)};F.useEffect(()=>{ye(ue.current)},[]);let Ce=e=>{ue.current&&e.currentTarget===e.target&&ue.current.focus(),D&&D(e)},we=_,Te=v;C&&we===`input`&&(Te=N?{type:void 0,minRows:N,maxRows:N,...Te}:{type:void 0,maxRows:x,minRows:S,...Te},we=TK);let Ee=e=>{ye(e.animationName===AK?ue.current:{value:`x`})};F.useEffect(()=>{he&&he.setAdornedStart(!!ie)},[he,ie]);let De={...n,color:ge.color||`primary`,disabled:ge.disabled,endAdornment:p,error:ge.error,focused:ge.focused,formControl:he,fullWidth:h,hiddenLabel:ge.hiddenLabel,multiline:C,size:ge.size,startAdornment:ie,type:ae},Oe=NK(De),ke=re.root||c.Root||PK,Ae=ne.root||l.root||{},je=re.input||c.Input||FK;return Te={...Te,...ne.input??l.input},(0,I.jsxs)(F.Fragment,{children:[!f&&typeof IK==`function`&&(OK||=(0,I.jsx)(IK,{})),(0,I.jsxs)(ke,{...Ae,ref:t,onClick:Ce,...se,...!Wu(ke)&&{ownerState:{...De,...Ae.ownerState}},className:L(Oe.root,Ae.className,o,M&&`MuiInputBase-readOnly`),children:[ie,(0,I.jsx)(qh.Provider,{value:null,children:(0,I.jsx)(je,{"aria-invalid":ge.error,"aria-describedby":r,autoComplete:i,autoFocus:a,defaultValue:u,disabled:ge.disabled,id:g,onAnimationStart:Ee,name:w,placeholder:j,readOnly:M,required:ge.required,rows:N,value:ce,onKeyDown:k,onKeyUp:A,type:ae,...Te,...!Wu(je)&&{as:we,ownerState:{...De,...Te.ownerState}},ref:fe,className:L(Oe.input,Te.className,M&&`MuiInputBase-readOnly`),onBlur:xe,onChange:Se,onFocus:be})}),p,ee?ee({...ge,startAdornment:ie}):null]})]})});function RK(e){return aa(`MuiInput`,e)}var zK={...DK,...oa(`MuiInput`,[`root`,`underline`,`input`])},BK=e=>{let{classes:t,disableUnderline:n}=e,r=Oo({root:[`root`,!n&&`underline`],input:[`input`]},RK,t);return{...t,...r}},VK=z(PK,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...jK(e,t),!n.disableUnderline&&t.underline]}})(vf(({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`},[`&.${zK.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${zK.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(.${zK.disabled}, .${zK.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${zK.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(ch()).map(([t])=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}}))]}})),HK=z(FK,{name:`MuiInput`,slot:`Input`,overridesResolver:MK})({}),UK=F.forwardRef(function(e,t){let n=Ju({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=BK(n),m={root:{ownerState:{disableUnderline:r}}},h=l??a?Ar(l??a,m):m;return(0,I.jsx)(LK,{slots:{root:u.root??i.Root??VK,input:u.input??i.Input??HK},slotProps:h,fullWidth:o,inputComponent:s,multiline:c,ref:t,type:d,...f,classes:p})});UK.muiName=`Input`;function WK(e){return aa(`MuiFilledInput`,e)}var GK={...DK,...oa(`MuiFilledInput`,[`root`,`underline`,`input`,`adornedStart`,`adornedEnd`,`sizeSmall`,`multiline`,`hiddenLabel`])},KK=e=>{let{classes:t,disableUnderline:n,startAdornment:r,endAdornment:i,size:a,hiddenLabel:o,multiline:s}=e,c=Oo({root:[`root`,!n&&`underline`,r&&`adornedStart`,i&&`adornedEnd`,a===`small`&&`size${V(a)}`,o&&`hiddenLabel`,s&&`multiline`],input:[`input`]},WK,t);return{...t,...c}},qK=z(PK,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiFilledInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...jK(e,t),!n.disableUnderline&&t.underline]}})(vf(({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}},[`&.${GK.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${GK.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`},[`&.${GK.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${GK.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(.${GK.disabled}, .${GK.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${GK.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(ch()).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}}]}})),JK=z(FK,{name:`MuiFilledInput`,slot:`Input`,overridesResolver:MK})(vf(({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}}]}))),YK=F.forwardRef(function(e,t){let n=Ju({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=KK(n),g={root:{ownerState:m},input:{ownerState:m}},_=u??a?Ar(g,u??a):g;return(0,I.jsx)(LK,{slots:{root:d.root??i.Root??qK,input:d.input??i.Input??JK},slotProps:_,fullWidth:o,inputComponent:c,multiline:l,ref:t,type:f,...p,classes:h})});YK.muiName=`Input`;var XK,ZK=z(`fieldset`,{name:`MuiNotchedOutlined`,shouldForwardProp:Us})({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%`}),QK=z(`legend`,{name:`MuiNotchedOutlined`,shouldForwardProp:Us})(vf(({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 $K(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,I.jsx)(ZK,{"aria-hidden":!0,className:r,ownerState:c,...o,children:(0,I.jsx)(QK,{ownerState:c,children:s?(0,I.jsx)(`span`,{children:i}):XK||=(0,I.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`})})})}function eq(e){return aa(`MuiOutlinedInput`,e)}var tq={...DK,...oa(`MuiOutlinedInput`,[`root`,`notchedOutline`,`input`])},nq=e=>{let{classes:t}=e,n=Oo({root:[`root`],notchedOutline:[`notchedOutline`],input:[`input`]},eq,t);return{...t,...n}},rq=z(PK,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiOutlinedInput`,slot:`Root`,overridesResolver:jK})(vf(({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 .${tq.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${tq.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${tq.focused} .${tq.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(ch()).map(([t])=>({props:{color:t},style:{[`&.${tq.focused} .${tq.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${tq.error} .${tq.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${tq.disabled} .${tq.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`}}]}})),iq=z($K,{name:`MuiOutlinedInput`,slot:`NotchedOutline`})(vf(({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}})),aq=z(FK,{name:`MuiOutlinedInput`,slot:`Input`,overridesResolver:MK})(vf(({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}}]}))),oq=F.forwardRef(function(e,t){let n=Ju({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=nq(n),m=Jh(),h=Kh({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??rq,v=l.input??r.Input??aq,[y,b]=wf(`notchedOutline`,{elementType:iq,className:p.notchedOutline,shouldForwardComponentProp:!0,ownerState:g,externalForwardedProps:{slots:l,slotProps:u},additionalProps:{label:o!=null&&o!==``&&h.required?(0,I.jsxs)(F.Fragment,{children:[o,` `,`*`]}):o}});return(0,I.jsx)(LK,{slots:{root:_,input:v},slotProps:u,renderSuffix:e=>(0,I.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}})});oq.muiName=`Input`;var sq=e=>{let{classes:t}=e,n=Oo({root:[`root`]},oK,t);return{...t,...n}},cq={name:`MuiSelect`,slot:`Root`,shouldForwardProp:e=>Us(e)&&e!==`variant`},lq=z(UK,cq)(``),uq=z(oq,cq)(``),dq=z(YK,cq)(``),fq=F.forwardRef(function(e,t){let n=Ju({name:`MuiSelect`,props:e}),{autoWidth:r=!1,children:i,classes:a={},className:o,defaultOpen:s=!1,displayEmpty:c=!1,IconComponent:l=bK,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=_?aK:yK,E=Kh({props:n,muiFormControl:Jh(),states:[`variant`,`error`]}),D=E.variant||C,O={...n,variant:D,classes:a},k=sq(O),{root:A,...j}=k,M=d||{standard:(0,I.jsx)(lq,{ownerState:O}),outlined:(0,I.jsx)(uq,{label:p,ownerState:O}),filled:(0,I.jsx)(dq,{ownerState:O})}[D],ee=Vd(t,od(M));return(0,I.jsx)(F.Fragment,{children:F.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?Ar(j,f.classes):j,...d?d.props.inputProps:{}},...(g&&_||c)&&D===`outlined`?{notched:!0}:{},ref:ee,className:L(M.props.className,o,k.root),...!d&&{variant:D},...w})})});fq.muiName=`Select`;function pq(e,t){if(t==null){e.focus();return}try{e.focus({focusVisible:t===`keyboard`})}catch{e.focus()}}var mq=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},hq=e=>{let{disabled:t,dense:n,divider:r,disableGutters:i,selected:a,classes:o}=e,s=Oo({root:[`root`,n&&`dense`,t&&`disabled`,!i&&`gutters`,r&&`divider`,a&&`selected`]},XG,o);return{...o,...s}},gq=z(ih,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiMenuItem`,slot:`Root`,overridesResolver:mq})(vf(({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`}},[`&.${ZG.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${ZG.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${ZG.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)}},[`&.${ZG.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${ZG.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${BG.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${BG.inset}`]:{marginLeft:52},[`& .${YG.root}`]:{marginTop:0,marginBottom:0},[`& .${YG.inset}`]:{paddingLeft:36},[`& .${VG.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,[`& .${VG.root} svg`]:{fontSize:`1.25rem`}}}]}))),_q=F.forwardRef(function(e,t){let n=Ju({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=fK(),m=F.useContext(Ag),h=F.useMemo(()=>({dense:a||m.dense||!1,disableGutters:s}),[m.dense,a,s]),g=F.useRef(null);np(()=>{r&&g.current&&pq(g.current,p)},[r]);let _={...n,dense:h.dense,divider:o,disableGutters:s},v=hq(n),y=Vd(g,t),{root:b,...x}=v,S;return n.disabled||(S=u===void 0?-1:u),(0,I.jsx)(Ag.Provider,{value:h,children:(0,I.jsx)(gq,{ref:y,role:l,tabIndex:S,component:i,focusVisibleClassName:L(v.focusVisible,c),className:L(v.root,d),...f,ownerState:_,classes:x})})}),vq=()=>{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`)})},{commonMqFontStyles:yq,commonMqKeyboardStyles:bq,longdivStyles:xq,supsubStyles:Sq}=fG,Cq=Cm(`@pie-lib:math-toolbar:editor-and-pad`),wq=/\.|,/g,Tq=z(`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}})),Eq=z(`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`}},"& *":{...yq,...Sq,...xq,"& .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`}})),Dq=z(dg)({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`}}),Oq=z(ig)(()=>({backgroundColor:`transparent`})),kq=z(`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`}})),Aq=z(tG)(({controlledKeypadMode:e})=>({maxWidth:e?`400px`:`500px`,color:Sp(),backgroundColor:Wp(),padding:`2px`})),jq=z(Mh)({position:`absolute`,right:`12px`,border:`1px solid lightgrey`,color:Sp()}),Mq=z(`hr`)(({theme:e})=>({padding:0,margin:0,height:`1px`,border:`none`,borderBottom:`solid 1px ${e.palette.primary.main}`})),Nq=z(CG)(({mode:e})=>({...bq,...e===`language`&&{"& *":{fontFamily:`Roboto, Helvetica, Arial, sans-serif !important`}}})),Pq=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}},Fq=class extends F.Component{static propTypes={classNames:P.object,keypadMode:P.oneOfType([P.string,P.number]),autoFocus:P.bool,allowAnswerBlock:P.bool,showKeypad:P.bool,controlledKeypad:P.bool,controlledKeypadMode:P.bool,error:P.string,noDecimal:P.bool,hideInput:P.bool,noLatexHandling:P.bool,layoutForKeyPad:P.object,maxResponseAreas:P.number,additionalKeys:P.array,latex:P.string.isRequired,onAnswerBlockAdd:P.func,onFocus:P.func,onBlur:P.func,onChange:P.func.isRequired,setKeypadInteraction:P.func};constructor(e){super(e),this.state={equationEditor:`item-authoring`,addDisabled:!1}}componentDidMount(){this.input&&this.props.autoFocus&&(this.focusTimeout=setTimeout(()=>{this.focusTimeout=void 0,this.input?.focus()},0))}componentWillUnmount(){this.focusTimeout&&clearTimeout(this.focusTimeout)}onClick=e=>{let{noDecimal:t,noLatexHandling:n,onChange:r}=this.props,i=Pq(e);if(Cq(`mathChange: `,i),n){r(i.value);return}t&&(i.value===`.`||i.value===`,`)||i&&(i.type===`clear`?(Cq(`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(JH(),vq(),this.updateDisable(!0),n&&(e.indexOf(`.`)!==-1||e.indexOf(`,`)!==-1)&&this.input){this.input.clear(),this.input.write(e.replace(wq,``));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 Cq(`[shouldComponentUpdate] `,`inputIsDifferent: `,n),!lc(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 Cq(`[render]`,d),(0,I.jsxs)(Tq,{className:e.mathToolbar,children:[(0,I.jsxs)(Eq,{hide:l,children:[a&&(0,I.jsxs)(Dq,{variant:`standard`,children:[(0,I.jsx)(Oq,{id:`equation-editor-label`,children:`Equation Editor`}),(0,I.jsxs)(fq,{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,I.jsx)(_q,{value:`non-negative-integers`,children:`Numeric - Non-Negative Integers`}),(0,I.jsx)(_q,{value:`integers`,children:`Numeric - Integers`}),(0,I.jsx)(_q,{value:`decimals`,children:`Numeric - Decimals`}),(0,I.jsx)(_q,{value:`fractions`,children:`Numeric - Fractions`}),(0,I.jsx)(_q,{value:1,children:`Grade 1 - 2`}),(0,I.jsx)(_q,{value:3,children:`Grade 3 - 5`}),(0,I.jsx)(_q,{value:6,children:`Grade 6 - 7`}),(0,I.jsx)(_q,{value:8,children:`Grade 8 - HS`}),(0,I.jsx)(_q,{value:`geometry`,children:`Geometry`}),(0,I.jsx)(_q,{value:`advanced-algebra`,children:`Advanced Algebra`}),(0,I.jsx)(_q,{value:`statistics`,children:`Statistics`}),(0,I.jsx)(_q,{value:`item-authoring`,children:`Item Authoring`})]})]}),(0,I.jsx)(kq,{error:m,children:(0,I.jsx)(Aq,{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,I.jsx)(jq,{type:`primary`,style:{bottom:h?`320px`:`20px`},onClick:this.onAnswerBlockClick,disabled:g,children:`+ Response Area`}),(0,I.jsx)(Mq,{}),h&&(0,I.jsx)(Nq,{mode:a?this.state.equationEditor:t,controlledKeypadMode:a,layoutForKeyPad:u,additionalKeys:r,onClick:this.onClick,noDecimal:c,setKeypadInteraction:s})]})}},Iq=z(HR)(({hideBackground:e})=>({verticalAlign:`top`,width:`28px`,height:`28px`,color:`#00bb00`,...e&&{backgroundColor:am(),"&:hover":{backgroundColor:Gp()}},"& .MuiIconButton-label":{position:`absolute`,top:`2px`}})),Lq=({onClick:e,hideBackground:t})=>(0,I.jsx)(Iq,{"aria-label":`Done`,onClick:e,hideBackground:t,size:`large`,children:(0,I.jsx)(GR,{})});Lq.propTypes={onClick:P.func,hideBackground:P.bool};var Rq=Lq,{commonMqFontStyles:zq,longdivStyles:Bq,supsubStyles:Vq}=fG,Hq=Cm(`@pie-lib:math-toolbar:math-preview`),Uq=z(`div`)(({theme:e,isSelected:t})=>({display:`inline-flex`,alignItems:`center`,position:`relative`,"& *":zq,...Vq,...Bq,"& > .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}`}})),Wq=z(`span`)({position:`absolute`,bottom:0,left:0,right:0,top:0}),Gq=class extends F.Component{static propTypes={latex:P.string,isSelected:P.bool,onFocus:P.func,onBlur:P.func};componentDidMount(){vq()}componentDidUpdate(e){this.props.latex!==e.latex&&vq()}render(){let{isSelected:e,onFocus:t,onBlur:n,latex:r}=this.props;return Hq(`[render] latex: `,r),(0,I.jsxs)(Uq,{isSelected:e,children:[` `,(0,I.jsx)(Wq,{}),(0,I.jsx)(sG,{latex:r,onFocus:t,onBlur:n})]})}},Kq=z(`div`)({display:`flex`,width:`100%`,zIndex:8,alignItems:`center`}),qq=class extends F.Component{static propTypes={autoFocus:P.bool,allowAnswerBlock:P.bool,controlledKeypad:P.bool,controlledKeypadMode:P.bool,keypadMode:P.oneOfType([P.string,P.number]),classNames:P.object,error:P.string,maxResponseAreas:P.number,showKeypad:P.bool,noDecimal:P.bool,additionalKeys:P.array,latex:P.string.isRequired,onAnswerBlockAdd:P.func,onChange:P.func,onDone:P.func.isRequired,onFocus:P.func,onBlur:P.func,hideDoneButton:P.bool,keyPadCharacterRef:P.func,setKeypadInteraction:P.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,I.jsx)(Jq,{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:_})}},Jq=class extends F.Component{static propTypes={classNames:P.object,latex:P.string.isRequired,keypadMode:P.oneOfType([P.string,P.number]),hideInput:P.bool,noLatexHandling:P.bool,layoutForKeyPad:P.object,onChange:P.func.isRequired,onDone:P.func.isRequired,onBlur:P.func,onAnswerBlockAdd:P.func,additionalKeys:P.array,onFocus:P.func,autoFocus:P.bool,noDecimal:P.bool,allowAnswerBlock:P.bool,controlledKeypad:P.bool,controlledKeypadMode:P.bool,showKeypad:P.bool,hideDoneButton:P.bool,hideDoneButtonBackground:P.bool,error:P.any,maxResponseAreas:P.number,keyPadCharacterRef:P.object,setKeypadInteraction:P.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,I.jsxs)(Kq,{className:e&&e.toolbar||``,ref:p,children:[(0,I.jsx)(`div`,{}),(0,I.jsx)(Fq,{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,I.jsx)(Rq,{hideBackground:x,onClick:_})]})}},Yq=new rb(`ensureTextAfterMath`),Xq=(e=[])=>e.map(e=>({name:e,latex:e,write:e,label:e})),Zq=e=>new eb({key:Yq,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}}),Qq=(e,t)=>{let n;for(n=t;n>0;n--){let t=e.nodeAt(n);if(t?.type?.name===`text`&&t.textContent!==`​`)return-1;if(t&&t?.type?.name!==`text`)break}return n},$q=new eb({key:new rb(`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){let e=Qq(a,o);return e===-1?!1:(r(n.tr.delete(e,o)),!0)}if(s&&t.key===`ArrowLeft`&&o>0){let e=Qq(a,o);if(e===-1)return!1;let t=n.doc.resolve(e);if(t.nodeAfter||t.nodeBefore){let t=n.doc.resolve(e);return r(n.tr.setSelection(Ry.create(n.doc,t.pos))),!0}else return r(n.tr.setSelection(Iy.create(n.doc,o-2))),!0}return!1}}}),eJ=yk.create({name:`math`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{latex:{default:``},wrapper:{default:null},html:{default:null}}},addProseMirrorPlugins(){return[Zq(this.name),$q]},parseHTML(){return[{tag:`span[data-latex]`,getAttrs:e=>({latex:Fe(e.getAttribute(`data-raw`)||e.textContent).unwrapped})},{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=Ry.create(t.doc,o.$from.pos);t.setSelection(e)}return r(t),ez(n,!0),!0}}},renderHTML({HTMLAttributes:e}){return e.html?[`span`,{"data-type":`mathml`,dangerouslySetInnerHTML:{__html:e.html}}]:[`span`,{"data-latex":``,"data-raw":e.latex},Pe(e.latex,e.wrapper)]},addNodeView(){return $A(e=>(0,I.jsx)(tJ,{...e,options:this.options}))}}),tJ=e=>{let{node:t,updateAttributes:n,editor:r,selected:i,options:a,getPos:o}=e,[s,c]=(0,F.useState)(i),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)(Date.now()),[f,p]=(0,F.useState)({top:0,left:0}),{math:m={}}=a||{},{keypadMode:h,controlledKeypadMode:g=!0,customKeys:_=[],keyPadCharacterRef:v,setKeypadInteraction:y}=m,b=t.attrs.latex||``,x=e=>{n({latex:e})},S=(e,{moveCursorAfterNode:i=!0}={})=>{if(n({latex:e}),c(!1),i&&typeof o==`function`){let e=o(),{doc:n}=r.state,i=Iy.create(n,e+t.nodeSize),a=r.state.tr.setSelection(i);r.view.dispatch(a)}r.commands.focus()};return(0,F.useEffect)(()=>{if(!i)return;let{selection:e}=r.state;e.node?.type?.name===`math`&&c(!0)},[i,r]),(0,F.useEffect)(()=>{ez(r,i||s)},[r,s,i]),(0,F.useEffect)(()=>{if(!r||!s){p({top:0,left:0});return}let e=()=>{if(!l.current)return;let{from:e}=r.state.selection,t=r.view.coordsAtPos(e),n=u.current?.getBoundingClientRect?.(),i=n?.height?n.top:t.top,a=n?.width?n.left:t.left,o=n?.height?n.bottom:t.bottom??t.top,s=l.current.offsetHeight,c=l.current.offsetWidth,d=window.innerHeight-(o+0)>=s?o+0:i-s-0,f=a;d=Math.max(8,Math.min(d,window.innerHeight-s-8)),f=Math.max(8,Math.min(f,window.innerWidth-c-8));let m=(r._tiptapContainerEl||document.body).getBoundingClientRect();p({top:d-m.top,left:f-m.left})};e();let t=null,n=()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,e()}))};return t=requestAnimationFrame(()=>{t=null,e()}),window.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{t!==null&&cancelAnimationFrame(t),window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n)}},[r,s]),(0,F.useEffect)(()=>{let e=performance.now(),n=n=>{if(n?.timeStamp<e)return;let i=n?.target,a=(document.querySelectorAll?.(`[id^="equation-editor-select"][id*="listbox"], [aria-labelledby="equation-editor-label"][role="listbox"]`)||[]).length>0,o=!!(i?.id&&i.id.includes(`equation-editor-select`))||!!i?.closest?.(`[id*="equation-editor-select"]`),s=!!i?.closest?.(`.math-node-${d.current}`);if(l.current&&!l.current.contains(i)&&!i?.closest?.(`[data-inline-node]`)&&!a&&!o&&!s){c(!1);let e=!!r?.view?.dom?.contains(i);S(t.attrs.latex,{moveCursorAfterNode:!e})}};return s?document.addEventListener(`click`,n):document.removeEventListener(`click`,n),()=>document.removeEventListener(`click`,n)},[r,s,t]),(0,I.jsxs)(zA,{className:`math-node-${d.current}`,style:{display:`inline-flex`,cursor:`pointer`,margin:`0 4px`},"data-selected":i,children:[(0,I.jsx)(`div`,{ref:u,onClick:()=>c(!0),contentEditable:!1,children:(0,I.jsx)(Gq,{latex:b})}),s&&gd.createPortal((0,I.jsx)(`div`,{ref:l,"data-toolbar-for":r.instanceId,style:{position:`absolute`,top:`${f.top}px`,left:`${f.left}px`,zIndex:1e3,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,I.jsx)(qq,{latex:b,autoFocus:!0,onChange:x,onDone:S,keypadMode:h,controlledKeypadMode:g,additionalKeys:Xq(_),keyPadCharacterRef:v,setKeypadInteraction:y})}),r?._tiptapContainerEl||document.body)]})};function nJ(e){return aa(`MuiLinearProgress`,e)}oa(`MuiLinearProgress`,[`root`,`colorPrimary`,`colorSecondary`,`determinate`,`indeterminate`,`buffer`,`query`,`dashed`,`dashedColorPrimary`,`dashedColorSecondary`,`bar`,`bar1`,`bar2`,`barColorPrimary`,`barColorSecondary`,`bar1Indeterminate`,`bar1Determinate`,`bar1Buffer`,`bar2Indeterminate`,`bar2Buffer`]);var rJ=4,iJ=rr`
306
+ 0% {
307
+ left: -35%;
308
+ right: 100%;
309
+ }
310
+
311
+ 60% {
312
+ left: 100%;
313
+ right: -90%;
314
+ }
315
+
316
+ 100% {
317
+ left: 100%;
318
+ right: -90%;
319
+ }
320
+ `,aJ=typeof iJ==`string`?null:nr`
321
+ animation: ${iJ} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
322
+ `,oJ=rr`
323
+ 0% {
324
+ left: -200%;
325
+ right: 100%;
326
+ }
327
+
328
+ 60% {
329
+ left: 107%;
330
+ right: -8%;
331
+ }
332
+
333
+ 100% {
334
+ left: 107%;
335
+ right: -8%;
336
+ }
337
+ `,sJ=typeof oJ==`string`?null:nr`
338
+ animation: ${oJ} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
339
+ `,cJ=rr`
340
+ 0% {
341
+ opacity: 1;
342
+ background-position: 0 -23px;
343
+ }
344
+
345
+ 60% {
346
+ opacity: 0;
347
+ background-position: 0 -23px;
348
+ }
349
+
350
+ 100% {
351
+ opacity: 1;
352
+ background-position: -200px -23px;
353
+ }
354
+ `,lJ=typeof cJ==`string`?null:nr`
355
+ animation: ${cJ} 3s infinite linear;
356
+ `,uJ=e=>{let{classes:t,variant:n,color:r}=e;return Oo({root:[`root`,`color${V(r)}`,n],dashed:[`dashed`,`dashedColor${V(r)}`],bar1:[`bar`,`bar1`,`barColor${V(r)}`,(n===`indeterminate`||n===`query`)&&`bar1Indeterminate`,n===`determinate`&&`bar1Determinate`,n===`buffer`&&`bar1Buffer`],bar2:[`bar`,`bar2`,n!==`buffer`&&`barColor${V(r)}`,n===`buffer`&&`color${V(r)}`,(n===`indeterminate`||n===`query`)&&`bar2Indeterminate`,n===`buffer`&&`bar2Buffer`]},nJ,t)},dJ=(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),fJ=z(`span`,{name:`MuiLinearProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${V(n.color)}`],t[n.variant]]}})(vf(({theme:e})=>({position:`relative`,overflow:`hidden`,display:`block`,height:4,zIndex:0,"@media print":{colorAdjust:`exact`},variants:[...Object.entries(e.palette).filter(ch()).map(([t])=>({props:{color:t},style:{backgroundColor:dJ(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)`}}]}))),pJ=z(`span`,{name:`MuiLinearProgress`,slot:`Dashed`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.dashed,t[`dashedColor${V(n.color)}`]]}})(vf(({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(ch()).map(([t])=>{let n=dJ(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),lJ||{animation:`${cJ} 3s infinite linear`}),mJ=z(`span`,{name:`MuiLinearProgress`,slot:`Bar1`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${V(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar1Indeterminate,n.variant===`determinate`&&t.bar1Determinate,n.variant===`buffer`&&t.bar1Buffer]}})(vf(({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(ch()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:`determinate`},style:{transition:`transform .${rJ}s linear`}},{props:{variant:`buffer`},style:{zIndex:1,transition:`transform .${rJ}s linear`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:aJ||{animation:`${iJ} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),hJ=z(`span`,{name:`MuiLinearProgress`,slot:`Bar2`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${V(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar2Indeterminate,n.variant===`buffer`&&t.bar2Buffer]}})(vf(({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(ch()).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(ch()).map(([t])=>({props:{color:t,variant:`buffer`},style:{backgroundColor:dJ(e,t),transition:`transform .${rJ}s linear`}})),{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:sJ||{animation:`${oJ} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),gJ=F.forwardRef(function(e,t){let n=Ju({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=uJ(l),d=Ka(),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,I.jsxs)(fJ,{className:L(u.root,r),ownerState:l,role:`progressbar`,...f,ref:t,...c,children:[s===`buffer`?(0,I.jsx)(pJ,{className:u.dashed,ownerState:l}):null,(0,I.jsx)(mJ,{className:u.bar1,ownerState:l,style:p.bar1}),s===`determinate`?null:(0,I.jsx)(hJ,{className:u.bar2,ownerState:l,style:p.bar2})]})}),_J=(e,t)=>{if(!e||!t)return null;let n=null;return e.state.doc.descendants((e,r)=>{if(n!==null)return!1;if(e.type.name===`imageUploadNode`&&e.attrs.nodeKey===t)return n=[e,r],!1}),n},vJ=()=>`img-${Date.now()}-${Math.random().toString(36).slice(2)}`,yJ=Cm(`@pie-lib:editable-html:image:insert-image-handler`),bJ=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,this.nodeKey=this.node?.attrs?.nodeKey||null}resolveNodePos(){let e=_J(this.editor,this.nodeKey);return e?e[1]:this.nodeKey?null:this.nodePos}cancel(){yJ(`insert cancelled`);try{this.deleteNode(),this.onFinish(!1)}catch{}finally{this.editor._insertingImage=!1}}updateNode(e){let t=this.resolveNodePos();if(t===null){yJ(`[updateNode] node is gone, dropping update: `,e);return}let{state:n,view:r}=this.editor,{tr:i}=n,a=n.doc.nodeAt(t);if(a){let n=i.setNodeMarkup(t,void 0,{...a.attrs,...e});r.dispatch(n)}}deleteNode(){let e=this.resolveNodePos();if(e===null)return;let{state:t,view:n}=this.editor,{tr:r}=t,i=t.doc.nodeAt(e)||this.node,a=r.delete(e,e+i.nodeSize);n.dispatch(a)}done(e,t){yJ(`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,yJ(`[fileChosen] file: `,e);let t=new FileReader;t.onload=()=>{let e=t.result;this.updateNode({src:e})},t.readAsDataURL(e)}progress(e,t,n){yJ(`progress: `,e,t,n),this.updateNode({percent:e})}getChosenFile(){return this.chosenFile}};function xJ(e){return aa(`MuiDialogContent`,e)}oa(`MuiDialogContent`,[`root`,`dividers`]);function SJ(e){return aa(`MuiDialogTitle`,e)}var CJ=oa(`MuiDialogTitle`,[`root`]),wJ=e=>{let{classes:t,dividers:n}=e;return Oo({root:[`root`,n&&`dividers`]},xJ,t)},TJ=z(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(vf(({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:{[`.${CJ.root} + &`]:{paddingTop:0}}}]}))),EJ=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...a}=n,o={...n,dividers:i},s=wJ(o);return(0,I.jsx)(TJ,{className:L(s.root,r),ownerState:o,ref:t,...a})}),DJ=ep((0,I.jsx)(`path`,{d:`M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z`}),`ArrowBackIos`);function OJ(e){return aa(`MuiFormHelperText`,e)}var kJ=oa(`MuiFormHelperText`,[`root`,`error`,`disabled`,`sizeSmall`,`sizeMedium`,`contained`,`focused`,`filled`,`required`]),AJ,jJ=e=>{let{classes:t,contained:n,size:r,disabled:i,error:a,filled:o,focused:s,required:c}=e;return Oo({root:[`root`,i&&`disabled`,a&&`error`,r&&`size${V(r)}`,n&&`contained`,s&&`focused`,o&&`filled`,c&&`required`]},OJ,t)},MJ=z(`p`,{name:`MuiFormHelperText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${V(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(vf(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:`left`,marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${kJ.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${kJ.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}}]}))),NJ=F.forwardRef(function(e,t){let n=Ju({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=Kh({props:n,muiFormControl:Jh(),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};delete h.ownerState;let g=jJ(h);return(0,I.jsx)(MJ,{as:a,className:L(g.root,i),ref:t,...p,ownerState:h,children:r===` `?AJ||=(0,I.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):r})});function PJ(e){return aa(`MuiTextField`,e)}oa(`MuiTextField`,[`root`]);var FJ={standard:UK,filled:YK,outlined:oq},IJ=e=>{let{classes:t}=e;return Oo({root:[`root`]},PJ,t)},LJ=z(dg,{name:`MuiTextField`,slot:`Root`})({}),RJ=F.forwardRef(function(e,t){let n=Ju({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:ee={},type:N,value:te,variant:ne=`outlined`,...re}=n,ie={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:f,multiline:S,required:O,select:A,variant:ne},ae=IJ(ie),oe=eo(m),se=p&&oe?`${oe}-helper-text`:void 0,ce=y&&oe?`${oe}-label`:void 0,le=FJ[ne],ue={slots:M,slotProps:{input:_,inputLabel:h,htmlInput:g,formHelperText:d,select:j,...ee}},de={},fe=ue.slotProps.inputLabel;ne===`outlined`&&(fe&&fe.shrink!==void 0&&(de.notched=fe.shrink),de.label=y),A&&((!j||!j.native)&&(de.id=void 0),de[`aria-describedby`]=void 0);let[pe,me]=wf(`root`,{elementType:LJ,shouldForwardComponentProp:!0,externalForwardedProps:{...ue,...re},ownerState:ie,className:L(ae.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:f,required:O,color:s,variant:ne}}),[he,ge]=wf(`input`,{elementType:le,externalForwardedProps:ue,additionalProps:de,ownerState:ie}),[_e,ve]=wf(`inputLabel`,{elementType:ig,externalForwardedProps:ue,ownerState:ie}),[ye,be]=wf(`htmlInput`,{elementType:`input`,externalForwardedProps:ue,ownerState:ie}),[xe,Se]=wf(`formHelperText`,{elementType:NJ,externalForwardedProps:ue,ownerState:ie}),[Ce,we]=wf(`select`,{elementType:fq,externalForwardedProps:ue,ownerState:ie}),Te=(0,I.jsx)(he,{"aria-describedby":se,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:f,multiline:S,name:C,rows:k,maxRows:b,minRows:x,type:N,value:te,id:oe,inputRef:v,onBlur:w,onChange:T,onFocus:E,placeholder:D,inputProps:be,slots:{input:M.htmlInput?ye:void 0},...ge});return(0,I.jsxs)(pe,{...me,children:[y!=null&&y!==``&&(0,I.jsx)(_e,{htmlFor:oe,id:ce,...ve,children:y}),A?(0,I.jsx)(Ce,{"aria-describedby":se,id:oe,labelId:ce,value:te,input:Te,...we,children:a}):Te,p&&(0,I.jsx)(xe,{id:se,...Se,children:p})]})});function zJ(e){return aa(`MuiDialogActions`,e)}oa(`MuiDialogActions`,[`root`,`spacing`]);var BJ=e=>{let{classes:t,disableSpacing:n}=e;return Oo({root:[`root`,!n&&`spacing`]},zJ,t)},VJ=z(`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}}}]}),HJ=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...a}=n,o={...n,disableSpacing:i},s=BJ(o);return(0,I.jsx)(VJ,{className:L(s.root,r),ownerState:o,ref:t,...a})});function UJ(e){return aa(`MuiDialog`,e)}var WJ=oa(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperScrollPaper`,`paperScrollBody`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]),GJ=F.createContext({}),KJ=z(jf,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),qJ=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:a}=e;return Oo({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${V(n)}`],paper:[`paper`,`paperScroll${V(n)}`,`paperWidth${V(String(r))}`,i&&`paperFullWidth`,a&&`paperFullScreen`]},UJ,t)},JJ=z(Uf,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),YJ=z(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${V(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`}}}]}),XJ=z(qf,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${V(n.scroll)}`],t[`paperWidth${V(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(vf(({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)`,[`&.${WJ.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}`,[`&.${WJ.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,[`&.${WJ.paperScrollBody}`]:{margin:0,maxWidth:`100%`}}}]}))),ZJ=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiDialog`}),r=Vs(),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=qf,PaperProps:b={},role:x=`dialog`,scroll:S=`paper`,slots:C={},slotProps:w={},TransitionComponent:T=Df,transitionDuration:E=i,TransitionProps:D,...O}=n,k={...n,disableEscapeKeyDown:f,fullScreen:p,fullWidth:m,maxWidth:h,scroll:S},A=qJ(k),j=F.useRef(),M=e=>{j.current=e.target===e.currentTarget},ee=e=>{g&&g(e),j.current&&(j.current=null,_&&_(e,`backdropClick`))},N=eo(o),te=F.useMemo(()=>({titleId:N}),[N]),ne={slots:{transition:T,...C},slotProps:{transition:D,paper:b,backdrop:l,...w}},[re,ie]=wf(`root`,{elementType:JJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:L(A.root,d),ref:t}),[ae,oe]=wf(`backdrop`,{elementType:KJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:A.backdrop}),[se,ce]=wf(`paper`,{elementType:XJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:A.paper,additionalProps:{elevation:24,role:x,"aria-describedby":a,"aria-labelledby":N,"aria-modal":s,tabIndex:-1,[of]:``}}),[le,ue]=wf(`container`,{elementType:YJ,externalForwardedProps:ne,ownerState:k,className:A.container}),[de,fe]=wf(`transition`,{elementType:Df,externalForwardedProps:ne,ownerState:k,additionalProps:{appear:!0,in:v,timeout:E,role:`presentation`}});return(0,I.jsx)(re,{closeAfterTransition:!0,slots:{backdrop:ae},slotProps:{backdrop:{transitionDuration:E,as:c,...oe}},disableEscapeKeyDown:f,onClose:_,open:v,onClick:ee,...ie,...O,children:(0,I.jsx)(de,{...fe,children:(0,I.jsx)(le,{onMouseDown:M,...ue,children:(0,I.jsx)(se,{as:y,...ce,children:(0,I.jsx)(GJ.Provider,{value:te,children:u})})})})})}),QJ=class extends F.Component{static propTypes={onDone:P.func.isRequired,alt:P.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,I.jsxs)(ZJ,{open:!0,disablePortal:!0,onClose:this.closeDialog,id:`text-dialog`,hideBackdrop:!0,disableScrollLock:!0,onEntered:this.handleOverflow,children:[(0,I.jsx)(EJ,{children:(0,I.jsxs)(`div`,{style:{display:`flex`},children:[(0,I.jsx)(DJ,{style:{paddingTop:`6px`}}),(0,I.jsx)(RJ,{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,I.jsx)(HJ,{children:(0,I.jsx)(Mh,{onClick:this.onDone,children:`Done`})})]})}},$J=z(`button`,{shouldForwardProp:e=>![`active`,`disabled`,`extraStyles`].includes(e)})(({active:e,disabled:t})=>({color:e?Sp():Cp(),display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:t?`not-allowed`:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:t?Cp():Sp()},"&:focus":{outline:`2px solid ${um()}`},...t&&{opacity:.7}})),eY=Cm(`pie-elements:editable-html:raw-button`);(class extends F.Component{static propTypes={onClick:P.func.isRequired,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,active:P.bool,disabled:P.bool,extraStyles:P.object};constructor(e){super(e)}onClick=e=>{eY(`[onClick]`),e.preventDefault();let{onClick:t}=this.props;t(e)};onKeyDown=e=>{if(e.key===`Enter`||e.key===` `){eY(`[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,I.jsx)($J,{style:r,active:e,disabled:n,onMouseDown:this.onClick,onKeyDown:this.onKeyDown,"aria-label":i,"aria-pressed":e,tabIndex:0,children:t})}});var tY=class extends F.Component{static propTypes={onToggle:P.func.isRequired,mark:P.string,label:P.string.isRequired,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,active:P.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,I.jsx)($J,{active:t,onMouseDown:this.onToggle,"aria-pressed":t,onKeyDown:this.onKeyDown,"aria-label":n,tabIndex:0,children:e})}},nY=Cm(`@pie-lib:editable-html:plugins:image:image-toolbar`),rY=z(`div`)(({theme:e})=>({paddingLeft:e.spacing.unit,display:`flex`,alignItems:`center`})),iY=z(`span`,{shouldForwardProp:e=>![`disabled`,`hasAlignmentButtons`].includes(e)})(({disabled:e,hasAlignmentButtons:t})=>({...e&&{opacity:.5},...t&&{borderLeft:`1px solid grey`,paddingLeft:8,marginLeft:4}})),aY=({alignment:e,active:t,onClick:n})=>(0,I.jsx)(tY,{active:t,onToggle:()=>n(e),label:e,children:e});aY.propTypes={alignment:P.string.isRequired,active:P.bool.isRequired,onClick:P.func.isRequired};var oY=class extends F.Component{static propTypes={onChange:P.func.isRequired,alignment:P.string,alt:P.string,imageLoaded:P.bool,disableImageAlignmentButtons:P.bool};onAltTextDone=e=>{nY(`[onAltTextDone]: alt:`,e),this.props.onChange({alt:e},!0)};onAlignmentClick=e=>{nY(`[onAlignmentClick]: alignment:`,e),this.props.onChange({alignment:e})};renderDialog=()=>{let{alt:e}=this.props,t=document.createElement(`div`),n=(0,I.jsx)(QJ,{alt:e,onDone:this.onAltTextDone});gd.render(n,t),document.body.appendChild(t)};render(){let{alignment:e,imageLoaded:t,disableImageAlignmentButtons:n}=this.props;return(0,I.jsxs)(rY,{children:[!n&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(aY,{alignment:`left`,active:e===`left`,onClick:this.onAlignmentClick}),(0,I.jsx)(aY,{alignment:`center`,active:e===`center`,onClick:this.onAlignmentClick}),(0,I.jsx)(aY,{alignment:`right`,active:e===`right`,onClick:this.onAlignmentClick})]}),(0,I.jsx)(iY,{disabled:!t,hasAlignmentButtons:!n,onMouseDown:e=>t&&this.renderDialog(e),children:`Alt text`})]})}};Cm(`@pie-lib:editable-html:plugins:image:component`);var sY=z(gJ,{shouldForwardProp:e=>e!==`hideProgress`})(({hideProgress:e})=>({position:`absolute`,left:`0`,width:`fit-content`,top:`0%`,transition:`opacity 200ms linear`,...e&&{opacity:0}})),cY=z(`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}})),lY=z(`div`)(({theme:e})=>({position:`relative`,width:`fit-content`,display:`flex`,alignItems:`center`,"&&:hover > .resize":{display:`block`}})),uY=z(`img`,{shouldForwardProp:e=>e!==`active`})(({theme:e,active:t})=>({border:t?`solid 1px ${e.palette.primary.main}`:`solid 1px transparent`})),dY=z(`div`)(({theme:e})=>({backgroundColor:e.palette.primary.main,cursor:`col-resize`,height:`35px`,width:`5px`,borderRadius:8,marginLeft:`5px`,marginRight:`10px`,display:`none`})),fY=e=>e?`${e}px`:`calc(20px)`;function pY(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,F.useMemo)(()=>f+t.nodeSize===p,[f,p,t.nodeSize]),[h,g]=(0,F.useState)(!1),_=(0,F.useRef)(t),v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(null),x=(0,F.useCallback)(e=>{let t=e/v.current.naturalWidth*4;return parseInt(t.toFixed(0)*25,10)},[]),S=(0,F.useCallback)(()=>{let e=_J(n,_.current.attrs.nodeKey);return e?e[1]:null},[n]),C=(0,F.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,F.useCallback)(()=>{if(!t.attrs.width||!v.current||!v.current.naturalWidth)return;let e=x(t.attrs.width);t.attrs.resizePercent!==e&&C({resizePercent:e})},[t.attrs.width,t.attrs.resizePercent,x,C]);(0,F.useEffect)(()=>{_.current={...t,pos:d}},[t,d]),(0,F.useEffect)(()=>{o?m&&n.isEditable&&(!String(t.attrs?.src??``).trim()&&s.imageHandling?.insertImageRequested&&s.imageHandling.insertImageRequested(n,[t,d],e=>new bJ(n,[t,d],e)),g(o)):g(o)},[m,o,n.isEditable]),(0,F.useEffect)(()=>{w();let e=y?.current;return e&&n.isEditable&&e.addEventListener(`mousedown`,A,!1),()=>{e&&e.removeEventListener(`mousedown`,A,!1)}},[]),(0,F.useEffect)(()=>{w()});let T=(0,F.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};lc(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,F.useCallback)(e=>{let t=v.current;if(!t)return;let n=e.target.getBoundingClientRect(),r={width:t.naturalWidth,height:t.naturalHeight},i=E(r,{width:e.clientX-n.left,height:e.clientY-n.top});i.width>50&&i.height>50&&i.width<=700&&i.height<=900&&(t.style.width=`${i.width}px`,t.style.height=`${i.height}px`,C({width:i.width,height:i.height}))},[n,C]),O=(0,F.useCallback)(e=>{C(e)},[n,C]),k=(0,F.useCallback)(()=>{window.removeEventListener(`mousemove`,D),window.removeEventListener(`mouseup`,k)},[D]),A=(0,F.useCallback)(()=>{window.addEventListener(`mousemove`,D),window.addEventListener(`mouseup`,k)},[D,k]),j={width:fY(t.attrs.width),height:fY(t.attrs.height),objectFit:`contain`},M={left:`flex-start`,center:`center`,right:`flex-end`}[t.attrs.alignment]||`flex-start`;return(0,I.jsxs)(zA,{children:[(0,I.jsxs)(cY,{onFocus:i,loading:!t.attrs.loaded,pendingDelete:t.attrs.deleteStatus===`pending`,style:{justifyContent:M},children:[(0,I.jsx)(sY,{mode:`determinate`,value:t.attrs.percent||0,hideProgress:t.attrs.loaded}),(0,I.jsxs)(lY,{onDragStart:e=>e.preventDefault(),children:[(0,I.jsx)(uY,{...r,active:o&&t.attrs.loaded,draggable:!1,ref:v,src:t.attrs.src,style:j,onLoad:T,alt:t.attrs.alt}),(0,I.jsx)(dY,{ref:y,className:`resize`,style:{display:n.isEditable?void 0:`none`}})]})]}),h&&n._tiptapContainerEl&&gd.createPortal((0,I.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,I.jsx)(QR,{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,I.jsx)(oY,{disableImageAlignmentButtons:s.imageHandling?.disableImageAlignmentButtons,alt:t.attrs.alt,imageLoaded:t.attrs.loaded,alignment:t.attrs.alignment||`left`,onChange:O})})}),n._tiptapContainerEl)]})}pY.propTypes={node:P.object.isRequired,editor:P.object.isRequired,attributes:P.object,onFocus:P.func,maxImageWidth:P.number,maxImageHeight:P.number};var mY=yk.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`,XE(e,{"data-type":`image-upload-node`})]},addNodeView(){return $A(e=>(0,I.jsx)(pY,{...e,options:this.options}))},addCommands(){return{setImageUploadNode:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{nodeKey:vJ()}})}},addProseMirrorPlugins(){let e=this.editor,t=this.options;return[new eb({props:{handlePaste(n,r){let i=Array.from(r.clipboardData?.items||[]).find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!i)return!1;let a=i.getAsFile();if(!a)return!1;let o=t?.imageHandling?.insertImageRequested,s=vJ(),c=new FileReader;return c.onload=()=>{let t=c.result;if(typeof t!=`string`||(e.commands.insertContent({type:`imageUploadNode`,attrs:{src:t,loaded:!o,nodeKey:s}}),!o))return;let n=_J(e,s);n&&o(e,n,t=>{let r;return r=new bJ(e,n,e=>{e||r?.updateNode({loaded:!0}),t(e)},!0),r.fileChosen(a),r})},c.readAsDataURL(a),!0}}})]}});function hY(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function gY(e,t,n,r={},i=()=>{}){let{ease:a=hY,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)}var _Y={width:99,height:99,position:`absolute`,top:-9999,overflow:`scroll`};function vY(e){let{onChange:t,...n}=e,r=F.useRef(),i=F.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return np(()=>{let e=Xu(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=ed(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),F.useEffect(()=>{a(),t(r.current)},[t]),(0,I.jsx)(`div`,{style:_Y,...n,ref:i})}var yY=ep((0,I.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),bY=ep((0,I.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function xY(e){return aa(`MuiTabScrollButton`,e)}var SY=oa(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]),CY=e=>{let{classes:t,orientation:n,disabled:r}=e;return Oo({root:[`root`,n,r&&`disabled`]},xY,t)},wY=z(ih,{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,[`&.${SY.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),TY=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,u=Ka(),d={isRtl:u,...n},f=CY(d),p=i.StartScrollButtonIcon??yY,m=i.EndScrollButtonIcon??bY,h=kg({elementType:p,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d}),g=kg({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d});return(0,I.jsx)(wY,{component:`div`,className:L(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,I.jsx)(p,{...h}):(0,I.jsx)(m,{...g})})});function EY(e){return aa(`MuiTabs`,e)}var DY=oa(`MuiTabs`,[`root`,`vertical`,`list`,`flexContainer`,`flexContainerVertical`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]),OY=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,kY=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,AY=(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}}},jY=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return Oo({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`]},EY,c)},MY=z(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${DY.scrollButtons}`]:t.scrollButtons},{[`& .${DY.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(vf(({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:{[`& .${DY.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),NY=z(`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`}}]}),PY=z(`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`}}]}),FY=z(`span`,{name:`MuiTabs`,slot:`Indicator`})(vf(({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}}]}))),IY=z(vY)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),LY={},RY=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiTabs`}),r=Vs(),i=Ka(),{"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`,ee=k?`clientHeight`:`clientWidth`,N=k?`height`:`width`,te={...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},ne=jY(te),re=kg({elementType:y.StartScrollButtonIcon,externalSlotProps:b.startScrollButtonIcon,ownerState:te}),ie=kg({elementType:y.EndScrollButtonIcon,externalSlotProps:b.endScrollButtonIcon,ownerState:te}),[ae,oe]=F.useState(!1),[se,ce]=F.useState(LY),[le,ue]=F.useState(!1),[de,fe]=F.useState(!1),[pe,me]=F.useState(!1),[he,ge]=F.useState({overflow:`hidden`,scrollbarWidth:0}),_e=new Map,ve=F.useRef(null),ye=F.useRef(null),be={slots:y,slotProps:{indicator:x,scrollButtons:S,...b}},xe=()=>{let e=ve.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=ye.current.children;if(e.length>0){let t=e[_e.get(w)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},Se=op(()=>{let{tabsMeta:e,tabMeta:t}=xe(),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,[N]:t?t[N]:0};if(typeof se[r]!=`number`||typeof se[N]!=`number`)ce(a);else{let e=Math.abs(se[r]-a[r]),t=Math.abs(se[N]-a[N]);(e>=1||t>=1)&&ce(a)}}),Ce=(e,{animation:t=!0}={})=>{t?gY(A,ve.current,e,{duration:r.transitions.duration.standard}):ve.current[A]=e},we=e=>{let t=ve.current[A];k?t+=e:t+=e*(i?-1:1),Ce(t)},Te=()=>{let e=ve.current[ee],t=0,n=Array.from(ye.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[ee]>e){r===0&&(t=e);break}t+=i[ee]}return t},Ee=()=>{we(-1*Te())},De=()=>{we(Te())},[Oe,{onChange:ke,...Ae}]=wf(`scrollbar`,{className:L(ne.scrollableX,ne.hideScrollbar),elementType:IY,shouldForwardComponentProp:!0,externalForwardedProps:be,ownerState:te}),je=F.useCallback(e=>{ke?.(e),ge({overflow:null,scrollbarWidth:e})},[ke]),[Me,Ne]=wf(`scrollButtons`,{className:L(ne.scrollButtons,S.className),elementType:TY,externalForwardedProps:be,ownerState:te,additionalProps:{orientation:h,slots:{StartScrollButtonIcon:y.startScrollButtonIcon||y.StartScrollButtonIcon,EndScrollButtonIcon:y.endScrollButtonIcon||y.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:re,endScrollButtonIcon:ie}}}),Pe=()=>{let e={};e.scrollbarSizeListener=O?(0,I.jsx)(Oe,{...Ae,onChange:je}):null;let t=O&&(_===`auto`&&(le||de)||_===!0);return e.scrollButtonStart=t?(0,I.jsx)(Me,{direction:i?`right`:`left`,onClick:Ee,disabled:!le,...Ne}):null,e.scrollButtonEnd=t?(0,I.jsx)(Me,{direction:i?`left`:`right`,onClick:De,disabled:!de,...Ne}):null,e},Fe=op(e=>{let{tabsMeta:t,tabMeta:n}=xe();if(!(!n||!t)){if(n[j]<t[j]){let r=t[A]+(n[j]-t[j]);Ce(r,{animation:e})}else if(n[M]>t[M]){let r=t[A]+(n[M]-t[M]);Ce(r,{animation:e})}}}),Ie=op(()=>{O&&_!==!1&&me(!pe)});F.useEffect(()=>{let e=Xu(()=>{ve.current&&Se()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Ie()},r=ed(ve.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(ye.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(ye.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[Se,Ie]),F.useEffect(()=>{let e=Array.from(ye.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&O&&_!==!1){let n=e[0],r=e[t-1],i={root:ve.current,threshold:.99},a=new IntersectionObserver(e=>{ue(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{fe(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[O,_,pe,l?.length]),F.useEffect(()=>{oe(!0)},[]),F.useEffect(()=>{Se()}),F.useEffect(()=>{Fe(LY!==se)},[Fe,se]),F.useImperativeHandle(s,()=>({updateIndicator:Se,updateScrollButtons:Ie}),[Se,Ie]);let[Le,Re]=wf(`indicator`,{className:L(ne.indicator,x.className),elementType:FY,externalForwardedProps:be,ownerState:te,additionalProps:{style:se}}),ze=(0,I.jsx)(Le,{...Re}),Be=0,Ve=F.Children.map(l,e=>{if(!F.isValidElement(e))return null;let t=e.props.value===void 0?Be:e.props.value;_e.set(t,Be);let n=t===w;return Be+=1,F.cloneElement(e,{fullWidth:T===`fullWidth`,indicator:n&&!ae&&ze,selected:n,selectionFollowsFocus:v,onChange:m,textColor:C,value:t,...Be===1&&w===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),He=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;let t=ye.current,n=af(Qu(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(),AY(t,n,kY);break;case a:e.preventDefault(),AY(t,n,OY);break;case`Home`:e.preventDefault(),AY(t,null,OY);break;case`End`:e.preventDefault(),AY(t,null,kY);break;default:break}},Ue=Pe(),[We,Ge]=wf(`root`,{ref:t,className:L(ne.root,u),elementType:MY,externalForwardedProps:{...be,...D,component:d},ownerState:te}),[Ke,qe]=wf(`scroller`,{ref:ve,className:ne.scroller,elementType:NY,externalForwardedProps:be,ownerState:te,additionalProps:{style:{overflow:he.overflow,[k?`margin${i?`Left`:`Right`}`:`marginBottom`]:E?void 0:-he.scrollbarWidth}}}),[Je,Ye]=wf(`list`,{ref:ye,className:L(ne.list,ne.flexContainer),elementType:PY,externalForwardedProps:be,ownerState:te,getSlotProps:e=>({...e,onKeyDown:t=>{He(t),e.onKeyDown?.(t)}})});return(0,I.jsxs)(We,{...Ge,children:[Ue.scrollButtonStart,Ue.scrollbarSizeListener,(0,I.jsxs)(Ke,{...qe,children:[(0,I.jsx)(Je,{"aria-label":a,"aria-labelledby":o,"aria-orientation":h===`vertical`?`vertical`:null,role:`tablist`,...Ye,children:Ve}),ae&&ze]}),Ue.scrollButtonEnd]})});function zY(e){return aa(`MuiTab`,e)}var BY=oa(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`iconWrapper`,`icon`]),VY=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:s,disabled:c}=e;return Oo({root:[`root`,a&&o&&`labelIcon`,`textColor${V(n)}`,r&&`fullWidth`,i&&`wrapped`,s&&`selected`,c&&`disabled`],icon:[`iconWrapper`,`icon`]},zY,t)},HY=z(ih,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${V(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${BY.iconWrapper}`]:t.iconWrapper},{[`& .${BY.icon}`]:t.icon}]}})(vf(({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:{[`& > .${BY.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${BY.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${BY.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${BY.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${BY.selected}`]:{opacity:1},[`&.${BY.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${BY.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${BY.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${BY.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${BY.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)}}]}))),UY=F.forwardRef(function(e,t){let n=Ju({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=VY(b),S=s&&u&&F.isValidElement(s)?F.cloneElement(s,{className:L(x.icon,s.props.className)}):s;return(0,I.jsxs)(HY,{focusRipple:!a,className:L(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,I.jsxs)(F.Fragment,{children:[S,u]}):(0,I.jsxs)(F.Fragment,{children:[u,S]}),l]})}),WY=e=>{let{classes:t}=e;return Oo({root:[`root`]},SJ,t)},GY=z(JG,{name:`MuiDialogTitle`,slot:`Root`})({padding:`16px 24px`,flex:`0 0 auto`}),KY=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiDialogTitle`}),{className:r,id:i,...a}=n,o=n,s=WY(o),{titleId:c=i}=F.useContext(GJ);return(0,I.jsx)(GY,{component:`h2`,className:L(s.root,r),ownerState:o,ref:t,variant:`h6`,id:i??c,...a})});function qY(e){return aa(`MuiDialogContentText`,e)}oa(`MuiDialogContentText`,[`root`]);var JY=e=>{let{classes:t}=e,n=Oo({root:[`root`]},qY,t);return{...t,...n}},YY=z(JG,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiDialogContentText`,slot:`Root`})({}),XY=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiDialogContentText`}),{children:r,className:i,...a}=n,o=JY(a);return(0,I.jsx)(YY,{component:`p`,variant:`body1`,color:`textSecondary`,ref:t,ownerState:a,className:L(o.root,i),...n,classes:o})}),ZY=Cm(`@pie-lib:editable-html:plugins:media:dialog`),QY=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},$Y=e=>e&&/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/.test(e),eX=e=>e&&/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/.test(e),tX=e=>{if(!e)return!1;let t=/^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;return e.match(t)&&e.match(t)[2]},nX=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(``),ZY(e)})}catch{t(``)}}),rX={video:`Video`,audio:`Audio`},iX={uploadFile:`upload-file`,insertUrl:`insert-url`},aX=z(ZJ)(({theme:e})=>({"& .MuiDialog-paper":{minWidth:`500px`}})),oX=z(EJ)(({theme:e})=>({padding:0})),sX=z(`div`)(({theme:e})=>({display:`flex`,flexDirection:`space-between`})),cX=z(`div`)(({theme:e})=>({marginTop:e.spacing(1.5)})),lX=z(`input`)(({theme:e})=>({})),uX=z(JG)(({theme:e})=>({marginTop:e.spacing(1.5),color:e.palette.error.main})),dX=z(HR)(({theme:e})=>({marginLeft:e.spacing(1.5)})),fX=class extends F.Component{static propTypes={open:P.bool,edit:P.bool,disablePortal:P.bool,handleClose:P.func,uploadSoundSupport:P.shape({add:P.func,delete:P.func}),type:P.string,src:P.string,url:P.string,urlToUse:P.string,starts:P.number,ends:P.number,height:P.number,width:P.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?iX.uploadFile:iX.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=QY(e),a=$Y(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=>{tX(e)&&nX(e).then(t=>{this.handleStateChange({urlToUse:t,invalid:!t,url:e})}).catch(ZY)};checkVideo=e=>{if(QY(e)){let t=`https://youtube.com/embed/${e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)[2]}`;ZY(`is youtube`),this.handleStateChange({urlToUse:t,url:e,invalid:!1})}if($Y(e)){let t=`https://player.vimeo.com/video/${e.replace(/.*vimeo.com\/(.*)/g,`$1`)}`;ZY(`is vimeo`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}if(eX(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`;ZY(`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===iX.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(ZY(`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=QY(u),_=m===iX.insertUrl,v=m===iX.uploadFile,y=_?s||u==null:!h.url||h.scheduled,b=i?.add&&i?.delete&&n!==`video`;return(0,I.jsxs)(aX,{disablePortal:t,open:e,onClose:()=>this.handleDone(!1),"aria-labelledby":`form-dialog-title`,children:[(0,I.jsxs)(KY,{id:`form-dialog-title`,children:[`Insert `,rX[n]]}),(0,I.jsx)(EJ,{children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(sX,{children:(0,I.jsxs)(RY,{indicatorColor:`primary`,value:m,onChange:(e,t)=>{this.setState({tabValue:t})},children:[b?(0,I.jsx)(UY,{value:iX.uploadFile,label:`Upload file`}):null,(0,I.jsx)(UY,{value:iX.insertUrl,label:n===`video`?`Insert YouTube, Vimeo, or Google Drive URL`:`Insert SoundCloud URL`})]})}),_&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(RJ,{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,I.jsxs)(oX,{children:[(0,I.jsx)(XY,{children:`Video Properties`}),(0,I.jsx)(RJ,{autoFocus:!0,margin:`dense`,id:`width`,label:`Width`,type:`number`,placeholder:`Width`,value:l,onChange:this.changeHandler(`width`)}),(0,I.jsx)(RJ,{autoFocus:!0,margin:`dense`,id:`height`,label:`Height`,type:`number`,placeholder:`Height`,value:o,onChange:this.changeHandler(`height`)})]}),f&&(0,I.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,I.jsx)(F.Fragment,{children:(0,I.jsxs)(oX,{children:[(0,I.jsx)(RJ,{autoFocus:!0,margin:`dense`,id:`starts`,label:`Starts`,type:`number`,placeholder:`Starts`,value:c,onChange:this.changeHandler(`starts`)}),g&&(0,I.jsx)(RJ,{autoFocus:!0,margin:`dense`,id:`ends`,label:`Ends`,type:`number`,placeholder:`Ends`,value:a,onChange:this.changeHandler(`ends`)})]})})]}),v&&(0,I.jsx)(cX,{children:(0,I.jsxs)(`div`,{children:[h.url?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(sX,{children:[(0,I.jsx)(`audio`,{controls:`controls`,controlsList:`nodownload`,children:(0,I.jsx)(`source`,{type:d,src:h.url})}),(0,I.jsx)(dX,{"aria-label":`delete`,onClick:this.handleRemoveFile,children:(0,I.jsx)(UR,{})})]}),!h.scheduled&&h.loading?(0,I.jsx)(JG,{variant:`subheading`,children:`Loading...`}):null,h.scheduled?(0,I.jsx)(JG,{variant:`subheading`,children:`Waiting for Upload to finish, then inserting item...`}):null]}):h.loading?null:(0,I.jsx)(lX,{accept:`audio/*`,onChange:this.handleUploadFile,type:`file`}),!!h.error&&(0,I.jsx)(uX,{variant:`caption`,children:h.error})]})})]})}),(0,I.jsxs)(HJ,{children:[(0,I.jsx)(Mh,{onClick:()=>this.handleDone(!1),color:`primary`,children:`Cancel`}),(0,I.jsx)(Mh,{disabled:y,onClick:()=>this.handleDone(!0),color:`primary`,children:r?`Update`:`Insert`})]})]})}},pX=z(`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)`})),mX=z(`span`)(({theme:e})=>({cursor:`pointer`,flex:3,border:`solid ${e.palette.common.black}`,textAlign:`right`,borderWidth:`0 2px 0 0`,marginRight:`5px`,paddingRight:`5px`})),hX=z(`span`)({cursor:`pointer`}),gX=class extends F.Component{static propTypes={onEdit:P.func,hideEdit:P.bool,onRemove:P.func};render(){let{hideEdit:e,onEdit:t,onRemove:n}=this.props;return(0,I.jsxs)(pX,{children:[e?null:(0,I.jsx)(mX,{onClick:t,children:`Edit Settings`}),(0,I.jsx)(hX,{onClick:n,children:`Remove`})]})}},_X=yk.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`,XE({"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 $A(e=>(0,I.jsx)(bX,{...e,options:this.options}))}}),vX=()=>{document.querySelectorAll(`.insert-media-dialog`).forEach(e=>e.remove())},yX=e=>{let t=document.createElement(`div`),{type:n,callback:r,options:i,...a}=e,o=document.body.style.overflow;vX(),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,I.jsx)(fX,{...a,uploadSoundSupport:i.uploadSoundSupport,type:n,disablePortal:!0,open:!0,handleClose:s});gd.render(c,t),document.body.appendChild(t)};function bX({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,F.useEffect)(()=>{o||yX({...t.attrs,options:i,edit:!0,callback:(t,i)=>{t?n(i):r(),e.chain().focus().run()}})},[]),(0,I.jsxs)(zA,{"data-type":a,style:{width:s,height:c},children:[l===`audio`?(0,I.jsx)(`audio`,{controls:!0,controlsList:`nodownload`,children:(0,I.jsx)(`source`,{type:`audio/mp3`,src:o})}):(0,I.jsx)(`iframe`,{src:o,allowFullScreen:!0,frameBorder:`0`,width:s,height:c}),(0,I.jsx)(gX,{onEdit:()=>{yX({...t.attrs,options:i,edit:!0,callback:(t,r)=>{t&&n(r),e.chain().focus().run()}})},onRemove:r})]})}function xX(e){return aa(`MuiListItem`,e)}oa(`MuiListItem`,[`root`,`container`,`dense`,`alignItemsFlexStart`,`divider`,`gutters`,`padding`,`secondaryAction`]);var SX=oa(`MuiListItemButton`,[`root`,`focusVisible`,`dense`,`alignItemsFlexStart`,`disabled`,`divider`,`gutters`,`selected`]);function CX(e){return aa(`MuiListItemSecondaryAction`,e)}oa(`MuiListItemSecondaryAction`,[`root`,`disableGutters`]);var wX=e=>{let{disableGutters:t,classes:n}=e;return Oo({root:[`root`,t&&`disableGutters`]},CX,n)},TX=z(`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}}]}),EX=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiListItemSecondaryAction`}),{className:r,...i}=n,a=F.useContext(Ag),o={...n,disableGutters:a.disableGutters},s=wX(o);return(0,I.jsx)(TX,{className:L(s.root,r),ownerState:o,ref:t,...i})});EX.muiName=`ListItemSecondaryAction`;var DX=(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]},OX=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:a,divider:o,hasSecondaryAction:s}=e;return Oo({root:[`root`,r&&`dense`,!i&&`gutters`,!a&&`padding`,o&&`divider`,t===`flex-start`&&`alignItemsFlexStart`,s&&`secondaryAction`],container:[`container`],secondaryAction:[`secondaryAction`]},xX,n)},kX=z(`div`,{name:`MuiListItem`,slot:`Root`,overridesResolver:DX})(vf(({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:{[`& > .${SX.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}}]}))),AX=z(`li`,{name:`MuiListItem`,slot:`Container`})({position:`relative`}),jX=F.forwardRef(function(e,t){let n=Ju({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=F.useContext(Ag),x=F.useMemo(()=>({dense:f||b.dense||!1,alignItems:r,disableGutters:p}),[r,b.dense,f,p]),S=F.useRef(null),C=F.Children.toArray(i),w=C.length&&tp(C[C.length-1],[`ListItemSecondaryAction`]),T={...n,alignItems:r,dense:x.dense,disableGutters:p,disablePadding:m,divider:h,hasSecondaryAction:w},E=OX(T),D=Vd(S,t),[O,k]=wf(`secondaryAction`,{elementType:EX,externalForwardedProps:{slots:v,slotProps:_},ownerState:T,className:E.secondaryAction}),A=v.root||s.Root||kX,j=_.root||c.root||{},M={className:L(E.root,j.className,a),...y},ee=o||`li`;return w?(ee=!M.component&&!o?`div`:ee,l===`li`&&(ee===`li`?ee=`div`:M.component===`li`&&(M.component=`div`)),(0,I.jsx)(Ag.Provider,{value:x,children:(0,I.jsxs)(AX,{as:l,className:L(E.container,u),ref:D,ownerState:T,...d,children:[(0,I.jsx)(A,{...j,...!Wu(A)&&{as:ee,ownerState:{...T,...j.ownerState}},...M,children:C}),C.pop()]})})):(0,I.jsx)(Ag.Provider,{value:x,children:(0,I.jsxs)(A,{...j,as:ee,ref:D,...!Wu(A)&&{ownerState:{...T,...j.ownerState}},...M,children:[C,g&&(0,I.jsx)(O,{...k,children:g})]})})}),MX=()=>{document.querySelectorAll(`.insert-css-dialog`).forEach(e=>e.remove())},NX=({editor:e,callback:t,opts:n,selectedText:r,parentNode:i})=>{let a=e.options.element,o=document.createElement(`div`),{selection:s}=e.state;MX(),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,I.jsxs)(`div`,{style:{background:`white`,height:500,padding:20,overflow:`hidden`,display:`flex`,flexFlow:`column`},children:[(0,I.jsx)(`h2`,{children:`Please choose a css class`}),f&&(0,I.jsxs)(`div`,{children:[`The current parent has this class `,f]}),(0,I.jsx)(Pg,{component:`nav`,style:{overflow:`scroll`},children:n.names.map((e,t)=>(0,I.jsxs)(jX,{button:!0,onClick:()=>d(e),children:[(0,I.jsx)(`div`,{style:{marginRight:20},children:e}),(0,I.jsx)(`div`,{dangerouslySetInnerHTML:{__html:p(e)}})]},`rule-${t}`))})]});gd.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)}})},PX=HO.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`)||``;if(!t)return!1;if((this.options&&this.options.classes||[]).length>0){let e=this.options.classes.find(e=>t.includes(e));return e?{class:e}:!1}return{class:t}}}]},renderHTML({HTMLAttributes:e}){return[`span`,XE(e),0]},addCommands(){return{setCSSClass:e=>({commands:t})=>t.setMark(this.name,{class:e}),unsetCSSClass:()=>({commands:e})=>e.unsetMark(this.name),openCSSClassDialog:()=>({editor:e})=>{NX({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()}})}}}}),FX=jP.extend({content:`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`}),IX=yk.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`,XE(e),0]},addCommands(){return{toggleHeadingParagraph:()=>({commands:e,editor:t})=>t.isActive(`headingParagraph`)?e.setNode(`paragraph`):e.setNode(`headingParagraph`,{"data-heading":`heading1`})}}}),LX=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`},RX=ep((0,I.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`),zX=ep((0,I.jsx)(`path`,{d:`M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z`}),`FormatItalic`),BX=ep((0,I.jsx)(`path`,{d:`M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z`}),`FormatStrikethrough`),VX=ep((0,I.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`),HX=ep((0,I.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`),UX=ep((0,I.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`),WX=ep((0,I.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`),GX=ep((0,I.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`),KX=ep((0,I.jsx)(`path`,{d:`M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z`}),`Functions`),qX=ep((0,I.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`),JX=ep((0,I.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`),YX=ep((0,I.jsx)(`path`,{d:`M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z`}),`FormatQuote`),XX=ep((0,I.jsx)(`path`,{d:`M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3zM8 17H6v-2h2zm0-4H6v-2h2zm0-4H6V7h2zm10 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V7h2z`}),`Theaters`),ZX=ep((0,I.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`),QX=ep((0,I.jsx)(`path`,{d:`M3 3v18h18V3zm8 16H5v-6h6zm0-8H5V5h6zm8 8h-6v-6h6zm0-8h-6V5h6z`}),`BorderAll`),$X=z(`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`})),eZ=()=>(0,I.jsx)($X,{children:`+ Response Area`}),tZ={characters:[[`á`,`é`,`í`,`ó`,`ú`],[`Á`,`É`,`Í`,`Ó`,`Ú`],[`—`,`«`,`»`,`ñ`,`ü`],[`-`,`¿`,`¡`,`Ñ`,`Ü`]]},nZ={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:`—`}]]},rZ=()=>(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,I.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`})}),iZ=()=>(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,I.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`})}),aZ=()=>(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,I.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`})}),oZ=()=>(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,I.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`})}),sZ=({editor:e,onChange:t})=>{let[n,r]=(0,F.useState)(!1),i;switch(!0){case e.isActive({textAlign:`right`}):i=(0,I.jsx)(iZ,{});break;case e.isActive({textAlign:`center`}):i=(0,I.jsx)(aZ,{});break;case e.isActive({textAlign:`justify`}):i=(0,I.jsx)(oZ,{});break;default:i=(0,I.jsx)(rZ,{});break}let a=t=>{let n=t.currentTarget?.getAttribute(`value`);n&&e.commands.setTextAlign(n),r(!1)};return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},onClick:e=>{e.preventDefault(),e.stopPropagation(),r(!n)},children:[i,(0,I.jsx)(`span`,{style:{marginLeft:`5px`,fontSize:`8px`},"aria-hidden":`true`,children:`▼`})]}),(0,I.jsx)(Lm,{in:n,timeout:`auto`,unmountOnExit:!0,style:{position:`absolute`},children:(0,I.jsxs)(Pg,{component:`div`,disablePadding:!0,style:{background:`#fff`,display:`flex`,flexDirection:`row`,padding:0},children:[(0,I.jsx)(jX,{button:!0,type:`submit`,value:`left`,"aria-label":`Align text left`,onClick:a,children:(0,I.jsx)(rZ,{})}),(0,I.jsx)(jX,{button:!0,type:`submit`,value:`center`,"aria-label":`Align text center`,onClick:a,children:(0,I.jsx)(aZ,{})}),(0,I.jsx)(jX,{button:!0,type:`submit`,value:`right`,"aria-label":`Align text right`,onClick:a,children:(0,I.jsx)(iZ,{})}),(0,I.jsx)(jX,{button:!0,type:`submit`,value:`justify`,"aria-label":`Justify text`,onClick:a,children:(0,I.jsx)(oZ,{})})]})})]})},cZ=z(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans, Arial, sans-serif`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,whiteSpace:`nowrap`})),lZ=()=>(0,I.jsx)(cZ,{children:`CSS`}),uZ=z(`path`)({fill:`grey`,"&:hover":{fill:`black`}}),dZ=e=>t=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,version:`1.1`,width:`24`,height:`24`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(e,{...t})}),fZ=dZ(e=>(0,I.jsx)(uZ,{...e,d:`M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z`})),pZ=dZ(e=>(0,I.jsx)(uZ,{...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`})),mZ=dZ(e=>(0,I.jsx)(uZ,{...e,d:`M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z`})),hZ=dZ(e=>(0,I.jsx)(uZ,{...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`})),gZ=dZ(e=>(0,I.jsx)(uZ,{...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`})),_Z=`bottom`,vZ=`right`,yZ=`left`,bZ=`auto`,xZ=[`top`,_Z,vZ,yZ],SZ=`start`,CZ=`clippingParents`,wZ=`viewport`,TZ=`popper`,EZ=`reference`,DZ=xZ.reduce(function(e,t){return e.concat([t+`-`+SZ,t+`-end`])},[]),OZ=[].concat(xZ,[bZ]).reduce(function(e,t){return e.concat([t,t+`-`+SZ,t+`-end`])},[]),kZ=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function AZ(e){return e?(e.nodeName||``).toLowerCase():null}function jZ(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function MZ(e){return e instanceof jZ(e).Element||e instanceof Element}function NZ(e){return e instanceof jZ(e).HTMLElement||e instanceof HTMLElement}function PZ(e){return typeof ShadowRoot>`u`?!1:e instanceof jZ(e).ShadowRoot||e instanceof ShadowRoot}function FZ(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];!NZ(i)||!AZ(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 IZ(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},{});!NZ(r)||!AZ(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var LZ={name:`applyStyles`,enabled:!0,phase:`write`,fn:FZ,effect:IZ,requires:[`computeStyles`]};function RZ(e){return e.split(`-`)[0]}var zZ=Math.max,BZ=Math.min,VZ=Math.round;function HZ(){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 UZ(){return!/^((?!chrome|android).)*safari/i.test(HZ())}function WZ(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&NZ(e)&&(i=e.offsetWidth>0&&VZ(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&VZ(r.height)/e.offsetHeight||1);var o=(MZ(e)?jZ(e):window).visualViewport,s=!UZ()&&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 GZ(e){var t=WZ(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 KZ(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&PZ(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function qZ(e){return jZ(e).getComputedStyle(e)}function JZ(e){return[`table`,`td`,`th`].indexOf(AZ(e))>=0}function YZ(e){return((MZ(e)?e.ownerDocument:e.document)||window.document).documentElement}function XZ(e){return AZ(e)===`html`?e:e.assignedSlot||e.parentNode||(PZ(e)?e.host:null)||YZ(e)}function ZZ(e){return!NZ(e)||qZ(e).position===`fixed`?null:e.offsetParent}function QZ(e){var t=/firefox/i.test(HZ());if(/Trident/i.test(HZ())&&NZ(e)&&qZ(e).position===`fixed`)return null;var n=XZ(e);for(PZ(n)&&(n=n.host);NZ(n)&&[`html`,`body`].indexOf(AZ(n))<0;){var r=qZ(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 $Z(e){for(var t=jZ(e),n=ZZ(e);n&&JZ(n)&&qZ(n).position===`static`;)n=ZZ(n);return n&&(AZ(n)===`html`||AZ(n)===`body`&&qZ(n).position===`static`)?t:n||QZ(e)||t}function eQ(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function tQ(e,t,n){return zZ(e,BZ(t,n))}function nQ(e,t,n){var r=tQ(e,t,n);return r>n?n:r}function rQ(){return{top:0,right:0,bottom:0,left:0}}function iQ(e){return Object.assign({},rQ(),e)}function aQ(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var oQ=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,iQ(typeof e==`number`?aQ(e,xZ):e)};function sQ(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=RZ(n.placement),c=eQ(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=oQ(i.padding,n),d=GZ(a),f=c===`y`?`top`:yZ,p=c===`y`?_Z:vZ,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=$Z(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=tQ(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function cQ(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)||KZ(t.elements.popper,r)&&(t.elements.arrow=r))}var lQ={name:`arrow`,enabled:!0,phase:`main`,fn:sQ,effect:cQ,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function uQ(e){return e.split(`-`)[1]}var dQ={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function fQ(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:VZ(n*i)/i||0,y:VZ(r*i)/i||0}}function pQ(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=yZ,b=`top`,x=window;if(l){var S=$Z(n),C=`clientHeight`,w=`clientWidth`;if(S===jZ(n)&&(S=YZ(n),qZ(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=_Z;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=vZ;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&&dQ),O=u===!0?fQ({x:p,y:h},jZ(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 mQ(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:RZ(t.placement),variation:uQ(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,pQ(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,pQ(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 hQ={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:mQ,data:{}},gQ={passive:!0};function _Q(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=jZ(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,gQ)}),s&&c.addEventListener(`resize`,n.update,gQ),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,gQ)}),s&&c.removeEventListener(`resize`,n.update,gQ)}}var vQ={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:_Q,data:{}},yQ={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bQ(e){return e.replace(/left|right|bottom|top/g,function(e){return yQ[e]})}var xQ={start:`end`,end:`start`};function SQ(e){return e.replace(/start|end/g,function(e){return xQ[e]})}function CQ(e){var t=jZ(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function wQ(e){return WZ(YZ(e)).left+CQ(e).scrollLeft}function TQ(e,t){var n=jZ(e),r=YZ(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=UZ();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+wQ(e),y:c}}function EQ(e){var t=YZ(e),n=CQ(e),r=e.ownerDocument?.body,i=zZ(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=zZ(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+wQ(e),s=-n.scrollTop;return qZ(r||t).direction===`rtl`&&(o+=zZ(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function DQ(e){var t=qZ(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function OQ(e){return[`html`,`body`,`#document`].indexOf(AZ(e))>=0?e.ownerDocument.body:NZ(e)&&DQ(e)?e:OQ(XZ(e))}function kQ(e,t){t===void 0&&(t=[]);var n=OQ(e),r=n===e.ownerDocument?.body,i=jZ(n),a=r?[i].concat(i.visualViewport||[],DQ(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(kQ(XZ(a)))}function AQ(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function jQ(e,t){var n=WZ(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 MQ(e,t,n){return t===`viewport`?AQ(TQ(e,n)):MZ(t)?jQ(t,n):AQ(EQ(YZ(e)))}function NQ(e){var t=kQ(XZ(e)),n=[`absolute`,`fixed`].indexOf(qZ(e).position)>=0&&NZ(e)?$Z(e):e;return MZ(n)?t.filter(function(e){return MZ(e)&&KZ(e,n)&&AZ(e)!==`body`}):[]}function PQ(e,t,n,r){var i=t===`clippingParents`?NQ(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=MQ(e,n,r);return t.top=zZ(i.top,t.top),t.right=BZ(i.right,t.right),t.bottom=BZ(i.bottom,t.bottom),t.left=zZ(i.left,t.left),t},MQ(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 FQ(e){var t=e.reference,n=e.element,r=e.placement,i=r?RZ(r):null,a=r?uQ(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 _Z:c={x:o,y:t.y+t.height};break;case vZ:c={x:t.x+t.width,y:s};break;case yZ:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?eQ(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case SZ: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 IQ(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?CZ:s,l=n.rootBoundary,u=l===void 0?wZ:l,d=n.elementContext,f=d===void 0?TZ:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=iQ(typeof g==`number`?aQ(g,xZ):g),v=f===`popper`?EZ:TZ,y=e.rects.popper,b=e.elements[m?v:f],x=PQ(MZ(b)?b:b.contextElement||YZ(e.elements.popper),c,u,o),S=WZ(e.elements.reference),C=FQ({reference:S,element:y,strategy:`absolute`,placement:i}),w=AQ(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 LQ(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?OZ:c,u=uQ(r),d=u?s?DZ:DZ.filter(function(e){return uQ(e)===u}):xZ,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]=IQ(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[RZ(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function RQ(e){if(RZ(e)===`auto`)return[];var t=bQ(e);return[SQ(e),t,SQ(t)]}function zQ(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||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=RZ(g)===g,v=c||(_||!m?[bQ(g)]:RQ(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(RZ(n)===`auto`?LQ(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=RZ(E),O=uQ(E)===SZ,k=[`top`,_Z].indexOf(D)>=0,A=k?`width`:`height`,j=IQ(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?vZ:yZ:O?_Z:`top`;b[A]>x[A]&&(M=bQ(M));var ee=bQ(M),N=[];if(a&&N.push(j[D]<=0),s&&N.push(j[M]<=0,j[ee]<=0),N.every(function(e){return e})){w=E,C=!1;break}S.set(E,N)}if(C)for(var te=m?3:1,ne=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`},re=te;re>0&&ne(re)!==`break`;re--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var BQ={name:`flip`,enabled:!0,phase:`main`,fn:zQ,requiresIfExists:[`offset`],data:{_skip:!1}};function VQ(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 HQ(e){return[`top`,vZ,_Z,yZ].some(function(t){return e[t]>=0})}function UQ(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=IQ(t,{elementContext:`reference`}),s=IQ(t,{altBoundary:!0}),c=VQ(o,r),l=VQ(s,i,a),u=HQ(c),d=HQ(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 WQ={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:UQ};function GQ(e,t,n){var r=RZ(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 KQ(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=OZ.reduce(function(e,n){return e[n]=GQ(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 qQ={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:KQ};function JQ(e){var t=e.state,n=e.name;t.modifiersData[n]=FQ({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var YQ={name:`popperOffsets`,enabled:!0,phase:`read`,fn:JQ,data:{}};function XQ(e){return e===`x`?`y`:`x`}function ZQ(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=IQ(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=RZ(t.placement),v=uQ(t.placement),y=!v,b=eQ(_),x=XQ(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`:yZ,A=b===`y`?_Z:vZ,j=b===`y`?`height`:`width`,M=S[b],ee=M+g[k],N=M-g[A],te=p?-w[j]/2:0,ne=v===`start`?C[j]:w[j],re=v===`start`?-w[j]:-C[j],ie=t.elements.arrow,ae=p&&ie?GZ(ie):{width:0,height:0},oe=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:rQ(),se=oe[k],ce=oe[A],le=tQ(0,C[j],ae[j]),ue=y?C[j]/2-te-le-se-E.mainAxis:ne-le-se-E.mainAxis,de=y?-C[j]/2+te+le+ce+E.mainAxis:re+le+ce+E.mainAxis,fe=t.elements.arrow&&$Z(t.elements.arrow),pe=fe?b===`y`?fe.clientTop||0:fe.clientLeft||0:0,me=D?.[b]??0,he=M+ue-me-pe,ge=M+de-me,_e=tQ(p?BZ(ee,he):ee,M,p?zZ(N,ge):N);S[b]=_e,O[b]=_e-M}if(s){var ve=b===`x`?`top`:yZ,ye=b===`x`?_Z:vZ,be=S[x],xe=x===`y`?`height`:`width`,Se=be+g[ve],Ce=be-g[ye],we=[`top`,yZ].indexOf(_)!==-1,Te=D?.[x]??0,Ee=we?Se:be-C[xe]-w[xe]-Te+E.altAxis,De=we?be+C[xe]+w[xe]-Te-E.altAxis:Ce,Oe=p&&we?nQ(Ee,be,De):tQ(p?Ee:Se,be,p?De:Ce);S[x]=Oe,O[x]=Oe-be}t.modifiersData[r]=O}}var QQ={name:`preventOverflow`,enabled:!0,phase:`main`,fn:ZQ,requiresIfExists:[`offset`]};function $Q(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function e$(e){return e===jZ(e)||!NZ(e)?CQ(e):$Q(e)}function t$(e){var t=e.getBoundingClientRect(),n=VZ(t.width)/e.offsetWidth||1,r=VZ(t.height)/e.offsetHeight||1;return n!==1||r!==1}function n$(e,t,n){n===void 0&&(n=!1);var r=NZ(t),i=NZ(t)&&t$(t),a=YZ(t),o=WZ(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((AZ(t)!==`body`||DQ(a))&&(s=e$(t)),NZ(t)?(c=WZ(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=wQ(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function r$(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 i$(e){var t=r$(e);return kZ.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function a$(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function o$(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 s$={placement:`bottom`,modifiers:[],strategy:`absolute`};function c$(){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 l$(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?s$:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},s$,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:MZ(e)?kQ(e):e.contextElement?kQ(e.contextElement):[],popper:kQ(t)};var s=i$(o$([].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(c$(t,n)){i.rects={reference:n$(t,$Z(n),i.options.strategy===`fixed`),popper:GZ(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:a$(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!c$(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 u$=l$({defaultModifiers:[vQ,YQ,hQ,LZ,qQ,BQ,QQ,lQ,WQ]});function d$(e){return aa(`MuiPopper`,e)}oa(`MuiPopper`,[`root`]);function f$(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 p$(e){return typeof e==`function`?e():e}function m$(e){return e.nodeType!==void 0}var h$=e=>{let{classes:t}=e;return Oo({root:[`root`]},d$,t)},g$={},_$=F.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=F.useRef(null),_=Bd(g,t),v=F.useRef(null),y=Bd(v,u),b=F.useRef(y);ba(()=>{b.current=y},[y]),F.useImperativeHandle(u,()=>v.current,[]);let x=f$(c,i),[S,C]=F.useState(x),[w,T]=F.useState(p$(n));F.useEffect(()=>{v.current&&v.current.forceUpdate()}),F.useEffect(()=>{n&&T(p$(n))},[n]),ba(()=>{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=u$(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=h$(e),O=f.root??`div`;return(0,I.jsx)(O,{...kg({elementType:O,externalSlotProps:d.root,externalForwardedProps:h,additionalProps:{role:`tooltip`,ref:_},ownerState:e,className:D.root}),children:typeof r==`function`?r(E):r})}),v$=z(F.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=g$,popperRef:f,style:p,transition:m=!1,slotProps:h={},slots:g={},..._}=e,[v,y]=F.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=p$(n);S=e&&m$(e)?Zu(e).body:Zu(null).body}let C=!l&&s&&(!m||v)?`none`:void 0,w=m?{in:l,onEnter:b,onExited:x}:void 0;return(0,I.jsx)(_f,{disablePortal:o,container:S,children:(0,I.jsx)(_$,{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})})}),{name:`MuiPopper`,slot:`Root`})({}),y$=z(F.forwardRef(function(e,t){let n=Ka(),{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}=Ju({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,I.jsx)(v$,{as:i,direction:n?`rtl`:`ltr`,slots:{root:y},slotProps:_??o,...b,ref:t})}))({background:`#fff`,padding:`10px`,pointerEvents:`none`,zIndex:99999}),b$=z(JG)({fontSize:50,textAlign:`center`}),x$=({children:e,...t})=>(0,I.jsx)(y$,{id:`mouse-over-popover`,open:!0,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableRestoreFocus:!0,disableAutoFocus:!0,...t,children:(0,I.jsx)(b$,{children:e})}),S$=({letter:e})=>(0,I.jsx)(`div`,{style:{fontSize:`24px`,lineHeight:`24px`},children:e});S$.propTypes={letter:P.string};function C$({editor:e,opts:t,onClose:n}){if(!t?.characters?.length)return null;let r=(0,F.useRef)(null),i=(0,F.useRef)(n),[a,o]=(0,F.useState)({top:0,left:0}),[s,c]=(0,F.useState)(null);i.current=n;let l=(0,F.useMemo)(()=>{if(!t)return tZ;switch(!0){case t.language===`spanish`:return tZ;case t.language===`special`:return nZ;default:return t}},[t]),u=(0,F.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,F.useEffect)(()=>()=>{d()},[]),(0,F.useEffect)(()=>{if(!e)return;let t=e.options.element,n=e.view.dom,a=()=>{if(!r.current)return;let n=t.getBoundingClientRect(),{from:i}=e.state.selection,a=e.view.coordsAtPos(i),s=r.current.offsetHeight,c=r.current.offsetWidth,l=window.innerHeight-(n.bottom+60)>=s||n.top<s+80?n.bottom+60:n.top-s-20,u=a.left;l=Math.max(8,Math.min(l,window.innerHeight-s-8)),u=Math.max(8,Math.min(u,window.innerWidth-c-8)),o({top:l,left:u})};a();let s=null,c=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,a()}))};window.addEventListener(`scroll`,c,!0),window.addEventListener(`resize`,c);let l=e=>{r.current&&!r.current.contains(e.target)&&!n.contains(e.target)&&i.current()},u=setTimeout(()=>{document.addEventListener(`click`,l)});return()=>{clearTimeout(u),s!==null&&cancelAnimationFrame(s),window.removeEventListener(`scroll`,c,!0),window.removeEventListener(`resize`,c),document.removeEventListener(`click`,l)}},[e]);let f=(e,t)=>c({anchorEl:e.currentTarget,el:t});return(0,I.jsxs)(I.Fragment,{children:[gd.createPortal((0,I.jsx)(`div`,{ref:r,className:`insert-character-dialog`,"data-toolbar-for":e.instanceId,style:{visibility:a.top===0&&a.left===0?`hidden`:`initial`,position:`fixed`,top:`${a.top}px`,left:`${a.left}px`,maxWidth:`500px`,zIndex:1e3},children:(0,I.jsx)(`div`,{children:(0,I.jsx)(Jq,{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:ac(e,`name`)||e,write:ac(e,`write`)||e,label:ac(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&&gd.createPortal((0,I.jsxs)(x$,{onClose:d,anchorEl:s.anchorEl,children:[(0,I.jsx)(`div`,{children:s.el.label}),(0,I.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.description}),(0,I.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.unicode})]}),document.body)]})}C$.propTypes={editor:P.object,opts:P.object,onClose:P.func.isRequired};var w$=()=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,I.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`})}),T$=()=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,I.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`})}),E$=()=>(0,I.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`},"aria-hidden":`true`,focusable:`false`,children:(0,I.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 D$({editor:e,classes:t,activePlugins:n,toolbarOpts:r,responseAreaProps:i,onChange:a,autoWidthToolbar:o}){let[s,c]=(0,F.useState)(!1),l=r??{},u=jA({editor:e,selector:e=>{let{selection:t}=e.editor?.state||{},n;if(!e.editor?.commandManager)return{};t instanceof Ry&&(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,toolbarOpened:e.editor?._toolbarOpened??!1,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=L(t.toolbar,WR,{[t.toolbarWithNoDone]:!0,[t.toolbarTop]:l.position===`top`,[t.toolbarRight]:l.alignment===`right`,[t.focused]:l.alwaysVisible||u.isFocused&&!u.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,F.useMemo)(()=>[{icon:(0,I.jsx)(HX,{}),label:`Insert table`,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,I.jsx)(fZ,{}),label:`Add table row`,onClick:e=>e.chain().focus().addRowAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(pZ,{}),label:`Remove table row`,onClick:e=>e.chain().focus().deleteRow().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(mZ,{}),label:`Add table column`,onClick:e=>e.chain().focus().addColumnAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(hZ,{}),label:`Remove table column`,onClick:e=>e.chain().focus().deleteColumn().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(gZ,{}),label:`Remove table`,onClick:e=>e.chain().focus().deleteTable().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(QX,{}),label:`Table borders`,toggle:!0,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,I.jsx)(RX,{}),label:`Bold`,toggle:!0,onClick:e=>e.chain().focus().toggleBold().run(),hidden:()=>!n?.includes(`bold`),isActive:e=>e.isBold,isDisabled:e=>!e.canBold},{icon:(0,I.jsx)(zX,{}),label:`Italic`,toggle:!0,onClick:e=>e.chain().focus().toggleItalic().run(),hidden:()=>!n?.includes(`italic`),isActive:e=>e.isItalic,isDisabled:e=>!e.canItalic},{icon:(0,I.jsx)(BX,{}),label:`Strikethrough`,toggle:!0,onClick:e=>e.chain().focus().toggleStrike().run(),hidden:()=>!n?.includes(`strikethrough`),isActive:e=>e.isStrike,isDisabled:e=>!e.canStrike},{icon:(0,I.jsx)(VX,{}),label:`Code`,toggle:!0,onClick:e=>e.chain().focus().toggleCode().run(),hidden:()=>!n?.includes(`code`),isActive:e=>e.isCode,isDisabled:e=>!e.canCode},{icon:(0,I.jsx)(GX,{}),label:`Underline`,toggle:!0,onClick:e=>e.chain().focus().toggleUnderline().run(),hidden:()=>!n?.includes(`underline`),isActive:e=>e.isUnderline},{icon:(0,I.jsx)(T$,{}),label:`Subscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSubscript().run(),hidden:()=>!n?.includes(`subscript`),isActive:e=>e.isSubScript},{icon:(0,I.jsx)(w$,{}),label:`Superscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSuperscript().run(),hidden:()=>!n?.includes(`superscript`),isActive:e=>e.isSuperScript},{icon:(0,I.jsx)(qX,{}),label:`Insert image`,hidden:()=>!n?.includes(`image`),onClick:e=>e.chain().focus().setImageUploadNode().run()},{icon:(0,I.jsx)(XX,{}),label:`Insert video`,hidden:()=>!n?.includes(`video`),onClick:e=>e.chain().focus().insertMedia({type:`video`}).run()},{icon:(0,I.jsx)(ZX,{}),label:`Insert audio`,hidden:()=>!n?.includes(`audio`),onClick:e=>e.chain().focus().insertMedia({type:`audio`,tag:`audio`}).run()},{icon:(0,I.jsx)(lZ,{}),label:`CSS classes`,hidden:()=>!n?.includes(`css`),onClick:e=>e.commands.openCSSClassDialog()},{icon:(0,I.jsx)(YX,{}),label:`Blockquote`,toggle:!0,hidden:()=>!n?.includes(`blockquote`),onClick:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isBlockquote},{icon:(0,I.jsx)(E$,{}),label:`Heading`,toggle:!0,hidden:()=>!n?.includes(`h3`),onClick:e=>e.chain().focus().toggleHeadingParagraph().run(),isActive:e=>e.isHeadingParagraph},{icon:(0,I.jsx)(KX,{}),label:`Insert math`,hidden:()=>!n?.includes(`math`),onClick:e=>e.chain().focus().insertMath(``).run()},{icon:(0,I.jsx)(S$,{letter:`ñ`}),label:`Spanish characters (ñ)`,hidden:()=>!n?.includes(`languageCharacters`),onClick:()=>c(tZ)},{icon:(0,I.jsx)(S$,{letter:`€`}),label:`Special characters (€)`,hidden:()=>n?.filter(e=>e===`languageCharacters`).length!==2,onClick:()=>c(nZ)},{icon:(0,I.jsx)(sZ,{editor:e}),label:`Text alignment`,hidden:()=>!n?.includes(`text-align`),onClick:()=>{}},{icon:(0,I.jsx)(UX,{}),label:`Bulleted list`,toggle:!0,hidden:()=>!n?.includes(`bulleted-list`),onClick:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isBulletList},{icon:(0,I.jsx)(WX,{}),label:`Numbered list`,toggle:!0,hidden:()=>!n?.includes(`numbered-list`),onClick:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isOrderedList},{icon:(0,I.jsx)(Ph,{}),label:`Undo`,hidden:()=>!n?.includes(`undo`),onClick:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.canUndo},{icon:(0,I.jsx)(JX,{}),label:`Redo`,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,I.jsxs)(`div`,{className:f,style:{...p},onMouseDown:m,children:[g&&(0,I.jsx)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:(0,I.jsx)(`div`,{className:t.buttonsContainer,children:(0,I.jsx)(`button`,{type:`button`,className:t.button,onClick:t=>{t.preventDefault(),e.chain().focus().deleteSelection().run(),a?.(e.getHTML())},"aria-label":`Delete response area`,title:`Delete response area`,children:(0,I.jsx)(UR,{})})})}),!u.hideDefaultToolbar&&(0,I.jsxs)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:[(0,I.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,I.jsx)(`button`,{type:`button`,disabled:i,"aria-label":n.label,title:n.label,"aria-pressed":n.toggle?!!a:void 0,onClick:t=>{t.preventDefault(),n.onClick(e)},className:L(t.button,{[t.active]:a}),children:n.icon},r)})}),n?.includes(`responseArea`)&&(0,I.jsx)(`button`,{type:`button`,"aria-label":`Insert response area`,title:`Insert response area`,onClick:()=>{e.chain().focus().insertResponseArea(i.type).run()},className:t.button,children:(0,I.jsx)(eZ,{})}),l.showDone&&(0,I.jsx)(JR,{onClick:()=>{a?.(e.getHTML()),e.commands.blur()}})]}),s&&(0,I.jsx)(C$,{editor:e,opts:{...s,renderPopOver:(e,t)=>console.log(`Show popover`,t),closePopOver:()=>console.log(`Close popover`)},onClose:()=>c(!1)})]})}var O$=e=>{Vs();let t={defaultToolbar:`defaultToolbar`,buttonsContainer:`buttonsContainer`,button:`toolbarButton`,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,I.jsx)(k$,{children:(0,I.jsx)(D$,{...e,classes:t})})},k$=z(`div`)(()=>({height:0,overflow:`visible`,"& .defaultToolbar":{display:`flex`,width:`100%`,justifyContent:`space-between`},"& .buttonsContainer":{alignItems:`center`,display:`flex`,width:`100%`},"& .toolbarButton":{color:`grey`,display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:Sp()},"&:focus":{outline:`2px solid ${um()}`}},"& .active":{color:Sp()},"& .disabled":{opacity:.7,cursor:`not-allowed`,"& :hover":{color:Cp()}},"& .isActive":{background:`var(--purple)`,color:`var(--white)`},"& .toolbar":{position:`relative`,top:`5px`,zIndex:20,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:`280px`,margin: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":{position:`absolute`,top:`-45px`},"& .toolbarRight":{right:0},"& .fullWidth":{width:`fit-content`,minWidth:`100%`},"& .hidden":{visibility:`hidden`},"& .autoWidth":{width:`fit-content`},"& .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`}})),A$=z(`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:Sp(),backgroundColor:Wp()},'& table:not([border="1"]) tr':{borderTop:`1px solid ${nm()}`},"& td, th":{padding:`.6em 1em`,textAlign:`center`},'& table:not([border="1"]) td, th':{border:`1px solid ${nm()}`},...n&&{border:`2px solid ${e.palette.error.main} !important`}})),j$=z(`div`,{shouldForwardProp:e=>![`disableScrollbar`,`highlightShape`].includes(e)})(({theme:e,disableScrollbar:t,highlightShape:n})=>({position:`relative`,padding:`0px`,overflowY:`auto`,color:Sp(),backgroundColor:n?e.palette.action.selected:Wp(),...t&&{"&::-webkit-scrollbar":{display:`none`},scrollbarWidth:`none`,"-ms-overflow-style":`none`}})),M$=z(`div`,{shouldForwardProp:e=>e!==`noPadding`})(({noPadding:e})=>({padding:e?0:`10px 8px`}));function N$(e){let[t,n]=(0,F.useState)(null),r=(0,F.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,F.useEffect)(()=>{i&&r.current&&(i._tiptapContainerEl=r.current)},[i,r.current]),(0,F.useEffect)(()=>{i&&d&&Promise.resolve().then(()=>{i.commands.focus(`end`)})},[i,d]),(0,F.useEffect)(()=>{if(e.adjustWidthForLimit){let t=document.createElement(`p`);t.style.visibility=`hidden`,t.style.position=`absolute`,t.style.whiteSpace=`nowrap`,t.textContent=`W`.repeat(e.charactersLimit);let i=window.getComputedStyle(r.current);[`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`letterSpacing`,`wordSpacing`,`textTransform`,`lineHeight`].forEach(e=>{t.style[e]=i[e]}),document.body.appendChild(t),n(`${t.offsetWidth+27}px`),t.remove()}},[e.adjustWidthForLimit,e.charactersLimit]);let b=(0,F.useMemo)(()=>({width:LX(t||p),minWidth:LX(f),maxWidth:LX(m),height:LX(g),minHeight:LX(h),maxHeight:LX(_)}),[t,f,p,m,h,g,_]);return(0,I.jsxs)(A$,{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,I.jsx)(j$,{disableScrollbar:s,highlightShape:v,children:(0,I.jsx)(M$,{noPadding:l&&l.noPadding,children:o})}),i&&(0,I.jsx)(O$,{editor:i,responseAreaProps:u,toolbarOpts:l,activePlugins:c,onChange:e.onChange,autoWidthToolbar:e.autoWidthToolbar})]})}var P$=Cm(`@pie-lib:editable-html:plugins`),F$=[`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`],I$={"text-align":`textAlign`,"bulleted-list":`ul_list`,"numbered-list":`ol_list`},L$=F$.filter(e=>![`responseArea`,`h3`,`blockquote`].includes(e)),R$=(e,t,n)=>{P$(`[buildPlugins] opts: `,n),e||=L$;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=!sc(n.extraCSSRules),c=n?.languageCharacters||[];return nc([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)])},z$={position:`bottom`,alignment:`left`,alwaysVisible:!1,showDone:!0,doneOn:`blur`},B$={options:{},respAreaToolbar:()=>{},onHandleAreaChange:()=>{}},V$=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`table`,`video`,`audio`,`responseArea`,`superscript`,`subscript`,`css`,`h3`,`undo`,`redo`],H$={"--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),
357
+ 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`},U$=e=>({role:`textbox`,"data-pie-editor":`true`,class:`mathjax_ignore`,spellcheck:e?`true`:`false`,autocorrect:e?`on`:`off`,autocapitalize:e?`on`:`off`}),W$=e=>{let{showParagraphs:t,separateParagraphs:n}=e.pluginProps||{},[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)(!1),{toolbarOpts:s}=e,c=(0,F.useCallback)(e=>{i(t=>{let n=t.filter(t=>t.pos!==e);return n.length===0&&o(!1),n})},[i]),l={...z$,...s},u=(0,F.useCallback)(t=>{let n=t.getHTML();e.markup!==n&&e.onChange?.(n),l.doneOn===`blur`&&e.onDone?.(n)},[e.markup,e.onChange,e.onDone,l.doneOn]),d=(0,F.useMemo)(()=>({...B$,...e.responseAreaProps,onInlineDropdownToolbarClose:u}),[e.responseAreaProps,u]),f=(0,F.useMemo)(()=>{let{customPlugins:t,...n}=e.pluginProps||{};t||=[];let r=(e.activePlugins||V$)?.filter(e=>{let t=I$[e]||e,r=n[t]||{};return!r||!r.disabled});return R$(r,t,{math:{},textAlign:e.textAlign,html:{},extraCSSRules:e.extraCSSRules||{},image:{...e.imageSupport},toolbar:{},table:{},responseArea:{type:d.type},languageCharacters:e.languageCharactersProps,keyPadCharacterRef:{},setKeypadInteraction:{},media:{}})},[e,d.type]),p=[Xee.configure({types:[`heading`,`paragraph`,`div`,`headingParagraph`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],alignments:[`left`,`right`,`center`,`justify`]}),qee,eI.configure({limit:e.charactersLimit||1e6}),OI.configure({trailingNode:{node:`paragraph`,notAfter:[`paragraph`,`div`]},link:{autolink:!1,linkOnPaste:!1}}),FX,PR,IX,FR,IR,$ee.configure({placeholder:e.placeholder,showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!0}),AR,fR,NR,MR,FG.configure(d),IG.configure(d),RG.configure(d),zG.configure(d),LG.configure(d),eJ.configure({toolbarOpts:l,math:e.pluginProps?.math||{}}),Yee,Jee,Qee,mY.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=rc(()=>{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}),_X.configure({uploadSoundSupport:e.uploadSoundSupport}),PX.configure({extraCSSRules:e.extraCSSRules})],m=e.spellCheck!==!1,h=FA({extensions:p,immediatelyRender:!1,editorProps:{attributes:U$(m),handleKeyDown(t,n){return e.onKeyDown?e.onKeyDown(n):!1}},editable:!e.disabled,content:FI(e.markup),onUpdate:({editor:t,transaction:n})=>{n.isDone&&e.onChange?.(t.getHTML())},onBlur:({editor:e})=>{e._insertingImage||e._toolbarOpened||e.isActive(`inline_dropdown`)||e.isActive(`explicit_constructed_response`)||!e.schema||u(e)}},[e.charactersLimit]);(0,F.useEffect)(()=>{e.editorRef&&e.editorRef(h)},[e.editorRef,h]),(0,F.useEffect)(()=>{h?.setEditable(!e.disabled)},[e.disabled,h]),(0,F.useEffect)(()=>{if(!h)return;let e=h.options?.editorProps,t={...e?.attributes,...U$(m)};e?.attributes?.spellcheck!==t.spellcheck&&h.setOptions({editorProps:{...e,attributes:t}})},[m,h]),(0,F.useEffect)(()=>{if(!h)return;let t=FI(e.markup);t!==h.getHTML()&&h.commands.setContent(t,{emitUpdate:!1})},[e.markup,h]),(0,F.useEffect)(()=>{Object.entries(H$).forEach(([e,t])=>{document.documentElement.style.setProperty(e,t)})},[]);let g=jA({editor:h,selector:e=>({isFocused:e.editor?.isFocused})}),_=(0,F.useMemo)(()=>{let{minWidth:t,width:n,maxWidth:r,minHeight:i,height:a,maxHeight:o}=e;return{width:LX(n),minWidth:LX(t),maxWidth:LX(r),height:LX(a),minHeight:LX(i),maxHeight:LX(o)}},[e]);return(0,I.jsx)(N$,{...e,activePlugins:f,toolbarOpts:l,editorState:g,editor:h,children:h&&(0,I.jsx)(G$,{style:{minHeight:_.minHeight,height:_.height,maxHeight:_.maxHeight},showParagraph:t&&!t.disabled,separateParagraph:n&&!n.disabled,editor:h})})},G$=z(OA,{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[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child":{position:`relative`},"& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::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`}}}})),K$=W$,q$={min:P.number.isRequired,max:P.number.isRequired,step:P.number},J$=P.shape(q$),Y$=P.shape(q$),X$=P.shape({width:P.number.isRequired,height:P.number.isRequired}),Z$=P.shape({x:P.number.isRequired,y:P.number.isRequired}),Q$=P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,$$=P.shape({x:P.func.isRequired,y:P.func.isRequired}),e1=P.shape({x:P.func.isRequired,y:P.func.isRequired}),t1=P.shape({scale:$$.isRequired,snap:e1.isRequired,domain:J$.isRequired,range:Y$.isRequired,size:X$.isRequired}),n1={graphProps:t1.isRequired,mark:P.object,onChange:P.func,onDelete:P.func,onClick:P.func};P.shape(n1);var r1=o(((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 i1(e,t){this.x=e,this.y=t}i1.prototype={clone(){return new i1(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:i1},i1.convert=function(e){if(e instanceof i1)return e;if(Array.isArray(e))return new i1(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new i1(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};var a1=l(r1(),1),o1=(e,t)=>({x:e,y:t}),s1=(e,t,n)=>{let r=pc(e,t,n);return r.splice(r.length,1,t),r};function c1(e,t,n,r){if(r>=t)return t;if(r<=e)return e;let i=s1(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 l1=(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)}),u1=(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}),d1=e=>new i1(e.x,e.y),f1=(e,t)=>d1(t).sub(d1(e)),p1=(e,t)=>lc(e.domain,t.domain)&&lc(e.range,t.range),m1=e=>(new DOMParser()?.parseFromString(e,`text/html`))?.body?.textContent||``,h1=e=>e&&Object.keys(e).length===0&&e.constructor===Object,g1=e=>typeof e==`string`&&e.trim()===``;function _1(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function v1(e,t){return!e||_1(e)?e:_1(e.default)?e.default:t&&_1(e[t])?e[t]:t&&_1(e[t]?.default)?e[t].default:e}var y1=v1(bg,`Readable`)||v1(S1.Readable,`Readable`),b1=Xg,x1=b1.default,S1=x1&&typeof x1==`object`?x1:b1,C1={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`}}},w1=z(`div`)({...C1.centerPlaceholder}),T1=z(`div`)({...C1.disabledLabel,"& p":{margin:0}}),E1=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,F.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,I.jsx)(y1,{false:!0,children:(0,I.jsx)(w1,{onClick:C,style:{...g?S:x,...y?C1.chartLabel:C1.axisLabel,...u===`left`&&!g?C1.rotateLeftLabel:{},...u===`right`&&!g?C1.rotateRightLabel:{},...g?C1.editLabel:{},...i||a?C1.customBottom:{},...t&&!y&&g1(m1(l))&&C1.displayNone},children:t?(0,I.jsx)(T1,{dangerouslySetInnerHTML:{__html:l||``}}):(0,I.jsx)(K$,{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})})})};E1.propTypes={disabledLabel:P.bool,graphHeight:P.number,graphWidth:P.number,isChartBottomLabel:P.bool,isDefineChartBottomLabel:P.bool,isChartLeftLabel:P.bool,isDefineChartLeftLabel:P.bool,placeholder:P.string,text:P.string,side:P.string,onChange:P.func,mathMlOptions:P.object,charactersLimit:P.number,titleHeight:P.number};function D1(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function O1(e,t){return!e||D1(e)?e:D1(e.default)?e.default:t&&D1(e[t])?e[t]:t&&D1(e[t]?.default)?e[t].default:e}var k1=O1(bg,`Readable`)||O1(M1.Readable,`Readable`),A1=Xg,j1=A1.default,M1=j1&&typeof j1==`object`?j1:A1,N1={"& .ProseMirror p.is-editor-empty::before, & .ProseMirror div.is-editor-empty::before":{left:0,right:0,width:`100%`,textAlign:`center`}},P1=z(`div`)(({theme:e})=>({border:`solid 1px ${Ip()}`,color:H.TEXT,backgroundColor:e.palette.common.white,touchAction:`none`,position:`relative`,boxSizing:`unset`})),F1=z(`div`)({display:`flex`,position:`relative`}),I1=z(`svg`)({paddingLeft:`50px`,overflow:`visible`,boxSizing:`content-box`}),L1=z(`svg`)({overflow:`visible`,boxSizing:`content-box`}),R1=z(`g`)({cursor:`pointer`,userSelect:`none`}),z1=z(`div`)(({theme:e})=>({color:H.TEXT,fontSize:e.typography.fontSize+2,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:`center`,"&.disabledTitle":{pointerEvents:`none`},"&.rightMargin":{marginRight:`74px`},"& p":{margin:0},...N1})),B1=z(`div`)(({theme:e})=>({color:H.TEXT,fontSize:e.typography.fontSize+4,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:`center`,"&.disabledTitle":{pointerEvents:`none`},"&.rightMargin":{marginRight:`74px`},"& p":{margin:0},...N1})),V1=z(`div`)({display:`flex`,paddingTop:`6px`}),H1=z(`div`)({display:`flex`,flexDirection:`column`,alignItems:`center`,width:`100px`,pointerEvents:`none`,userSelect:`none`}),U1=z(`div`)({width:`70px`,display:`flex`,flexDirection:`column`,marginRight:`6px`}),W1=z(`div`)({textAlign:`right`,height:`20px`,pointerEvents:`none`,userSelect:`none`,"&:not(:last-child)":{marginBottom:`80px`}}),G1=class extends F.Component{constructor(e){super(e),this.state={titleHeight:0},this.resizeObserver=null}static propTypes={title:P.string,children:Q$,defineChart:P.bool,disabledLabels:P.bool,disabledTitle:P.bool,graphProps:t1.isRequired,isChart:P.bool,labels:P.object,labelsPlaceholders:P.object,onChangeTitle:P.func,onMouseMove:P.func,showLabels:P.bool,showTitle:P.bool,showPixelGuides:P.bool,rootRef:P.func,onChangeLabels:P.func,titlePlaceholder:P.string,mathMlOptions:P.object,labelsCharactersLimit:P.number};mouseMove=(e,t)=>{let{graphProps:n,onMouseMove:r}=this.props;if(!r)return;let{scale:i,snap:a}=n,o=_u(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=hu(this.g);e.on(`mousemove`,this.mouseMove.bind(this,e)),this.measureTitleHeight(),this.setupVisibilityObserver()}componentWillUnmount(){hu(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=g1(m1(n?.left))&&h1(r)?48:70,S=g1(m1(n?.right))&&h1(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,I.jsxs)(P1,{children:[d&&(0,I.jsx)(V1,{style:{marginLeft:l?80:u?30:10},children:[...Array(D+1).keys()].map(e=>(0,I.jsx)(k1,{false:!0,children:(0,I.jsxs)(H1,{children:[(0,I.jsxs)(`div`,{children:[e*100,`px`]}),(0,I.jsx)(`div`,{children:`|`})]})},`top-guide-${e}`))}),f&&(e?(0,I.jsx)(`div`,{ref:e=>this.titleRef=e,style:{...l&&{width:C},...g1(m1(p))&&{display:`none`}},children:l?(0,I.jsx)(B1,{className:`disabledTitle`,dangerouslySetInnerHTML:{__html:p||``}}):(0,I.jsx)(z1,{className:`disabledTitle`,dangerouslySetInnerHTML:{__html:p||``}})}):(0,I.jsx)(`div`,{ref:e=>this.titleRef=e,children:l?(0,I.jsx)(B1,{className:d?`rightMargin`:``,children:(0,I.jsx)(K$,{...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,I.jsx)(z1,{className:d?`rightMargin`:``,children:(0,I.jsx)(K$,{...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,I.jsx)(E1,{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,I.jsxs)(F1,{children:[u&&(0,I.jsx)(E1,{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,I.jsx)(I1,{width:C,height:w,children:(0,I.jsx)(R1,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}):(0,I.jsx)(L1,{width:C,height:w,children:(0,I.jsx)(R1,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}),u&&!l&&(0,I.jsx)(E1,{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,I.jsx)(U1,{style:{paddingTop:k,marginTop:31},children:[...Array(O+1).keys()].reverse().map(e=>(0,I.jsx)(k1,{false:!0,children:(0,I.jsxs)(W1,{children:[`━ `,e*100,`px`]})},`top-guide-${e}`))})]}),u&&(0,I.jsx)(E1,{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})]})}};function K1(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function q1(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function J1(e){return typeof e==`number`&&!isNaN(e)}function Y1(e){return parseInt(e,10)}function X1(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var Z1=[`Moz`,`Webkit`,`O`,`ms`];function Q1(e=`transform`){if(typeof window>`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;n<Z1.length;n++)if($1(e,Z1[n])in t)return Z1[n];return``}function $1(e,t){return t?`${t}${e0(e)}`:e}function e0(e){let t=``,n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]===`-`?n=!0:t+=e[r];return t}var t0=Q1(),n0=``;function r0(e,t){n0||=K1([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return q1(e[t])})??``;let n=e[n0];return q1(n)?!!n.call(e,t):!1}function i0(e,t,n){let r=e;do{if(r0(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function a0(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.addEventListener?e.addEventListener(t,a,i):e.attachEvent?e.attachEvent(`on`+t,a):e[`on`+t]=a}function o0(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.removeEventListener?e.removeEventListener(t,a,i):e.detachEvent?e.detachEvent(`on`+t,a):e[`on`+t]=null}function s0(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=Y1(n.borderTopWidth),t+=Y1(n.borderBottomWidth),t}function c0(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=Y1(n.borderLeftWidth),t+=Y1(n.borderRightWidth),t}function l0(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=Y1(n.paddingTop),t-=Y1(n.paddingBottom),t}function u0(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=Y1(n.paddingLeft),t-=Y1(n.paddingRight),t}function d0(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}}function f0(e,t){let n=m0(e,t,`px`);return{[$1(`transform`,t0)]:n}}function p0(e,t){return m0(e,t,``)}function m0({x:e,y:t},n,r){let i=`translate(${e}${r},${t}${r})`;return n&&(i=`translate(${`${typeof n.x==`string`?n.x:n.x+r}`}, ${`${typeof n.y==`string`?n.y:n.y+r}`})`+i),i}function h0(e,t){return e.targetTouches&&K1(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&K1(e.changedTouches,e=>t===e.identifier)}function g0(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function _0(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function v0(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??_0();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
358
+ `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
359
+ `,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&x0(e.body,`react-draggable-transparent-selection`)}function y0(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{b0(e)}):b0(e)}function b0(e){if(e)try{e.body&&S0(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function x0(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function S0(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function C0(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:A0(r);let i=j0(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+Y1(s.paddingLeft)+Y1(o.marginLeft),top:-i.offsetTop+Y1(s.paddingTop)+Y1(o.marginTop),right:u0(a)-c0(i)-i.offsetLeft+Y1(s.paddingRight)-Y1(o.marginRight),bottom:l0(a)-s0(i)-i.offsetTop+Y1(s.paddingBottom)-Y1(o.marginBottom)}}return J1(r.right)&&(t=Math.min(t,r.right)),J1(r.bottom)&&(n=Math.min(n,r.bottom)),J1(r.left)&&(t=Math.max(t,r.left)),J1(r.top)&&(n=Math.max(n,r.top)),[t,n]}function w0(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function T0(e){return e.props.axis===`both`||e.props.axis===`x`}function E0(e){return e.props.axis===`both`||e.props.axis===`y`}function D0(e,t,n){let r=typeof t==`number`?h0(e,t):null;if(typeof t==`number`&&!r)return null;let i=j0(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return d0(r||e,a,n.props.scale)}function O0(e,t,n){let r=!J1(e.lastX),i=j0(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function k0(e,t){let 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 A0(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function j0(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var M0=typeof process<`u`&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},N0={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},P0=N0.mouse,F0=class extends F.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!i0(e.target,this.props.handle,t)||this.props.cancel&&i0(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=g0(e);this.touchIdentifier=r;let i=D0(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=O0(this,a,o);M0(`DraggableCore: handleDragStart: %j`,s),M0(`calling`,this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&v0(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,a0(n,P0.move,this.handleDrag),a0(n,P0.stop,this.handleDragStop))},this.handleDrag=e=>{let t=D0(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=w0(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=O0(this,n,r);if(M0(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=D0(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=w0(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=O0(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&y0(a.ownerDocument),M0(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(M0(`DraggableCore: Removing handlers`),o0(a.ownerDocument,P0.move,this.handleDrag),o0(a.ownerDocument,P0.stop,this.handleDragStop))},this.onMouseDown=e=>(P0=N0.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(P0=N0.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(P0=N0.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(P0=N0.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&a0(e,N0.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;o0(t,N0.mouse.move,this.handleDrag),o0(t,N0.touch.move,this.handleDrag),o0(t,N0.mouse.stop,this.handleDragStop),o0(t,N0.touch.stop,this.handleDragStop),o0(e,N0.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&y0(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=gd.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(M0(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return F.cloneElement(F.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};F0.displayName=`DraggableCore`,F0.propTypes={allowAnyClick:P.bool,allowMobileScroll:P.bool,children:P.node.isRequired,disabled:P.bool,enableUserSelectHack:P.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:P.arrayOf(P.number),handle:P.string,cancel:P.string,nodeRef:P.object,nonce:P.string,onStart:P.func,onDrag:P.func,onStop:P.func,onMouseDown:P.func,scale:P.number,className:X1,style:X1,transform:X1},F0.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var I0=class extends F.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(M0(`Draggable: onDragStart: %j`,t),this.props.onStart(e,k0(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;M0(`Draggable: onDrag: %j`,t);let n=k0(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=C0(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,k0(this,t))===!1)return!1;M0(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},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.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(M0(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=gd.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:T0(this)&&p?this.state.x:m.x,y:E0(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=p0(h,c):d=f0(h,c);let g=F.Children.only(n),_=L(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return F.createElement(F0,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},F.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};I0.displayName=`Draggable`,I0.propTypes={...F0.propTypes,axis:P.oneOf([`both`,`x`,`y`,`none`]),bounds:P.oneOfType([P.shape({left:P.number,right:P.number,top:P.number,bottom:P.number}),P.string,P.oneOf([!1])]),defaultClassName:P.string,defaultClassNameDragging:P.string,defaultClassNameDragged:P.string,defaultPosition:P.shape({x:P.number,y:P.number}),positionOffset:P.shape({x:P.oneOfType([P.number,P.string]),y:P.oneOfType([P.number,P.string])}),position:P.shape({x:P.number,y:P.number}),className:X1,style:X1,transform:X1},I0.defaultProps={...F0.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var L0=Cm(`pie-lib:plot:grid-draggable`),R0=(e,t,n)=>r=>{let i=r+e(0);return t(n+e.invert(i)).toFixed(4)*1e3/1e3},z0=e=>t=>((0,a1.default)(!!e&&uc(e.fromDelta)&&uc(e.bounds)&&uc(e.anchorPoint),`You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }`),class extends F.Component{static propTypes={disabled:P.bool,onDragStart:P.func,onDrag:P.func,onDragStop:P.func,onClick:P.func,onMove:P.func,graphProps:t1.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:R0(i.x,a.x,t),y:R0(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 L0(`[tiny] key: `,e,`delta: `,r,`out: `,i),i};getScaledBounds=()=>{let t=e.bounds(this.props,this.props.graphProps);L0(`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},L0(`[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 f1(t.anchorPoint,n)};applyDelta=t=>{let n=this.getDelta(t);return L0(`[applyDelta] delta:`,n),e.fromDelta(this.props,n)};onStop=(e,t)=>{L0(`[onStop] dd:`,t);let{onDragStop:n,onClick:r,disabled:i}=this.props;if(n&&!i&&n(),L0(`[onStop] lastX/Y: `,t.lastX,t.lastY),!this._didDrag){if(!i&&typeof e?.stopPropagation==`function`&&e.stopPropagation(),r){L0(`call onClick`),this.setState({startX:null,startY:null});let{graphProps:t}=this.props,{scale:n,snap:i}=t;try{let[t,a]=_u(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({})}}this.setState({startX:null,startY:null});return}this.setState({startX:null,startY:null})};render(){let{disabled:n,onClick:r,...i}=this.props,a=this.grid(),o=e=>(e.nativeEvent||e).preventDefault(),s=this.state?!!this.state.startX:!1;return(0,I.jsx)(F0,{onMouseDown:o,onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||`both`,grid:[a.x,a.y],children:(0,I.jsx)(t,{...i,disabled:n,isDragging:s,onClick:s?void 0:r})})}}),B0=Cm(`pie-lib:plot:trig`),V0=e=>180/Math.PI*e,H0=e=>Math.PI/180*e,U0=(e,t)=>{let n=t.y-e.y,r=t.x-e.x;B0(e,t,`vd: `,n,`hd: `,r);let i=Math.atan2(n,r);return i<0?i+Math.PI*2:i},W0=Math.PI/2;Math.PI+W0;var G0=(e,t)=>Math.abs(e/Math.sin(t)),K0=(e,t)=>(n,r)=>[Y0(o1(n.x<r.x?e.max:e.min,n.y<r.y?t.max:t.min),n,r),Y0(o1(r.x<n.x?e.max:e.min,r.y<n.y?t.max:t.min),r,n)],q0=(e,t)=>(B0(`[getOpposingSide] hyp: `,e,`angle:`,t),Math.abs(e*Math.sin(t))),J0=(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)},Y0=(e,t,n)=>{let r=B0.enabled?B0.bind(B0,`diffEdge: [${t.x},${t.y} -> ${n.x},${n.y}]`):()=>{},i=U0(t,n);r(`x angle`,V0(i));let a=Math.abs(i-H0(90));r(`y angle`,V0(a));let o=Math.abs(t.x-e.x),s=G0(o,a),c=Math.abs(t.y-e.y),l=G0(c,i);r(`x: side`,o,`h:`,s),r(`y: side`,c,`h:`,l);let u=J0(s,l);if(u!==`x`&&u!==`y`)throw Error(`Cant decide which hypotenuse to use`);let d=u===`x`?new i1(o,q0(s,i)):new i1(q0(l,a),c);r(`point:`,d);let f=new i1(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 i1(t.x,t.y));return r(`normalized:`,m),m};function X0(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Z0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Q0(e){let t,n,r;e.length===2?(t=e===X0||e===Z0?e:$0,n=e,r=e):(t=X0,n=(t,n)=>X0(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 $0(){return 0}function e2(e){return e===null?NaN:+e}var t2=Q0(X0),n2=t2.right;t2.left,Q0(e2).center;var r2=Math.sqrt(50),i2=Math.sqrt(10),a2=Math.sqrt(2);function o2(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=r2?10:a>=i2?5:a>=a2?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?o2(e,t,n*2):[s,c,l]}function s2(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?o2(t,e,n):o2(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 c2(e,t,n){return t=+t,e=+e,n=+n,o2(e,t,n)[2]}function l2(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?c2(t,e,n):c2(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function u2(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function d2(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function f2(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function p2(){}var m2=.7,h2=1/m2,g2=`\\s*([+-]?\\d+)\\s*`,_2=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,v2=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,y2=/^#([0-9a-f]{3,8})$/,b2=RegExp(`^rgb\\(${g2},${g2},${g2}\\)$`),x2=RegExp(`^rgb\\(${v2},${v2},${v2}\\)$`),S2=RegExp(`^rgba\\(${g2},${g2},${g2},${_2}\\)$`),C2=RegExp(`^rgba\\(${v2},${v2},${v2},${_2}\\)$`),w2=RegExp(`^hsl\\(${_2},${v2},${v2}\\)$`),T2=RegExp(`^hsla\\(${_2},${v2},${v2},${_2}\\)$`),E2={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};d2(p2,j2,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:D2,formatHex:D2,formatHex8:O2,formatHsl:k2,formatRgb:A2,toString:A2});function D2(){return this.rgb().formatHex()}function O2(){return this.rgb().formatHex8()}function k2(){return W2(this).formatHsl()}function A2(){return this.rgb().formatRgb()}function j2(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=y2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?M2(t):n===3?new I2(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?N2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?N2(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=b2.exec(e))?new I2(t[1],t[2],t[3],1):(t=x2.exec(e))?new I2(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=S2.exec(e))?N2(t[1],t[2],t[3],t[4]):(t=C2.exec(e))?N2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=w2.exec(e))?U2(t[1],t[2]/100,t[3]/100,1):(t=T2.exec(e))?U2(t[1],t[2]/100,t[3]/100,t[4]):E2.hasOwnProperty(e)?M2(E2[e]):e===`transparent`?new I2(NaN,NaN,NaN,0):null}function M2(e){return new I2(e>>16&255,e>>8&255,e&255,1)}function N2(e,t,n,r){return r<=0&&(e=t=n=NaN),new I2(e,t,n,r)}function P2(e){return e instanceof p2||(e=j2(e)),e?(e=e.rgb(),new I2(e.r,e.g,e.b,e.opacity)):new I2}function F2(e,t,n,r){return arguments.length===1?P2(e):new I2(e,t,n,r??1)}function I2(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}d2(I2,F2,f2(p2,{brighter(e){return e=e==null?h2:h2**+e,new I2(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?m2:m2**+e,new I2(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new I2(V2(this.r),V2(this.g),V2(this.b),B2(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:L2,formatHex:L2,formatHex8:R2,formatRgb:z2,toString:z2}));function L2(){return`#${H2(this.r)}${H2(this.g)}${H2(this.b)}`}function R2(){return`#${H2(this.r)}${H2(this.g)}${H2(this.b)}${H2((isNaN(this.opacity)?1:this.opacity)*255)}`}function z2(){let e=B2(this.opacity);return`${e===1?`rgb(`:`rgba(`}${V2(this.r)}, ${V2(this.g)}, ${V2(this.b)}${e===1?`)`:`, ${e})`}`}function B2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function V2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function H2(e){return e=V2(e),(e<16?`0`:``)+e.toString(16)}function U2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new K2(e,t,n,r)}function W2(e){if(e instanceof K2)return new K2(e.h,e.s,e.l,e.opacity);if(e instanceof p2||(e=j2(e)),!e)return new K2;if(e instanceof K2)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 K2(o,s,c,e.opacity)}function G2(e,t,n,r){return arguments.length===1?W2(e):new K2(e,t,n,r??1)}function K2(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}d2(K2,G2,f2(p2,{brighter(e){return e=e==null?h2:h2**+e,new K2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?m2:m2**+e,new K2(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 I2(Y2(e>=240?e-240:e+120,i,r),Y2(e,i,r),Y2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new K2(q2(this.h),J2(this.s),J2(this.l),B2(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=B2(this.opacity);return`${e===1?`hsl(`:`hsla(`}${q2(this.h)}, ${J2(this.s)*100}%, ${J2(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function q2(e){return e=(e||0)%360,e<0?e+360:e}function J2(e){return Math.max(0,Math.min(1,e||0))}function Y2(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 X2=e=>()=>e;function Z2(e,t){return function(n){return e+n*t}}function Q2(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function $2(e){return(e=+e)==1?e4:function(t,n){return n-t?Q2(t,n,e):X2(isNaN(t)?n:t)}}function e4(e,t){var n=t-e;return n?Z2(e,n):X2(isNaN(e)?t:e)}var t4=(function e(t){var n=$2(t);function r(e,t){var r=n((e=F2(e)).r,(t=F2(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=e4(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 n4(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 r4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function i4(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]=p4(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 a4(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function o4(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function s4(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]=p4(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var c4=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,l4=new RegExp(c4.source,`g`);function u4(e){return function(){return e}}function d4(e){return function(t){return e(t)+``}}function f4(e,t){var n=c4.lastIndex=l4.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=c4.exec(e))&&(i=l4.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:o4(r,i)})),n=l4.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?d4(c[0].x):u4(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 p4(e,t){var n=typeof t,r;return t==null||n===`boolean`?X2(t):(n===`number`?o4:n===`string`?(r=j2(t))?(t=r,t4):f4:t instanceof j2?t4:t instanceof Date?a4:r4(t)?n4:Array.isArray(t)?i4:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?s4:o4)(e,t)}function m4(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function h4(e){return function(){return e}}function g4(e){return+e}var _4=[0,1];function v4(e){return e}function y4(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:h4(isNaN(t)?NaN:.5)}function b4(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function x4(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=y4(i,r),a=n(o,a)):(r=y4(r,i),a=n(a,o)),function(e){return a(r(e))}}function S4(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]=y4(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=n2(e,t,1,r)-1;return a[n](i[n](t))}}function C4(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function w4(){var e=_4,t=_4,n=p4,r,i,a,o=v4,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==v4&&(o=b4(e[0],e[n-1])),s=n>2?S4:x4,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),o4))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,g4),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=m4,u()},d.clamp=function(e){return arguments.length?(o=e?!0:v4,u()):o!==v4},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 T4(){return w4()(v4,v4)}function E4(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function D4(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 O4(e){return e=D4(Math.abs(e)),e?e[1]:NaN}function k4(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 A4(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var j4=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function M4(e){if(!(t=j4.exec(e)))throw Error(`invalid format: `+e);var t;return new N4({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]})}M4.prototype=N4.prototype;function N4(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+``}N4.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 P4(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 F4;function I4(e,t){var n=D4(e,t);if(!n)return F4=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(F4=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`)+D4(e,Math.max(0,t+a-1))[0]}function L4(e,t){var n=D4(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 R4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:E4,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)=>L4(e*100,t),r:L4,s:I4,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function z4(e){return e}var B4=Array.prototype.map,V4=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function H4(e){var t=e.grouping===void 0||e.thousands===void 0?z4:k4(B4.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?z4:A4(B4.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=M4(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`):R4[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=R4[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=P4(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&F4!==void 0?V4[8+F4/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(O4(t)/3)))*3,r=10**-n,i=l((e=M4(e),e.type=`f`,e),{suffix:V4[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var U4,W4,G4;K4({thousands:`,`,grouping:[3],currency:[`$`,``]});function K4(e){return U4=H4(e),W4=U4.format,G4=U4.formatPrefix,U4}function q4(e){return Math.max(0,-O4(Math.abs(e)))}function J4(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(O4(t)/3)))*3-O4(Math.abs(e)))}function Y4(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,O4(t)-O4(e))+1}function X4(e,t,n,r){var i=l2(e,t,n),a;switch(r=M4(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=J4(i,o))&&(r.precision=a),G4(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Y4(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=q4(i))&&(r.precision=a-(r.type===`%`)*2);break}return W4(r)}function Z4(e){var t=e.domain;return e.ticks=function(e){var n=t();return s2(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return X4(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=c2(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 Q4(){var e=T4();return e.copy=function(){return C4(e,Q4())},u2.apply(e,arguments),Z4(e)}var $4=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),e3=(e,t,n,r)=>{(0,a1.default)(e.min<e.max,`domain: min must be less than max`),(0,a1.default)(t.min<t.max,`range: min must be less than max`);let i=$4(e),a=$4(t);return{scale:{x:Q4().domain([e.min,e.max]).range([0,n.width]),y:Q4().domain([t.max,t.min]).range([0,n.height])},snap:{x:c1.bind(null,i.min,i.max,i.step),y:c1.bind(null,a.min,a.max,a.step)},domain:e,range:t,size:n,getRootNode:r}},t3=l(o(((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})()}))());function n3(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,I.jsx)(`g`,{ref:o,className:(0,t3.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function r3(e){if((typeof e==`function`||typeof e==`object`&&e)&&`valueOf`in e){let t=e.valueOf();if(typeof t==`number`)return t}return e}function i3(e,t){let n=e;return`ticks`in n?n.ticks(t):n.domain().filter((e,n,r)=>t==null||r.length<=t||n%Math.round((r.length-1)/t)===0)}function a3(e){return e?.toString()}function o3(e){let{from:t={x:0,y:0},to:n={x:1,y:1},fill:r=`transparent`,className:i,innerRef:a,...o}=e,s=t.x===n.x||t.y===n.y;return(0,I.jsx)(`line`,{ref:a,className:(0,t3.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}var s3=o(((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}})),c3=o(((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}})),l3=o(((e,t)=>{var n=c3();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)}})),u3=o(((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})),d3=o(((e,t)=>{var n=u3();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})),f3=o(((e,t)=>{var n=d3();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})),p3=o(((e,t)=>{var n=f3();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})),m3=o(((e,t)=>{var n=p3();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})),h3=o(((e,t)=>{var n=s3(),r=l3(),i=m3(),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}}));function g3(e,t){let n=new Map;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];let o=t(...i);if(n.has(o))return n.get(o);let s=e.apply(this,i);return n.set(o,s),s}}var _3=`__react_svg_text_measurement_id`;function v3(e,t){if(typeof document>`u`)return null;try{let n=document.getElementById(_3);if(!n){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`aria-hidden`,`true`),e.style.width=`0`,e.style.height=`0`,e.style.position=`absolute`,e.style.top=`-100%`,e.style.left=`-100%`,n=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),n.setAttribute(`id`,_3),e.appendChild(n),document.body.appendChild(e)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch{return null}}var y3=g3(v3,(e,t)=>`${e}_${JSON.stringify(t)}`),b3=l(h3());function x3(e){return typeof e==`number`}function S3(e){return typeof e==`number`&&Number.isFinite(e)||typeof e==`string`}function C3(e){let{verticalAnchor:t=`end`,scaleToFit:n=!1,angle:r,width:i,lineHeight:a=`1em`,capHeight:o=`0.71em`,children:s,style:c,...l}=e,{x:u=0,y:d=0}=l,f=!S3(u)||!S3(d),{wordsWithWidth:p,spaceWidth:m}=(0,F.useMemo)(()=>({wordsWithWidth:(s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)).map(e=>({word:e,wordWidth:y3(e,c)||0})),spaceWidth:y3(`\xA0`,c)||0}),[s,c]),h=(0,F.useMemo)(()=>f?[]:i||n?p.reduce((e,t)=>{let{word:r,wordWidth:a}=t,o=e[e.length-1];if(o&&(i==null||n||(o.width||0)+a+m<i))o.words.push(r),o.width=o.width||0,o.width+=a+m;else{let t={words:[r],width:a};e.push(t)}return e},[]):[{words:s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)}],[f,i,n,s,p,m]);return{wordsByLines:h,startDy:(0,F.useMemo)(()=>f?``:t===`start`?(0,b3.default)(`calc(${o})`):t===`middle`?(0,b3.default)(`calc(${(h.length-1)/2} * -${a} + (${o} / 2))`):(0,b3.default)(`calc(${h.length-1} * -${a})`),[f,t,o,h.length,a]),transform:(0,F.useMemo)(()=>{let e=[];if(f)return``;if(x3(u)&&x3(d)&&x3(i)&&n&&h.length>0){let t=h[0].width||1,r=n===`shrink-only`?Math.min(i/t,1):i/t,a=r,o=u-r*u,s=d-a*d;e.push(`matrix(${r}, 0, 0, ${a}, ${o}, ${s})`)}return r&&e.push(`rotate(${r}, ${u}, ${d})`),e.length>0?e.join(` `):``},[f,u,d,i,n,h,r])}}var w3={overflow:`visible`};function T3(e){let{dx:t=0,dy:n=0,textAnchor:r=`start`,innerRef:i,innerTextRef:a,verticalAnchor:o,angle:s,lineHeight:c=`1em`,scaleToFit:l=!1,capHeight:u,width:d,...f}=e,{x:p=0,fontSize:m}=f,{wordsByLines:h,startDy:g,transform:_}=C3(e);return(0,I.jsx)(`svg`,{ref:i,x:t,y:n,fontSize:m,style:w3,children:h.length>0?(0,I.jsx)(`text`,{ref:a,transform:_,...f,textAnchor:r,children:h.map((e,t)=>(0,I.jsx)(`tspan`,{x:p,dy:t===0?g:c,children:e.words.join(` `)},t))}):null})}var E3={top:`top`,left:`left`,right:`right`,bottom:`bottom`};function D3(e){let{labelOffset:t,labelProps:n,orientation:r,range:i,tickLabelFontSize:a,tickLength:o}=e,s=r===E3.left||r===E3.top?-1:1,c,l,u;if(r===E3.top||r===E3.bottom){let e=r===E3.bottom&&typeof n.fontSize==`number`?n.fontSize:0;c=(Number(i[0])+Number(i[i.length-1]))/2,l=s*(o+t+a+e)}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 O3(e){let{hideTicks:t,horizontal:n,orientation:r,tickClassName:i,tickComponent:a,tickLabelProps:o,tickStroke:s=`#222`,tickTransform:c,ticks:l,strokeWidth:u,tickLineProps:d}=e;return l.map(e=>{let{value:l,index:f,from:p,to:m,formattedValue:h}=e,g=o[f]??{},_=Math.max(10,typeof g.fontSize==`number`&&g.fontSize||0),v=m.y+(n&&r!==E3.top?_:0);return(0,I.jsxs)(n3,{className:(0,t3.default)(`visx-axis-tick`,i),transform:c,children:[!t&&(0,I.jsx)(o3,{from:p,to:m,stroke:s,strokeWidth:u,strokeLinecap:`square`,...d}),a?a({...g,x:m.x,y:v,formattedValue:h}):(0,I.jsx)(T3,{x:m.x,y:v,...g,children:h})]},`visx-tick-${l}-${f}`)})}var k3={textAnchor:`middle`,fontFamily:`Arial`,fontSize:10,fill:`#222`};function A3(e){let{axisFromPoint:t,axisLineClassName:n,axisToPoint:r,hideAxisLine:i,hideTicks:a,horizontal:o,label:s=``,labelClassName:c,labelOffset:l=14,labelProps:u,orientation:d=E3.bottom,scale:f,stroke:p=`#222`,strokeDasharray:m,strokeWidth:h=1,tickClassName:g,tickComponent:_,tickLineProps:v,tickLabelProps:y,tickLength:b=8,tickStroke:x=`#222`,tickTransform:S,ticks:C,ticksComponent:w=O3}=e,T={...k3,...u},E={...k3,...typeof y==`object`?y:null},D=C.map(e=>{let{value:t,index:n}=e;return typeof y==`function`?y(t,n,C):E}),O=Math.max(10,...D.map(e=>typeof e.fontSize==`number`?e.fontSize:0));return(0,I.jsxs)(I.Fragment,{children:[w({hideTicks:a,horizontal:o,orientation:d,scale:f,tickClassName:g,tickComponent:_,tickLabelProps:D,tickStroke:x,tickTransform:S,ticks:C,strokeWidth:h,tickLineProps:v}),!i&&(0,I.jsx)(o3,{className:(0,t3.default)(`visx-axis-line`,n),from:t,to:r,stroke:p,strokeWidth:h,strokeDasharray:m}),s&&(0,I.jsx)(T3,{className:(0,t3.default)(`visx-axis-label`,c),...D3({labelOffset:l,labelProps:T,orientation:d,range:f.range(),tickLabelFontSize:O,tickLength:b}),...T,children:s})]})}function j3(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`center`,n=e;if(t!==`start`&&`bandwidth`in n){let e=n.bandwidth();return t===`center`&&(e/=2),n.round()&&(e=Math.round(e)),t=>{let r=n(t);return typeof r==`number`?r+e:r}}return e}function M3(e){let t=e;return`tickFormat`in t?t.tickFormat():a3}var N3=class{x=0;y=0;constructor(e){let{x:t=0,y:n=0}=e;this.x=t,this.y=n}value(){return{x:this.x,y:this.y}}toArray(){return[this.x,this.y]}};function P3(e,t){let{x:n,y:r}=e;return new N3(t?{x:n,y:r}:{x:r,y:n})}function F3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof e==`number`?{start:e,end:e}:{start:0,end:0,...e}}function I3(e){let{children:t=A3,axisClassName:n,hideAxisLine:r=!1,hideTicks:i=!1,hideZero:a=!1,innerRef:o,left:s=0,numTicks:c=10,orientation:l=E3.bottom,rangePadding:u=0,scale:d,tickFormat:f,tickLength:p=8,tickValues:m,top:h=0,...g}=e,_=f??M3(d),v=l===E3.left,y=l===E3.top,b=y||l===E3.bottom,x=j3(d),S=v||y?-1:1,C=d.range(),w=F3(u),T=P3({x:Number(C[0])+.5-w.start,y:0},b),E=P3({x:Number(C[C.length-1])+.5+w.end,y:0},b),D=(m??i3(d,c)).filter(e=>!a||e!==0&&e!==`0`).map((e,t)=>({value:e,index:t})),O=D.map(e=>{let{value:t,index:n}=e,r=r3(x(t));return{value:t,index:n,from:P3({x:r,y:0},b),to:P3({x:r,y:p*S},b),formattedValue:_(t,n,D)}});return(0,I.jsx)(n3,{className:(0,t3.default)(`visx-axis`,n),innerRef:o,top:h,left:s,children:t({...g,axisFromPoint:T,axisToPoint:E,hideAxisLine:r,hideTicks:i,hideZero:a,horizontal:b,numTicks:c,orientation:l,rangePadding:u,scale:d,tickFormat:_,tickLength:p,tickPosition:x,tickSign:S,ticks:O})})}var L3=z(`path`)(({theme:e})=>({fill:`var(--arrow-color, ${e.palette.common.black})`})),R3=class extends F.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,I.jsx)(L3,{d:`m 0,0 8,-5 0,10 -8,-5`,transform:s,className:n})}};R3.propTypes={y:P.number,x:P.number,direction:P.oneOf([`left`,`right`,`up`,`down`]),className:P.string,scale:$$.isRequired},R3.defaultProps={y:0,x:0,direction:`left`};var z3=u1,B3=d1,V3=()=>0,H3=()=>0,U3=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):[]},W3=e=>e==null||sc(e)?1:e.split(` `).length,G3=e=>(e||``).replace(/<[^>]+>/g,``).split(` `).sort((e,t)=>t.length-e.length)[0].length,K3=e=>e?e*10:0,q3=e=>{let t=oc(e),n={left:t.x,top:t.y,bottom:t.y,right:t.x};return mc(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)},J3=e=>{let t=tc(e);return t.sort((e,t)=>t.x-e.x),{a:t[0],b:t[1]}},Y3=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),X3=e=>parseFloat(e.toFixed(4)),Z3=(e,t)=>e&&t&&(X3(e.x)===X3(t.x)||X3(e.y)===X3(t.y)),Q3=(e,t)=>e&&t&&lc({x:X3(e.x),y:X3(e.y)},{x:X3(t.x),y:X3(t.y)}),$3=(e,t)=>{let{min:n,max:r,step:i}=e;return t/((r-n)/i)},e6=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e;return $3(t,r)<14||$3(n,i)<14},t6=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e,a=$3(t,r),o=$3(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}}},n6=e=>(e||[]).sort((e,t)=>e.x-t.x||e.y-t.y),r6=(e,t,n)=>(e.x-t.x)*(n.y-t.y)===(n.x-t.x)*(e.y-t.y),i6=(e,t)=>r6(e.from,t.from,t.to)&&r6(e.to,t.from,t.to),a6=(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=>lc(e,n));return o!==-1&&a.splice(o,1),!!a.find(t=>{if(r===`line`){let{from:n,to:i}=e;return Q3(n,t.from)&&Q3(i,t.to)||Q3(n,t.to)&&Q3(i,t.from)||r===`line`&&i6(t,e)}else if(r===`polygon`)return lc(n6(tc(e.points)),n6(tc(t.points)))})},o6=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(Object.keys(r).length!==Object.keys(i).length)return!1;for(let e in r)if(r[e]!==i[e])return!1}return!0};function s6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function c6(e,t){return!e||s6(e)?e:s6(e.default)?e.default:t&&s6(e[t])?e[t]:t&&s6(e[t]?.default)?e[t].default:e}var l6=c6(bg,`Readable`)||c6(f6.Readable,`Readable`),u6=Xg,d6=u6.default,f6=d6&&typeof d6==`object`?d6:u6,p6={includeArrows:P.object,graphProps:P.object},m6={includeArrows:{left:!0,right:!0,up:!0,down:!0}},h6=z(`g`)(()=>({"& .visx-axis-line":{stroke:`#8a92c0`,strokeWidth:4},"& .visx-axis-tick":{fill:H.BLACK,"& > line":{stroke:`#8a92c0`}}})),g6=z(`div`)(({theme:e,centered:t})=>({padding:0,margin:0,"* > *":{margin:0,padding:0},"& p":{margin:0},fontSize:e.typography.fontSize,...t&&{textAlign:`center`}})),_6=z(R3)({fill:`#8a92c0`}),v6={fontFamily:`Roboto`,fontSize:`14px`,cursor:`inherit`},y6=(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},b6=e=>(e||[]).find(e=>e<0),x6=class extends F.Component{static propTypes={...p6,graphProps:t1.isRequired};static defaultProps=m6;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{...v6,textAnchor:`middle`,y:t,dx:e===0?-10:0,dy:e===0?-7:0}},d=W3(s.axisLabel),f=K3(G3(s.axisLabel))+2;return(0,I.jsxs)(h6,{children:[(0,I.jsx)(I3,{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,I.jsx)(_6,{direction:`left`,x:s.min,y:0,scale:o}),e&&e.right&&(0,I.jsx)(_6,{direction:`right`,x:s.max,y:0,scale:o}),s.axisLabel&&(0,I.jsx)(`foreignObject`,{x:c.width+17,y:o.y(0)-9,width:f,height:20*d,children:(0,I.jsx)(l6,{false:!0,children:(0,I.jsx)(g6,{dangerouslySetInnerHTML:{__html:s.axisLabel}})})})]})}},S6=class extends F.Component{static propTypes={...p6,graphProps:t1.isRequired};static defaultProps=m6;render(){let{includeArrows:e,graphProps:t,skipValues:n,rowTickValues:r}=this.props,{scale:i,range:a,size:o}=t||{},s=a.axisLabel?K3(a.axisLabel.length):0;return(0,I.jsxs)(h6,{children:[(0,I.jsx)(I3,{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{...v6,dy:4,dx:-10-t*9,"data-pie-readable":!1}},hideZero:!0,tickTextAnchor:`bottom`,tickValues:r}),e&&e.down&&(0,I.jsx)(_6,{direction:`down`,x:0,y:a.min,scale:i}),e&&e.up&&(0,I.jsx)(_6,{direction:`up`,x:0,y:a.max,scale:i}),a.axisLabel&&(0,I.jsx)(`foreignObject`,{x:i.x(0)-s/2,y:-33,width:s,height:`20`,children:(0,I.jsx)(l6,{false:!0,children:(0,I.jsx)(g6,{centered:!0,dangerouslySetInnerHTML:{__html:a.axisLabel}})})})]})}},C6=class extends F.Component{static propTypes={...p6,graphProps:t1.isRequired};static defaultProps=m6;xValues=()=>{let{graphProps:e}=this.props,{scale:t,domain:n}=e||{};if(!n||!t)return;let r=U3({...n,step:n.labelStep}),i=b6(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=U3({...n,step:n.labelStep}),i=b6(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=y6(i,s,a,c,6,25);return(0,I.jsxs)(h6,{children:[n.min<=0?(0,I.jsx)(x6,{...this.props,skipValues:l,columnTicksValues:r,distanceFromOriginToFirstNegativeY:c,dy:25}):null,t.min<=0?(0,I.jsx)(S6,{...this.props,skipValues:l,rowTickValues:o,distanceFromOriginToFirstNegativeX:a}):null]})}};function w6(e){return`bandwidth`in e?e.bandwidth():0}function T6(e){let{top:t=0,left:n=0,scale:r,width:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,children:l,numTicks:u=10,lineStyle:d,offset:f,tickValues:p,...m}=e,h=p??i3(r,u),g=(f??0)+w6(r)/2,_=h.map((e,t)=>{let n=(r3(r(e))??0)+g;return{index:t,from:new N3({x:0,y:n}),to:new N3({x:i,y:n})}});return(0,I.jsx)(n3,{className:(0,t3.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,I.jsx)(o3,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function E6(e){let{top:t=0,left:n=0,scale:r,height:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,numTicks:l=10,lineStyle:u,offset:d,tickValues:f,children:p,...m}=e,h=f??i3(r,l),g=(d??0)+w6(r)/2,_=h.map((e,t)=>{let n=(r3(r(e))??0)+g;return{index:t,from:new N3({x:n,y:0}),to:new N3({x:n,y:i})}});return(0,I.jsx)(n3,{className:(0,t3.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,I.jsx)(o3,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}function D6(e){let{top:t,left:n,xScale:r,yScale:i,width:a,height:o,className:s,stroke:c,strokeWidth:l,strokeDasharray:u,numTicksRows:d,numTicksColumns:f,rowLineStyle:p,columnLineStyle:m,xOffset:h,yOffset:g,rowTickValues:_,columnTickValues:v,...y}=e;return(0,I.jsxs)(n3,{className:(0,t3.default)(`visx-grid`,s),top:t,left:n,children:[(0,I.jsx)(T6,{className:s,scale:i,width:a,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:d,lineStyle:p,offset:g,tickValues:_,...y}),(0,I.jsx)(E6,{className:s,scale:r,height:o,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:f,lineStyle:m,offset:h,tickValues:v,...y})]})}var O6=class extends F.Component{static propTypes={disabled:P.bool,disabledAdditionalGrid:P.bool,graphProps:t1.isRequired};getAdditionalGridProps=(e,t)=>{let{graphProps:{scale:n,size:{width:r,height:i},domain:a,range:o}}=this.props,s=U3({...o,step:o.labelStep}).filter(t=>e.includes(t)),c=U3({...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=U3(a),s=U3(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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(D6,{innerRef:e=>this.grid=e,xScale:t.x,yScale:t.y,width:r,height:n,stroke:`#D3D3D3`,rowTickValues:o,columnTickValues:s}),f&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(T6,{scale:t.y,width:r,tickValues:c,stroke:p,strokeDasharray:u}),(0,I.jsx)(E6,{scale:t.x,height:n,tickValues:l,stroke:p,strokeDasharray:d})]})]})}};function k6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function A6(e,t){return!e||k6(e)?e:k6(e.default)?e.default:t&&k6(e[t])?e[t]:t&&k6(e[t]?.default)?e[t].default:e}var j6=A6(bg,`Readable`)||A6(P6.Readable,`Readable`),M6=Xg,N6=M6.default,P6=N6&&typeof N6==`object`?N6:M6,F6={left:-90,top:0,bottom:0,right:90},I6=(e,t,n)=>{let r=(e,t,n)=>`translate(${e}, ${t}), rotate(${n})`;if(e===`left`)return r(-20,n/2,F6[e]);if(e===`right`)return r(t+30,n/2,F6[e]);if(e===`top`)return r(t/2,-20,F6[e]);if(e===`bottom`)return r(t/2,n+30,F6[e])},L6=(e,t)=>{switch(e){case`left`:case`top`:return-t;case`right`:return-t-10;default:return-t+10}},R6=`Label`,z6={label:`${R6}-label`,axisLabel:`${R6}-axisLabel`,disabledAxisLabel:`${R6}-disabledAxisLabel`,bottomLabel:`${R6}-bottomLabel`},B6=z(`div`)(({theme:e})=>({[`& .${z6.label}`]:{fill:H.SECONDARY},[`& .${z6.axisLabel}`]:{fontSize:e.typography.fontSize-2,textAlign:`center`,padding:`0 4px`},[`& .${z6.disabledAxisLabel}`]:{pointerEvents:`none`},[`& .${z6.bottomLabel}`]:{marginTop:`44px`}})),V6=class extends F.Component{static propTypes={text:P.string,side:P.string,disabledLabel:P.bool,placeholder:P.string,graphProps:t1.isRequired,onChange:P.func,mathMlOptions:P.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=I6(r,d,u),p=r===`left`||r===`right`?u:d,m=L6(r,36),h=r===`bottom`?58:54,g=[`bold`,`italic`,`underline`,`strikethrough`,`math`];return(0,I.jsx)(B6,{children:(0,I.jsx)(`foreignObject`,{x:-(p/2),y:m,width:p,height:h,transform:f,textAnchor:`middle`,children:(0,I.jsx)(j6,{children:(0,I.jsx)(K$,{className:L({[z6.bottomLabel]:r===`bottom`,[z6.disabledAxisLabel]:e},z6.axisLabel),markup:n||``,onChange:a,placeholder:!e&&t,toolbarOpts:{position:r===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},activePlugins:g,mathMlOptions:o})})})})}},H6={left:P.string,top:P.string,bottom:P.string,right:P.string};(class extends F.Component{static propTypes={disabledLabels:P.bool,placeholders:P.object,value:P.shape(H6),graphProps:P.object,onChange:P.func,mathMlOptions:P.object};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,I.jsx)(I.Fragment,{children:[`left`,`top`,`bottom`,`right`].map(a=>(0,I.jsx)(V6,{side:a,text:n[a],disabledLabel:e,placeholder:t[a],graphProps:r,onChange:e=>this.onChangeLabel(e,a),mathMlOptions:i},a))})}});var U6=class extends F.Component{static propTypes={width:P.number.isRequired,height:P.number.isRequired,onClick:P.func.isRequired,graphProps:t1.isRequired};static defaultProps={};componentDidMount(){let e=hu(this.rect);e.on(`click`,t=>this.onRectClick(e,t))}shouldComponentUpdate(e){return!p1(this.props.graphProps,e.graphProps)||this.props.width!==e.width||this.props.height!==e.height}getRectPadding=()=>{let{graphProps:e}=this.props;return e6(e)?6:10};onRectClick=(e,t)=>{let{onClick:n,graphProps:r}=this.props,{scale:i}=r,a=this.getRectPadding(),o=_u(t,e.node()),s=i.x.invert(o[0]-a),c=i.y.invert(o[1]-a),l=U3(r.range),u=U3(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,I.jsx)(`rect`,{ref:e=>this.rect=e,transform:`translate(-${n}, -${n})`,fill:`red`,fillOpacity:`0.0`,width:e+n*2,height:t+n*2})}},W6=Cm(`pie-lib:graphing-solution-set:graph`),G6={axesSettings:P.shape(p6),backgroundMarks:P.array,className:P.string,collapsibleToolbar:P.bool,collapsibleToolbarTitle:P.string,disabledLabels:P.bool,disabledTitle:P.bool,domain:J$,labels:P.shape(H6),labelModeEnabled:P.bool,coordinatesOnHover:P.bool,marks:P.array,onChangeLabels:P.func,onChangeMarks:P.func,onChangeTitle:P.func,range:J$,size:P.shape({width:P.number.isRequired,height:P.number.isRequired}),showLabels:P.bool,showPixelGuides:P.bool,showTitle:P.bool,title:P.string,tools:P.array},K6=e=>({x:-23,y:-23,width:e.width+46,height:e.height+46}),q6=({marks:e,currentTool:t})=>{let n=e.filter(e=>e.building)[0],r=tc(e);if(n&&t&&n.type!==t.type){let e=r.findIndex(e=>lc(e,n));e>=0&&r.splice(e,1)}return r},J6=class extends F.Component{constructor(e){super(e),this.maskUid=this.generateMaskId()}static propTypes={...G6,currentTool:P.object};static defaultProps={onChangeMarks:()=>{},disabledLabels:!1,disabledTitle:!1};state={};generateMaskId(){return`graph-`+(Math.random()*1e4).toFixed()}componentDidMount=()=>this.setState({labelNode:this.labelNode});changeMark=(e,t)=>{let{onChangeMarks:n,marks:r,gssLineData:i}=this.props;if(i?.selectedTool===`solutionSet`)return;let a=tc(r),o=a.findIndex(t=>lc(t,e));o>=0&&!a6(t,r,e)&&(a.splice(o,1,t),n(a))};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=tc(i);if(!t||!t.building&&a6(t,i))return;let o=a.findIndex(t=>lc(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,gssLineData:o,onSolutionSetSelected:s}=this.props;if(o){if(o.selectedTool===`solutionSet`){s(e);return}if(o.numberOfLines===1&&o.selectedTool===`lineA`&&a.length===1&&!a[0].building||o.numberOfLines===2&&o.selectedTool===`lineA`&&a.length===2||o.numberOfLines===2&&o.selectedTool===`lineA`&&a.length===1&&!a[0].building||o.numberOfLines===2&&o.selectedTool===`lineB`&&a.length===2&&!a[1].building)return}if(r||!i||[null,void 0].includes(t)||[null,void 0].includes(n))return;W6(`[onBgClick] x,y: `,t,n);let c=a.filter(e=>e.building)[0],l;l=c&&i&&c.type===i.type?i.addPoint({x:t,y:n},{...c}):i.addPoint({x:t,y:n},void 0),this.updateMarks(c,l,!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,showLabels:p,showPixelGuides:m,showTitle:h,titlePlaceholder:g,onChangeLabels:_,onChangeTitle:v,mathMlOptions:y={},gssLineData:b,disabled:x}=this.props,{marks:S}=this.props,C=e3(o,c,r,()=>this.rootNode),w=K6(r),T={graphProps:C,labelModeEnabled:d,gssLineData:b};S=q6({marks:S||[],currentTool:t});let E=S.filter(e=>e.type===`polygon`);b&&b.selectedTool===`solutionSet`&&b.sections.forEach(e=>{if(E.length===0||!o6(e,E[0].points)){let t={type:`polygon`,building:!1,closed:!0,points:e,isSolution:!1};x||S.push(t)}});let D=[];return D.push(...S.filter(e=>e.type===`polygon`)),D.push(...S.filter(e=>e.type===`line`)),(0,I.jsx)(G1,{rootRef:e=>this.rootNode=e,disabledTitle:a,disabledLabels:i,labels:u,labelsPlaceholders:f||{},showPixelGuides:m,showLabels:p,showTitle:h,title:l,titlePlaceholder:g,onChangeTitle:v,onChangeLabels:_,mathMlOptions:y,...T,children:(0,I.jsxs)(`g`,{transform:o&&o.padding&&o.range?`translate(${o.padding}, ${c.padding})`:void 0,children:[(0,I.jsx)(O6,{...T}),(0,I.jsx)(C6,{...e,...T}),(0,I.jsx)(U6,{...r,onClick:this.onBgClick,...T}),(0,I.jsxs)(`mask`,{id:`${this.maskUid}`,children:[(0,I.jsx)(`rect`,{...w,fill:`white`}),` `]}),(0,I.jsxs)(`g`,{id:`marks`,mask:`url('#${this.maskUid}')`,children:[(s||[]).map((e,t)=>{let n=this.getComponent(e),r=e.type;return(0,I.jsx)(n,{mark:{...e,disabled:!0,isBackground:!0},labelNode:this.state.labelNode,onClick:this.onBgClick,...T},`${r}-${t}-bg`)}),D.map((e,r)=>{let i=this.getComponent(e),a=e.type;return(0,I.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,...T},`${a}-${r}`)}),(0,I.jsx)(`foreignObject`,{ref:e=>this.labelNode=e,x:`0`,y:`0`,...r,style:{pointerEvents:`none`,fontSize:`14px`}})]})]})})}},Y6=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=Y6()}))();var X6=Symbol.for(`react.element`),Z6=Symbol.for(`react.portal`),Q6=Symbol.for(`react.fragment`),$6=Symbol.for(`react.strict_mode`),e8=Symbol.for(`react.profiler`),t8=Symbol.for(`react.consumer`),n8=Symbol.for(`react.context`),r8=Symbol.for(`react.forward_ref`),i8=Symbol.for(`react.suspense`),a8=Symbol.for(`react.suspense_list`),o8=Symbol.for(`react.memo`),s8=Symbol.for(`react.lazy`),c8=r8,l8=o8;function u8(e){if(typeof e==`object`&&e){let{$$typeof:t}=e;switch(t){case X6:switch(e=e.type,e){case Q6:case e8:case $6:case i8:case a8:return e;default:switch(e&&=e.$$typeof,e){case n8:case r8:case s8:case o8:return e;case t8:return e;default:return t}}case Z6:return t}}}function d8(e){return u8(e)===o8}function f8(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:a,areStatePropsEqual:o}){let s=!1,c,l,u,d,f;function p(i,a){return c=i,l=a,u=e(c,l),d=t(r,l),f=n(u,d,l),s=!0,f}function m(){return u=e(c,l),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function h(){return e.dependsOnOwnProps&&(u=e(c,l)),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function g(){let t=e(c,l),r=!o(t,u);return u=t,r&&(f=n(u,d,l)),f}function _(e,t){let n=!a(t,l),r=!i(e,c,t,l);return c=e,l=t,n&&r?m():n?h():r?g():f}return function(e,t){return s?_(e,t):p(e,t)}}function p8(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){return f8(t(e,i),n(e,i),r(e,i),e,i)}function m8(e,t){let n={};for(let r in e){let i=e[r];typeof i==`function`&&(n[r]=(...e)=>t(i(...e)))}return n}function h8(e){return function(t){let n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function g8(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function _8(e,t){return function(t,{displayName:n}){let r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=g8(e);let i=r(t,n);return typeof i==`function`&&(r.mapToProps=i,r.dependsOnOwnProps=g8(i),i=r(t,n)),i},r}}function v8(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function y8(e){return e&&typeof e==`object`?h8(t=>m8(e,t)):e?typeof e==`function`?_8(e,`mapDispatchToProps`):v8(e,`mapDispatchToProps`):h8(e=>({dispatch:e}))}function b8(e){return e?typeof e==`function`?_8(e,`mapStateToProps`):v8(e,`mapStateToProps`):h8(()=>({}))}function x8(e,t,n){return{...n,...e,...t}}function S8(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let i=!1,a;return function(t,n,o){let s=e(t,n,o);return i?r(s,a)||(a=s):(i=!0,a=s),a}}}function C8(e){return e?typeof e==`function`?S8(e):v8(e,`mergeProps`):()=>x8}function w8(e){e()}function T8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){w8(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var E8={notify(){},get:()=>[]};function D8(e,t){let n,r=E8,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=T8())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=E8)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var O8=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,k8=typeof navigator<`u`&&navigator.product===`ReactNative`,A8=O8||k8?F.useLayoutEffect:F.useEffect;function j8(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function M8(e,t){if(j8(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!j8(e[n[r]],t[n[r]]))return!1;return!0}var N8={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},P8={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},F8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},I8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},L8={[c8]:F8,[l8]:I8};function R8(e){return d8(e)?I8:L8[e.$$typeof]||N8}var z8=Object.defineProperty,B8=Object.getOwnPropertyNames,V8=Object.getOwnPropertySymbols,H8=Object.getOwnPropertyDescriptor,U8=Object.getPrototypeOf,W8=Object.prototype;function G8(e,t){if(typeof t!=`string`){if(W8){let n=U8(t);n&&n!==W8&&G8(e,n)}let n=B8(t);V8&&(n=n.concat(V8(t)));let r=R8(e),i=R8(t);for(let a=0;a<n.length;++a){let o=n[a];if(!P8[o]&&!(i&&i[o])&&!(r&&r[o])){let n=H8(t,o);try{z8(e,o,n)}catch{}}}}return e}var K8=Symbol.for(`react-redux-context`),q8=typeof globalThis<`u`?globalThis:{};function J8(){if(!F.createContext)return{};let e=q8[K8]??=new Map,t=e.get(F.createContext);return t||(t=F.createContext(null),e.set(F.createContext,t)),t}var Y8=J8(),X8=[null,null];function Z8(e,t,n){A8(()=>e(...t),n)}function Q8(e,t,n,r,i,a){e.current=r,n.current=!1,i.current&&(i.current=null,a())}function $8(e,t,n,r,i,a,o,s,c,l,u){if(!e)return()=>{};let d=!1,f=null,p=()=>{if(d||!s.current)return;let e=t.getState(),n,p;try{n=r(e,i.current)}catch(e){p=e,f=e}p||(f=null),n===a.current?o.current||l():(a.current=n,c.current=n,o.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}function e5(e,t){return e===t}function t5(e,t,n,{pure:r,areStatesEqual:i=e5,areOwnPropsEqual:a=M8,areStatePropsEqual:o=M8,areMergedPropsEqual:s=M8,forwardRef:c=!1,context:l=Y8}={}){let u=l,d=b8(e),f=y8(t),p=C8(n),m=!!e;return e=>{let t=e.displayName||e.name||`Component`,n=`Connect(${t})`,r={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:d,initMapDispatchToProps:f,initMergeProps:p,areStatesEqual:i,areStatePropsEqual:o,areOwnPropsEqual:a,areMergedPropsEqual:s};function l(t){let[n,i,a]=F.useMemo(()=>{let{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),o=F.useMemo(()=>{let e=u;return n?.Consumer,e},[n,u]),s=F.useContext(o),c=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=!!s&&!!s.store,d=c?t.store:s.store,f=l?s.getServerState:d.getState,p=F.useMemo(()=>p8(d.dispatch,r),[d]),[h,g]=F.useMemo(()=>{if(!m)return X8;let e=D8(d,c?void 0:s.subscription);return[e,e.notifyNestedSubs.bind(e)]},[d,c,s]),_=F.useMemo(()=>c?s:{...s,subscription:h},[c,s,h]),v=F.useRef(void 0),y=F.useRef(a),b=F.useRef(void 0),x=F.useRef(!1),S=F.useRef(!1),C=F.useRef(void 0);A8(()=>(S.current=!0,()=>{S.current=!1}),[]);let w=F.useMemo(()=>()=>b.current&&a===y.current?b.current:p(d.getState(),a),[d,a]),T=F.useMemo(()=>e=>h?$8(m,d,h,p,y,v,x,S,b,g,e):()=>{},[h]);Z8(Q8,[y,v,x,a,b,g]);let E;try{E=F.useSyncExternalStore(T,w,f?()=>p(f(),a):w)}catch(e){throw C.current&&(e.message+=`
360
+ The error may be correlated with this previous error:
361
+ ${C.current.stack}
362
+
363
+ `),e}A8(()=>{C.current=void 0,b.current=void 0,v.current=E});let D=F.useMemo(()=>F.createElement(e,{...E,ref:i}),[i,e,E]);return F.useMemo(()=>m?F.createElement(o.Provider,{value:_},D):D,[o,D,_])}let h=F.memo(l);if(h.WrappedComponent=e,h.displayName=l.displayName=n,c){let t=F.forwardRef(function(e,t){return F.createElement(h,{...e,reactReduxForwardedRef:t})});return t.displayName=n,t.WrappedComponent=e,G8(t,e)}return G8(h,e)}}var n5=t5;function r5(e){let{children:t,context:n,serverState:r,store:i}=e,a=F.useMemo(()=>{let e=D8(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),o=F.useMemo(()=>i.getState(),[i]);A8(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||Y8;return F.createElement(s.Provider,{value:a},t)}var i5=r5;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 o5=typeof Symbol==`function`&&Symbol.observable||`@@observable`,s5=()=>Math.random().toString(36).substring(7).split(``).join(`.`),c5={INIT:`@@redux/INIT${s5()}`,REPLACE:`@@redux/REPLACE${s5()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${s5()}`};function l5(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function u5(e,t,n){if(typeof e!=`function`)throw Error(a5(2));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(u5)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(a5(3));return i}function d(e){if(typeof e!=`function`)throw Error(a5(4));if(c)throw Error(a5(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(a5(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!l5(e))throw Error(a5(7));if(e.type===void 0)throw Error(a5(8));if(typeof e.type!=`string`)throw Error(a5(17));if(c)throw Error(a5(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(a5(10));r=e,f({type:c5.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(a5(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[o5](){return this}}}return f({type:c5.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[o5]:m}}function d5(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:c5.INIT})===void 0)throw Error(a5(12));if(n(void 0,{type:c5.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(a5(13))})}function f5(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{d5(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(a5(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function p5(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function m5(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(a5(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=p5(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}var h5=(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}},g5={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`},_5={undo(){return{type:g5.UNDO}},redo(){return{type:g5.REDO}},jumpToFuture(e){return{type:g5.JUMP_TO_FUTURE,index:e}},jumpToPast(e){return{type:g5.JUMP_TO_PAST,index:e}},jump(e){return{type:g5.JUMP,index:e}},clearHistory(){return{type:g5.CLEAR_HISTORY}}};function v5(e,t=[]){return Array.isArray(e)?e:typeof e==`string`?[e]:t}function y5(e){return typeof e.present<`u`&&typeof e.future<`u`&&typeof e.past<`u`&&Array.isArray(e.future)&&Array.isArray(e.past)}function b5(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 x5,S5,C5={prevState:`#9E9E9E`,action:`#03A9F4`,nextState:`#4CAF50`};function w5(){S5={header:[],prev:[],action:[],next:[],msgs:[]}}function T5(){let{header:e,prev:t,next:n,action:r,msgs:i}=S5;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 E5(e,t,n){return[`%c${e}`,`color: ${t}; font-weight: bold`,n]}function D5(e,t){w5(),x5&&(console.group?(S5.header=[`%credux-undo`,`font-style: italic`,`action`,e.type],S5.action=E5(`action`,C5.action,e),S5.prev=E5(`prev history`,C5.prevState,t)):(S5.header=[`redux-undo action`,e.type],S5.action=[`action`,e],S5.prev=[`prev history`,t]))}function O5(e){x5&&(console.group?S5.next=E5(`next history`,C5.nextState,e):S5.next=[`next history`,e],T5())}function k5(...e){x5&&(S5.msgs=S5.msgs.concat([...e,`
364
+ `]))}function A5(e){x5=e}function j5(e,t){let n=b5([],e,[]);return t&&(n._latestUnfiltered=null),n}function M5(e,t,n,r){let i=e.past.length+1;k5(`inserting`,t),k5(`new free: `,n-i);let{past:a,_latestUnfiltered:o}=e,s=n&&n<=i,c=a.slice(+!!s);return b5(o==null?c:[...c,o],t,[],r)}function N5(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 b5(a,o,r.slice(t+1))}function P5(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 b5(a,s,o)}function F5(e,t){return t>0?N5(e,t-1):t<0?P5(e,e.past.length+t):e}function I5(e,t){return t.indexOf(e)>-1?e:!e}function L5(e,t={}){A5(t.debug);let n={limit:void 0,filter:()=>!0,groupBy:()=>null,undoType:g5.UNDO,redoType:g5.REDO,jumpToPastType:g5.JUMP_TO_PAST,jumpToFutureType:g5.JUMP_TO_FUTURE,jumpType:g5.JUMP,neverSkipReducer:!1,ignoreInitialState:!1,syncFilter:!1,...t,initTypes:v5(t.initTypes,[`@@redux-undo/INIT`]),clearHistoryType:v5(t.clearHistoryType,[g5.CLEAR_HISTORY])},r=n.neverSkipReducer?(t,n,...r)=>({...t,present:e(t.present,n,...r)}):e=>e,i;return(t=i,a={},...o)=>{D5(a,t);let s=t;if(!i){if(k5(`history is uninitialized`),t===void 0)return s=j5(e(t,{type:`@@redux-undo/CREATE_HISTORY`},...o),n.ignoreInitialState),k5(`do not set initialState on probe actions`),O5(s),s;y5(t)?(s=i=n.ignoreInitialState?t:b5(t.past,t.present,t.future),k5(`initialHistory initialized: initialState is a history`,i)):(s=i=j5(t,n.ignoreInitialState),k5(`initialHistory initialized: initialState is not a history`,i))}let c;switch(a.type){case void 0:return s;case n.undoType:return c=F5(s,-1),k5(`perform undo`),O5(c),r(c,a,...o);case n.redoType:return c=F5(s,1),k5(`perform redo`),O5(c),r(c,a,...o);case n.jumpToPastType:return c=P5(s,a.index),k5(`perform jumpToPast to ${a.index}`),O5(c),r(c,a,...o);case n.jumpToFutureType:return c=N5(s,a.index),k5(`perform jumpToFuture to ${a.index}`),O5(c),r(c,a,...o);case n.jumpType:return c=F5(s,a.index),k5(`perform jump to ${a.index}`),O5(c),r(c,a,...o);case I5(a.type,n.clearHistoryType):return c=j5(s.present,n.ignoreInitialState),k5(`perform clearHistory`),O5(c),r(c,a,...o);default:if(c=e(s.present,a,...o),n.initTypes.some(e=>e===a.type))return k5(`reset history due to init action`),O5(i),i;if(s._latestUnfiltered===c)return s;if(typeof n.filter==`function`&&!n.filter(a,c,s)){let e=b5(s.past,c,s.future,s.group);return n.syncFilter||(e._latestUnfiltered=s._latestUnfiltered),k5(`filter ignored action, not storing it in past`),O5(e),e}let t=n.groupBy(a,c,s);if(t!=null&&t===s.group){let e=b5(s.past,c,s.future,s.group);return k5(`groupBy grouped the action with the previous action`),O5(e),e}return s=M5(s,c,n.limit,t),k5(`inserted new state into history`),O5(s),s}}}var R5=()=>f5({marks:L5(h5,{debug:!1})}),z5=e=>({type:`CHANGE_MARKS`,marks:e}),B5=F.createContext({});function V5(e){return aa(`MuiAccordion`,e)}var H5=oa(`MuiAccordion`,[`root`,`heading`,`rounded`,`expanded`,`disabled`,`gutters`,`region`]),U5=e=>{let{classes:t,square:n,expanded:r,disabled:i,disableGutters:a}=e;return Oo({root:[`root`,!n&&`rounded`,r&&`expanded`,i&&`disabled`,!a&&`gutters`],heading:[`heading`],region:[`region`]},V5,t)},W5=z(qf,{name:`MuiAccordion`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${H5.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(vf(({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`}},[`&.${H5.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:`none`}}},[`&.${H5.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),vf(({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:{[`&.${H5.expanded}`]:{margin:`16px 0`}}}]}))),G5=z(`h3`,{name:`MuiAccordion`,slot:`Heading`})({all:`unset`}),K5=z(`div`,{name:`MuiAccordion`,slot:`Region`})({}),q5=F.forwardRef(function(e,t){let n=Ju({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]=ap({controlled:c,default:a,name:`Accordion`,state:`expanded`}),_=F.useCallback(e=>{g(!h),l&&l(e,!h)},[h,l,g]),[v,...y]=F.Children.toArray(r),b=F.useMemo(()=>({expanded:h,disabled:o,disableGutters:s,toggle:_}),[h,o,s,_]),x={...n,disabled:o,disableGutters:s,expanded:h},S=U5(x),C={slots:{transition:f,...u},slotProps:{transition:p,...d}},[w,T]=wf(`root`,{elementType:W5,externalForwardedProps:{...C,...m},className:L(S.root,i),shouldForwardComponentProp:!0,ownerState:x,ref:t}),[E,D]=wf(`heading`,{elementType:G5,externalForwardedProps:C,className:S.heading,ownerState:x}),[O,k]=wf(`transition`,{elementType:Lm,externalForwardedProps:C,ownerState:x}),[A,j]=wf(`region`,{elementType:K5,externalForwardedProps:C,ownerState:x,className:S.region,additionalProps:{"aria-labelledby":v.props.id,id:v.props[`aria-controls`],role:`region`}});return(0,I.jsxs)(w,{...T,children:[(0,I.jsx)(E,{...D,children:(0,I.jsx)(B5.Provider,{value:b,children:v})}),(0,I.jsx)(O,{in:h,timeout:`auto`,...k,children:(0,I.jsx)(A,{...j,children:y})})]})});function J5(e){return aa(`MuiAccordionDetails`,e)}oa(`MuiAccordionDetails`,[`root`]);var Y5=e=>{let{classes:t}=e;return Oo({root:[`root`]},J5,t)},X5=z(`div`,{name:`MuiAccordionDetails`,slot:`Root`})(vf(({theme:e})=>({padding:e.spacing(1,2,2)}))),Z5=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiAccordionDetails`}),{className:r,...i}=n,a=n,o=Y5(a);return(0,I.jsx)(X5,{className:L(o.root,r),ref:t,ownerState:a,...i})});function Q5(e){return aa(`MuiAccordionSummary`,e)}var $5=oa(`MuiAccordionSummary`,[`root`,`expanded`,`focusVisible`,`disabled`,`gutters`,`contentGutters`,`content`,`expandIconWrapper`]),e7=e=>{let{classes:t,expanded:n,disabled:r,disableGutters:i}=e;return Oo({root:[`root`,n&&`expanded`,r&&`disabled`,!i&&`gutters`],focusVisible:[`focusVisible`],content:[`content`,n&&`expanded`,!i&&`contentGutters`],expandIconWrapper:[`expandIconWrapper`,n&&`expanded`]},Q5,t)},t7=z(ih,{name:`MuiAccordionSummary`,slot:`Root`})(vf(({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),[`&.${$5.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${$5.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${$5.disabled})`]:{cursor:`pointer`},variants:[{props:e=>!e.disableGutters,style:{[`&.${$5.expanded}`]:{minHeight:64}}}]}})),n7=z(`span`,{name:`MuiAccordionSummary`,slot:`Content`})(vf(({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}),[`&.${$5.expanded}`]:{margin:`20px 0`}}}]}))),r7=z(`span`,{name:`MuiAccordionSummary`,slot:`ExpandIconWrapper`})(vf(({theme:e})=>({display:`flex`,color:(e.vars||e).palette.action.active,transform:`rotate(0deg)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shortest}),[`&.${$5.expanded}`]:{transform:`rotate(180deg)`}}))),i7=F.forwardRef(function(e,t){let n=Ju({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}=F.useContext(B5),h=e=>{m&&m(e),s&&s(e)},g={...n,expanded:p,disabled:d,disableGutters:f},_=e7(g),v={slots:c,slotProps:l},[y,b]=wf(`root`,{ref:t,shouldForwardComponentProp:!0,className:L(_.root,i),elementType:t7,externalForwardedProps:{...v,...u},ownerState:g,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:d,"aria-expanded":p,focusVisibleClassName:L(_.focusVisible,o)},getSlotProps:e=>({...e,onClick:t=>{e.onClick?.(t),h(t)}})}),[x,S]=wf(`content`,{className:_.content,elementType:n7,externalForwardedProps:v,ownerState:g}),[C,w]=wf(`expandIconWrapper`,{className:_.expandIconWrapper,elementType:r7,externalForwardedProps:v,ownerState:g});return(0,I.jsxs)(y,{...b,children:[(0,I.jsx)(x,{...S,children:r}),a&&(0,I.jsx)(C,{...w,children:a})]})});function a7(e){return aa(`PrivateSwitchBase`,e)}oa(`PrivateSwitchBase`,[`root`,`checked`,`disabled`,`input`,`edgeStart`,`edgeEnd`]);var o7=e=>{let{classes:t,checked:n,disabled:r,edge:i}=e;return Oo({root:[`root`,n&&`checked`,r&&`disabled`,i&&`edge${V(i)}`],input:[`input`]},a7,t)},s7=z(ih,{name:`MuiSwitchBase`})({padding:9,borderRadius:`50%`,variants:[{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e===`start`&&t.size!==`small`,style:{marginLeft:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e===`end`&&t.size!==`small`,style:{marginRight:-12}}]}),c7=z(`input`,{name:`MuiSwitchBase`,shouldForwardProp:Us})({cursor:`inherit`,position:`absolute`,opacity:0,width:`100%`,height:`100%`,top:0,left:0,margin:0,padding:0,zIndex:1}),l7=F.forwardRef(function(e,t){let{autoFocus:n,checked:r,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:s=!1,edge:c=!1,icon:l,id:u,inputProps:d,inputRef:f,name:p,onBlur:m,onChange:h,onFocus:g,readOnly:_,required:v=!1,tabIndex:y,type:b,value:x,slots:S={},slotProps:C={},...w}=e,[T,E]=ap({controlled:r,default:!!a,name:`SwitchBase`,state:`checked`}),D=Jh(),O=e=>{g&&g(e),D&&D.onFocus&&D.onFocus(e)},k=e=>{m&&m(e),D&&D.onBlur&&D.onBlur(e)},A=e=>{if(e.nativeEvent.defaultPrevented||_)return;let t=e.target.checked;E(t),h&&h(e,t)},j=o;D&&j===void 0&&(j=D.disabled);let M=b===`checkbox`||b===`radio`,ee={...e,checked:T,disabled:j,disableFocusRipple:s,edge:c},N=o7(ee),te={slots:S,slotProps:{input:d,...C}},[ne,re]=wf(`root`,{ref:t,elementType:s7,className:N.root,shouldForwardComponentProp:!0,externalForwardedProps:{...te,component:`span`,...w},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),O(t)},onBlur:t=>{e.onBlur?.(t),k(t)}}),ownerState:ee,additionalProps:{centerRipple:!0,focusRipple:!s,role:void 0,tabIndex:null}}),[ie,ae]=wf(`input`,{ref:f,elementType:c7,className:N.input,externalForwardedProps:te,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),A(t)}}),ownerState:ee,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:j,id:M?u:void 0,name:p,readOnly:_,required:v,tabIndex:y,type:b,...b===`checkbox`&&x===void 0?{}:{value:x}}});return(0,I.jsxs)(ne,{...re,children:[(0,I.jsx)(ie,{...ae}),T?i:l]})}),u7=ep((0,I.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z`}),`RadioButtonUnchecked`),d7=ep((0,I.jsx)(`path`,{d:`M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z`}),`RadioButtonChecked`),f7=z(`span`,{name:`MuiRadioButtonIcon`,shouldForwardProp:Us})({position:`relative`,display:`flex`}),p7=z(u7,{name:`MuiRadioButtonIcon`})({transform:`scale(1)`}),m7=z(d7,{name:`MuiRadioButtonIcon`})(vf(({theme:e})=>({left:0,position:`absolute`,transform:`scale(0)`,transition:e.transitions.create(`transform`,{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:`scale(1)`,transition:e.transitions.create(`transform`,{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function h7(e){let{checked:t=!1,classes:n={},fontSize:r}=e,i={...e,checked:t};return(0,I.jsxs)(f7,{className:n.root,ownerState:i,children:[(0,I.jsx)(p7,{fontSize:r,className:n.background,ownerState:i}),(0,I.jsx)(m7,{fontSize:r,className:n.dot,ownerState:i})]})}var g7=F.createContext(void 0);function _7(){return F.useContext(g7)}function v7(e){return aa(`MuiRadio`,e)}var y7=oa(`MuiRadio`,[`root`,`checked`,`disabled`,`colorPrimary`,`colorSecondary`,`sizeSmall`]),b7=e=>{let{classes:t,color:n,size:r}=e,i={root:[`root`,`color${V(n)}`,r!==`medium`&&`size${V(r)}`]};return{...t,...Oo(i,v7,t)}},x7=z(l7,{shouldForwardProp:e=>Us(e)||e===`classes`,name:`MuiRadio`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size!==`medium`&&t[`size${V(n.size)}`],t[`color${V(n.color)}`]]}})(vf(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${y7.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:`default`,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ch()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ch()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${y7.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:`transparent`}}}}]})));function S7(e,t){return typeof t==`object`&&t?e===t:String(e)===String(t)}var C7=(0,I.jsx)(h7,{checked:!0}),w7=(0,I.jsx)(h7,{}),T7=F.forwardRef(function(e,t){let n=Ju({props:e,name:`MuiRadio`}),{checked:r,checkedIcon:i=C7,color:a=`primary`,icon:o=w7,name:s,onChange:c,size:l=`medium`,className:u,disabled:d,disableRipple:f=!1,slots:p={},slotProps:m={},inputProps:h,...g}=n,_=Jh(),v=d;_&&v===void 0&&(v=_.disabled),v??=!1;let y={...n,disabled:v,disableRipple:f,color:a,size:l},b=b7(y),x=_7(),S=r,C=Yf(c,x&&x.onChange),w=s;x&&(S===void 0&&(S=S7(x.value,n.value)),w===void 0&&(w=x.name));let T=m.input??h,[E,D]=wf(`root`,{ref:t,elementType:x7,className:L(b.root,u),shouldForwardComponentProp:!0,externalForwardedProps:{slots:p,slotProps:m,...g},getSlotProps:e=>({...e,onChange:(t,...n)=>{e.onChange?.(t,...n),C(t,...n)}}),ownerState:y,additionalProps:{type:`radio`,icon:F.cloneElement(o,{fontSize:o.props.fontSize??l}),checkedIcon:F.cloneElement(i,{fontSize:i.props.fontSize??l}),disabled:v,name:w,checked:S,slots:p,slotProps:{input:typeof T==`function`?T(y):T}}});return(0,I.jsx)(E,{...D,classes:b})}),E7=class extends F.Component{static propTypes={gssLineData:P.object,disabled:P.bool,onChange:P.func};onChangeRadioValue=e=>{let{gssLineData:t,onChange:n}=this.props,r=t.selectedTool;t.selectedTool=e.target.value,n(t,r)};lineTypeChange=(e,t)=>{let{gssLineData:n,onChange:r}=this.props,i=n.selectedTool;n[`line${e}`].lineType=t,r(n,i)};render(){let{gssLineData:e,disabled:t}=this.props;return(0,I.jsx)(D7,{children:(0,I.jsxs)(`div`,{className:`selectLineRadioGroup`,children:[(0,I.jsxs)(`div`,{className:`radioFieldOuter`,children:[(0,I.jsxs)(`div`,{className:`radioFieldInner`,children:[(0,I.jsx)(T7,{name:`select-line-radio-buttons`,onChange:this.onChangeRadioValue,value:`lineA`,disabled:!!t,checked:e.selectedTool===`lineA`,className:`lineTypeRadio`}),(0,I.jsx)(JG,{className:`lineNameFont`,children:`Line A`})]}),(0,I.jsxs)(`div`,{className:`radioFieldButtons`,children:[(0,I.jsxs)(Mh,{size:`small`,variant:`contained`,color:e.lineA.lineType===`Solid`?`primary`:`inherit`,disabled:!!t,onClick:()=>this.lineTypeChange(`A`,`Solid`),className:e.lineA.lineType===`Solid`?t?`lineTypeButtonLeftSelectedDisabled`:`lineTypeButtonLeftSelected`:t?`lineTypeButtonLeftUnSelectedDisabled`:`lineTypeButtonLeftUnSelected`,children:[e.lineA.lineType===`Solid`&&`✔`,` Solid`]}),(0,I.jsxs)(Mh,{size:`small`,variant:`contained`,color:e.lineA.lineType===`Dashed`?`primary`:`inherit`,disabled:!!t,onClick:()=>this.lineTypeChange(`A`,`Dashed`),className:e.lineA.lineType===`Dashed`?t?`lineTypeButtonRightSelectedDisabled`:`lineTypeButtonRightSelected`:t?`lineTypeButtonRightUnSelectedDisabled`:`lineTypeButtonRightUnSelected`,children:[e.lineA.lineType===`Dashed`&&`✔`,` Dashed`]})]})]}),e.numberOfLines===2&&(0,I.jsxs)(`div`,{className:`radioFieldOuter`,children:[(0,I.jsxs)(`div`,{className:`radioFieldInner`,children:[(0,I.jsx)(T7,{name:`select-line-radio-buttons`,onChange:this.onChangeRadioValue,value:`lineB`,disabled:!!t,checked:e.selectedTool===`lineB`,className:`lineTypeRadio`}),(0,I.jsx)(JG,{className:`lineNameFont`,children:`Line B`})]}),(0,I.jsxs)(`div`,{className:`radioFieldButtons`,children:[(0,I.jsxs)(Mh,{size:`small`,variant:`contained`,color:e.lineB.lineType===`Solid`?`primary`:`inherit`,disabled:!!t,onClick:()=>this.lineTypeChange(`B`,`Solid`),className:e.lineB.lineType===`Solid`?t?`lineTypeButtonLeftSelectedDisabled`:`lineTypeButtonLeftSelected`:t?`lineTypeButtonLeftUnSelectedDisabled`:`lineTypeButtonLeftUnSelected`,children:[e.lineB.lineType===`Solid`&&`✔`,` Solid`]}),(0,I.jsxs)(Mh,{size:`small`,variant:`contained`,color:e.lineB.lineType===`Dashed`?`primary`:`inherit`,disabled:!!t,onClick:()=>this.lineTypeChange(`B`,`Dashed`),className:e.lineB.lineType===`Dashed`?t?`lineTypeButtonRightSelectedDisabled`:`lineTypeButtonRightSelected`:t?`lineTypeButtonRightUnSelectedDisabled`:`lineTypeButtonRightUnSelected`,children:[e.lineB.lineType===`Dashed`&&`✔`,` Dashed`]})]})]}),(0,I.jsx)(`div`,{className:`radioFieldOuter`,children:(0,I.jsxs)(`div`,{className:`radioFieldInner`,children:[(0,I.jsx)(T7,{name:`select-line-radio-buttons`,onChange:this.onChangeRadioValue,value:`solutionSet`,disabled:!!t,checked:e.selectedTool===`solutionSet`,className:`lineTypeRadio`}),(0,I.jsx)(JG,{className:`lineNameFont`,children:`Solution Set`})]})})]})})}},D7=z(`div`)(()=>({"& .selectLineRadioGroup":{display:`flex`,flexWrap:`wrap`,flexDirection:`row`},"& .radioFieldOuter":{display:`flex`,flexWrap:`wrap`,flexDirection:`column`},"& .radioFieldInner":{display:`flex`,flexWrap:`wrap`,flexDirection:`row`,alignItems:`center`},"& .radioFieldButtons":{display:`flex`,flexWrap:`wrap`,flexDirection:`row`,padding:`0 .9rem`},"& .lineNameFont":{fontWeight:`bold`,padding:`0 5px 0 0`},"& .lineTypeRadio":{color:`#000000 !important`},"& .lineTypeButtonLeftSelected":{textTransform:`none`,border:`1px solid #3E4EB1`,backgroundColor:`#3E4EB1 !important`,color:`#FFFFFF !important`,borderRadius:`4px 0 0 4px`},"& .lineTypeButtonLeftUnSelected":{textTransform:`none`,border:`1px solid #3E4EB1`,backgroundColor:`#FFFFFF !important`,color:`#3E4EB1 !important`,borderRadius:`4px 0 0 4px`},"& .lineTypeButtonRightSelected":{textTransform:`none`,border:`1px solid #3E4EB1`,backgroundColor:`#3E4EB1 !important`,color:`#FFFFFF !important`,borderRadius:`0 4px 4px 0`},"& .lineTypeButtonRightUnSelected":{textTransform:`none`,border:`1px solid #3E4EB1`,backgroundColor:`#FFFFFF !important`,color:`#3E4EB1 !important`,borderRadius:`0 4px 4px 0`},"& .lineTypeButtonLeftSelectedDisabled, & .lineTypeButtonRightSelectedDisabled":{backgroundColor:`#3E4EB1 !important`,color:`#FFFFFF !important`,cursor:`default`,pointerEvents:`none`},"& .lineTypeButtonLeftUnSelectedDisabled, & .lineTypeButtonRightUnSelectedDisabled":{backgroundColor:`#FFFFFF !important`,color:`#3E4EB1 !important`,cursor:`default`,pointerEvents:`none`}})),O7={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.`},mcPopulatedBlank:{answerChoices:`Answer choices`,blankLabel:`blank`,emptyBlank:`(blank)`,blankPreSelectionHint:`The answer you choose will appear on the blank line above.`,correctAnswerSelected:`Correct answer selected`,incorrectAnswerSelected:`Incorrect answer selected`,selectedAnswerImage:`Selected answer image`,choiceImage:`Choice {{id}}`,clickToEnableAutoplay:`Click to enable audio autoplay`,audioResourceUnavailable:`Audio is enabled but no playable audio URL is configured.`,listen:`Listen`,listenSilentAlt:`Repeat instructions`,listenPlayingAlt:`Instructions are playing`,printAudio:`Audio:`,printTranscript:`Transcript:`},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`},simpleCloze:{correctAnswerShown:`Correct answer`,correct:`Correct`,incorrect:`Incorrect`,unanswered:`No answer`,placeholder:`Enter your answer...`,answerInput:`Your answer`,printCorrectAnswer:`Correct answer:`,printAnswerBlank:`Answer blank`},vennClassification:{tray:`Tiles to classify`,unknownTarget:`unknown`,cancelled:`Cancelled`,returnedToTray:`{{name}} returned to tray`,placedIn:`{{name}} placed in {{target}}`,pickedUp:`Picked up {{name}}`,pickedUpWithKeyboard:`Picked up {{name}}, drop target: {{target}}. Use arrow keys to choose a drop target, Enter to drop, Escape to cancel.`,dropTarget:`Drop target: {{target}}`,unsupportedCircles_one:`This diagram cannot be shown: it has {{count}} circle, and only {{supported}} are supported.`,unsupportedCircles_other:`This diagram cannot be shown: it has {{count}} circles, and only {{supported}} are supported.`,setNumber:`Set {{number}}`,regionOnly:`{{set}} only`,regionNeither:`Neither {{first}} nor {{second}}`,regionNoneOf:`None of {{sets}}`,regionAndSeparator:` and `,tileFallbackName:`Tile`,tileNotPlaced:`not placed`,tileInRegion:`in {{region}}`,tileCorrect:`correct`,tileIncorrect:`incorrect`}},common:{undo:`Undo`,clearAll:`Clear all`,correct:`Correct`,incorrect:`Incorrect`,showCorrectAnswer:`Show correct answer`,hideCorrectAnswer:`Hide correct answer`,showTeacherInstructions:`Show Teacher Instructions`,hideTeacherInstructions:`Hide Teacher Instructions`,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`}},k7={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.`},mcPopulatedBlank:{answerChoices:`Opciones de respuesta`,blankLabel:`espacio en blanco`,emptyBlank:`(en blanco)`,blankPreSelectionHint:`La respuesta que elijas aparecerá en la línea en blanco de arriba.`,correctAnswerSelected:`Respuesta correcta seleccionada`,incorrectAnswerSelected:`Respuesta incorrecta seleccionada`,selectedAnswerImage:`Imagen de la respuesta seleccionada`,choiceImage:`Opción {{id}}`,clickToEnableAutoplay:`Haz clic para activar la reproducción automática del audio`,audioResourceUnavailable:`El audio está activado, pero no hay una URL de audio reproducible configurada.`,listen:`Escuchar`,listenSilentAlt:`Escuchar. Repetir las instrucciones.`,listenPlayingAlt:`Escuchar. Estas son las instrucciones.`,printAudio:`Audio:`,printTranscript:`Transcripción:`},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`},simpleCloze:{correctAnswerShown:`Respuesta correcta`,correct:`Correcto`,incorrect:`Incorrecto`,unanswered:`Sin respuesta`,placeholder:`Escribe tu respuesta...`,answerInput:`Tu respuesta`,printCorrectAnswer:`Respuesta correcta:`,printAnswerBlank:`Espacio para la respuesta`},vennClassification:{tray:`Fichas para clasificar`,unknownTarget:`desconocido`,cancelled:`Cancelado`,returnedToTray:`Se devolvió {{name}} a la bandeja`,placedIn:`Se colocó {{name}} en {{target}}`,pickedUp:`Se tomó {{name}}`,pickedUpWithKeyboard:`Se tomó {{name}}, destino: {{target}}. Usa las flechas para elegir un destino, Enter para soltar y Escape para cancelar.`,dropTarget:`Destino: {{target}}`,unsupportedCircles_one:`No se puede mostrar este diagrama: tiene {{count}} círculo, y solo se admiten {{supported}}.`,unsupportedCircles_other:`No se puede mostrar este diagrama: tiene {{count}} círculos, y solo se admiten {{supported}}.`,setNumber:`Conjunto {{number}}`,regionOnly:`Solo {{set}}`,regionNeither:`Ni {{first}} ni {{second}}`,regionNoneOf:`Ninguno de {{sets}}`,regionAndSeparator:` y `,tileFallbackName:`Ficha`,tileNotPlaced:`sin colocar`,tileInRegion:`en {{region}}`,tileCorrect:`correcta`,tileIncorrect:`incorrecta`}},common:{undo:`Deshacer`,clearAll:`Borrar todo`,correct:`Correcto`,incorrect:`Incorrecto`,showCorrectAnswer:`Mostrar respuesta correcta`,hideCorrectAnswer:`Ocultar respuesta correcta`,showTeacherInstructions:`Mostrar instrucciones para el maestro`,hideTeacherInstructions:`Ocultar instrucciones para el maestro`,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`}},A7=e=>typeof e==`string`,j7=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},M7=e=>e==null?``:``+e,Ste=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Cte=/###/g,N7=e=>e&&e.indexOf(`###`)>-1?e.replace(Cte,`.`):e,P7=e=>!e||A7(e),F7=(e,t,n)=>{let r=A7(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(P7(e))return{};let t=N7(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return P7(e)?{}:{obj:e,k:N7(r[i])}},I7=(e,t,n)=>{let{obj:r,k:i}=F7(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=F7(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=F7(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},wte=(e,t,n,r)=>{let{obj:i,k:a}=F7(e,t,Object);i[a]=i[a]||[],i[a].push(n)},L7=(e,t)=>{let{obj:n,k:r}=F7(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Tte=(e,t,n)=>{let r=L7(e,n);return r===void 0?L7(t,n):r},R7=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?A7(e[r])||e[r]instanceof String||A7(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):R7(e[r],t[r],n):e[r]=t[r]);return e},z7=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Ete={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Dte=e=>A7(e)?e.replace(/[&<>"'\/]/g,e=>Ete[e]):e,Ote=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}},kte=[` `,`,`,`?`,`!`,`;`],Ate=new Ote(20),jte=(e,t,n)=>{t||=``,n||=``;let r=kte.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Ate.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},B7=(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},V7=e=>e?.replace(/_/g,`-`),Mte={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)}},H7=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Mte,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:(A7(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)}},U7=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])})}},W7=class extends U7{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):A7(n)&&i?o.push(...n.split(i)):o.push(n)));let s=L7(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!A7(n)?s:B7(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),I7(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)(A7(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=L7(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?R7(s,n,i):s={...s,...n},I7(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}},G7={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}},K7=Symbol(`i18next/PATH_KEY`);function Nte(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===K7?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function q7(e,t){let{[K7]:n}=e(Nte()),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 J7={},Y7=e=>!A7(e)&&typeof e!=`boolean`&&typeof e!=`number`,X7=class e extends U7{constructor(e,t={}){super(),Ste([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=H7.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=Y7(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&&!jte(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:A7(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:A7(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=q7(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?q7(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&&!A7(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=Y7(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(O)<0&&!(A7(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:Y7(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&&A7(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=A7(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&&!A7(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=A7(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=G7.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 A7(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?q7(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&&!A7(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(A7(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,!J7[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(J7[`${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&&!A7(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}},Z7=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=H7.create(`languageUtils`)}getScriptPartFromCode(e){if(e=V7(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=V7(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(A7(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)),A7(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 A7(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))):A7(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},Q7={zero:0,one:1,two:2,few:3,many:4,other:5},$7={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Pte=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=H7.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=V7(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!`),$7;if(!e.match(/-|_/))return $7;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)=>Q7[e]-Q7[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))}},e9=(e,t,n,r=`.`,i=!0)=>{let a=Tte(e,t,n);return!a&&i&&A7(n)&&(a=B7(e,n,r),a===void 0&&(a=B7(t,n,r))),a},t9=e=>e.replace(/\$/g,`$$$$`),n9=class{constructor(e={}){this.logger=H7.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?Dte:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?z7(i):a||`{{`,this.suffix=o?z7(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?z7(d):f||z7(`$t(`),this.nestingSuffix=p?z7(p):m||z7(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,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=e9(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(e9(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=>t9(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?t9(this.escape(e)):t9(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=A7(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!A7(a)&&!this.useRawValueToEscape&&(a=M7(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(`${z7(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&&!A7(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&&!A7(i))return i;A7(i)||(i=M7(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}},Fte=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}},r9=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(V7(r),i),t[o]=s),s(n)}},Ite=e=>(t,n,r)=>e(V7(n),r)(t),Lte=class{constructor(e={}){this.logger=H7.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?r9:Ite;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()]=r9(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}=Fte(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)}},Rte=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},zte=class extends U7{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=H7.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=>{wte(n.loaded,[i],a),Rte(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();A7(e)&&(e=this.languageUtils.toResolveHierarchy(e)),A7(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)}}},i9=()=>({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]),A7(e[1])&&(t.defaultValue=e[1]),A7(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}),a9=e=>(A7(e.ns)&&(e.ns=[e.ns]),A7(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),A7(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),o9=()=>{},Bte=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},s9=`__i18next_supportNoticeShown`,Vte=()=>!!(typeof globalThis<`u`&&globalThis[s9]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env),Hte=()=>{typeof globalThis<`u`&&(globalThis[s9]=!0)},Ute=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)),c9=class e extends U7{constructor(e={},t){if(super(),this.options=a9(e),this.services={},this.logger=H7,this.modules={external:[]},Bte(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&&(A7(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=i9();this.options={...n,...this.options,...a9(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&&!Ute(this)&&!Vte()&&(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 💙`),Hte());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?H7.init(r(this.modules.logger),this.options):H7.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Lte;let t=new Z7(this.options);this.store=new W7(this.options.resources,this.options);let i=this.services;i.logger=H7,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Pte(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 n9(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new zte(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 X7(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||=o9,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=j7(),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=o9){let n=t,r=A7(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=j7();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||=o9,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`&&G7.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=j7();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=A7(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(A7(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=q7(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=q7(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=q7(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return A7(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=j7();return this.options.ns?(A7(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=j7();A7(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 Z7(i9());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=o9){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 W7(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={...i9().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new n9(n)}return a.translator=new X7(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();c9.createInstance,c9.dir,c9.init,c9.loadResources,c9.reloadResources,c9.use,c9.changeLanguage,c9.getFixedT,c9.t,c9.exists,c9.setDefaultNamespace,c9.hasLoadedNamespace,c9.loadNamespaces,c9.loadLanguages,c9.init({fallbackLng:`en`,lng:`en`,showSupportNotice:!1,resources:{en:O7,es:k7}});var l9={translator:{...c9,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 c9.t(e,{lng:n,...t})}},languageOptions:[{value:`en_US`,label:`English (US)`},{value:`es_ES`,label:`Spanish`}]},{translator:Wte}=l9,Gte=z(Mh)(({theme:e})=>({color:Sp(),fontWeight:`bold`,marginBottom:e.spacing(.5),"&:not(:last-of-type)":{marginRight:e.spacing(.5)}})),Kte=class extends F.Component{static propTypes={className:P.string,onReset:P.func.isRequired,language:P.string};static defaultProps={};render(){let{className:e,onReset:t=!1,language:n}=this.props;return(0,I.jsx)(`div`,{className:e,children:(0,I.jsx)(Gte,{onClick:()=>t(),children:Wte.t(`graphing.reset`,{lng:n})})})}},qte={mark:P.any,onChange:P.func,onDragStart:P.func,onDragStop:P.func},u9=(e=`fill`)=>({[e]:H.DISABLED,pointerEvents:`none`}),d9=(e=`fill`)=>({[e]:Ep(),pointerEvents:`none`}),f9=(e=`fill`)=>({[e]:Ap(),pointerEvents:`none`}),p9=(e=`fill`)=>({[e]:Np(),pointerEvents:`none`}),Jte=z(`polygon`,{shouldForwardProp:e=>![`isSolution`,`correctness`].includes(e)})(({isSolution:e,correctness:t})=>({fill:e?`rgb(60, 73, 150, 0.6)`:`transparent`,strokeWidth:2,"&:hover":{fill:e?`rgb(60, 73, 150, 0.6)`:`rgb(0, 0, 0, 0.25)`},...t===`correct`&&d9(`stroke`),...t===`incorrect`&&f9(`stroke`)})),Yte=z(`polyline`,{shouldForwardProp:e=>![`isSolution`,`correctness`].includes(e)})(({isSolution:e,correctness:t})=>({fill:e?`rgb(60, 73, 150, 0.6)`:`transparent`,strokeWidth:2,"&:hover":{fill:e?`rgb(60, 73, 150, 0.6)`:`rgb(0, 0, 0, 0.25)`},...t===`correct`&&d9(`stroke`),...t===`incorrect`&&f9(`stroke`)})),Xte=(e,t)=>(e||[]).map(e=>{let n={x:t.x(e.x),y:t.y(e.y)};return`${n.x},${n.y}`}).join(` `),Zte=class extends F.Component{static propTypes={className:P.string,isSolution:P.bool,points:P.arrayOf(Z$),graphProps:t1.isRequired,closed:P.bool.isRequired,correctness:P.string};static defaultProps={points:[]};render(){let{points:e,className:t,correctness:n,graphProps:r,closed:i,isSolution:a,...o}=this.props,{scale:s}=r,c=Xte(e,s);return(0,I.jsx)(i?Jte:Yte,{points:c,isSolution:a,correctness:n,className:t,...o})}},Qte=z0({bounds:(e,{domain:t,range:n})=>{let{points:r}=e;return z3(q3(r),t,n)},anchorPoint:e=>{let{points:t}=e;return t[0]},fromDelta:(e,t)=>{let{points:n}=e;return n.map(e=>B3(e).add(B3(t)))}})(Zte),m9=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0},h9=(e,t)=>{let n=e??t;return typeof n==`number`?n:typeof n==`string`&&n.endsWith(`px`)?m9(n):1},g9=F.forwardRef(({className:e,inputClassName:t,inputRef:n,inputStyle:r,minWidth:i,placeholder:a,style:o,value:s,defaultValue:c,...l},u)=>{let d=(0,F.useRef)(null),f=(0,F.useRef)(n),p=(0,F.useRef)(u),m=(0,F.useRef)(null),[h,g]=(0,F.useState)(()=>h9(i,r?.minWidth));f.current=n,p.current=u;let _=(0,F.useCallback)(e=>{d.current=e,f.current?.(e);let t=p.current;typeof t==`function`?t(e):t&&(t.current=e)},[]);return(0,F.useLayoutEffect)(()=>{let e=d.current,t=m.current;if(!e||!t)return;let n=window.getComputedStyle(e);t.style.font=n.font,t.style.letterSpacing=n.letterSpacing,t.style.textTransform=n.textTransform,t.textContent=String(s??c??a??``)||` `;let o=m9(n.paddingLeft)+m9(n.paddingRight)+m9(n.borderLeftWidth)+m9(n.borderRightWidth),l=Math.ceil(t.getBoundingClientRect().width+2),u=n.boxSizing===`border-box`?l+o:l;g(Math.max(h9(i,r?.minWidth),u))},[c,t,r,i,a,s]),(0,I.jsxs)(`span`,{className:e,style:{display:`inline-block`,...o},children:[(0,I.jsx)(`input`,{...l,ref:_,className:t,placeholder:a,style:{width:h,...r},value:s,defaultValue:c}),(0,I.jsx)(`span`,{ref:m,"aria-hidden":`true`,style:{height:0,left:0,overflow:`hidden`,position:`absolute`,top:0,visibility:`hidden`,whiteSpace:`pre`}})]})});g9.displayName=`AutosizeInput`;var $te=(e,t)=>{let[n,r]=(0,F.useState)(e);return(0,F.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e]),n},ene=z(g9,{shouldForwardProp:e=>![`disabled`,`markDisabled`].includes(e)})(({theme:e,disabled:t,markDisabled:n})=>({"& input":{float:`right`,padding:e.spacing(.5),fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize,border:`solid 1px ${t?H.PRIMARY_DARK:n?Cp():H.SECONDARY}`,borderRadius:`3px`,color:n?Cp():H.PRIMARY_DARK,background:t||n?e.palette.background.paper:`transparent`}})),tne=(e,t,n)=>{n||={width:0,height:0};let{scale:r,domain:i,range:a}=e,o=r.x(t.x)+n.width+10,s=r.y(t.y)+n.height+10,c=o>=r.x(i.max)?`left`:`right`;return`${s>=r.y(a.min)?`top`:`bottom`}-${c}`},nne=(e,t,n,r)=>{let{scale:i}=e;switch(n||={width:0,height:0},r){case`bottom-right`:return{left:i.x(t.x)+10,top:i.y(t.y)+10};case`bottom-left`:return{left:i.x(t.x)-10-n.width,top:i.y(t.y)+10};case`top-left`:return{left:i.x(t.x)-10-n.width,top:i.y(t.y)-10-n.height};case`top-right`:return{left:i.x(t.x)+10,top:i.y(t.y)-10-n.height}}},_9=e=>{let[t,n]=(0,F.useState)(null),r=(0,F.useCallback)(e=>n(e)),{mark:i,graphProps:a,disabled:o,inputRef:s}=e,[c,l]=(0,F.useState)(i.label),u=e=>l(e.target.value),d=$te(c,200);(0,F.useEffect)(()=>{l(i.label)},[i.label]),(0,F.useEffect)(()=>{typeof d==`string`&&d!==i.label&&e.onChange(d)},[d]);let f=t?t.getBoundingClientRect():{width:0,height:0},p={position:`fixed`,pointerEvents:`auto`,...nne(a,i,f,tne(a,i,f))},m=o||i.disabled;return(0,I.jsx)(ene,{inputRef:e=>{r(e),s(e)},disabled:m,markDisabled:i.disabled,value:c,style:p,onChange:u})};_9.propTypes={disabled:P.bool,onChange:P.func,graphProps:t1,inputRef:P.func,mark:P.object,theme:P.object};var v9=Cm(`pie-lib:graphing-solution-set:polygon`),rne=(e,...t)=>ec(t,2).reduce((e,t)=>{if(t.length===2){let[n,r]=t;(0,a1.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]),ine=class extends F.Component{static propTypes={className:P.string,disabled:P.bool,correctness:P.string,points:P.arrayOf(Z$),closed:P.bool,isSolution:P.bool,coordinatesOnHover:P.bool,onChange:P.func.isRequired,onClosePolygon:P.func.isRequired,onDragStart:P.func,onDragStop:P.func,onClick:P.func,graphProps:t1.isRequired,isToolActive:P.bool,middle:P.object,labelNode:P.object,labelModeEnabled:P.bool,onChangeLabelProps:P.func,onChangeProps:P.func};static defaultProps={points:[]};dragPoint=(e,t,n)=>{v9(`[dragPoint] from, to:`,t,n);let{onChange:r,points:i}=this.props,a=[...i],o=!!(i||[]).find(e=>Q3(e,n));Q3(t,n)||o||(i[e].label&&(n.label=i[e].label),a.splice(e,1,n),r(a))};dragLine=(e,t)=>{v9(`[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(rne(this.props.points,e.from,t.from,e.to,t.to))};dragPoly=(e,t)=>{v9(`[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;v9(`[close] ...`),e.length>=3?t():v9(`[close] - nope`)};labelChange=(e,t)=>{let{points:n,onChangeProps:r}=this.props,i={...e};(!e.label||sc(e.label))&&delete i.label;let a=[...n];a.splice(t,1,i),r(a)};clickPoint=(e,t,n)=>{let{closed:r,disabled:i,onClick:a,isToolActive:o,labelModeEnabled:s,onChangeProps:c,onChangeLabelProps:l,points:u}=this.props;if(s){if(i)return;if(u&&t===u.length){let{a:t,b:n}=J3(u);l({label:``,...e,...Y3(t,n)})}else{let n=[...u];n.splice(t,1,{label:``,...e}),c(n)}this.input[t]&&this.input[t].focus();return}if(o&&!r&&t===0){this.close();return}a(e||n)};input={};render(){let{closed:e,graphProps:t,onChangeLabelProps:n,points:r,middle:i,labelNode:a,labelModeEnabled:o,isSolution:s=!1}=this.props,c=r&&r.length||0;return a&&i&&Object.prototype.hasOwnProperty.call(i,`label`)&&gd.createPortal((0,I.jsx)(_9,{inputRef:e=>this.input[c]=e,disabled:!o,mark:i,graphProps:t,onChange:e=>n({...i,label:e})}),a),(0,I.jsx)(`g`,{children:(0,I.jsx)(F.Fragment,{children:(0,I.jsx)(Qte,{points:r,closed:e,isSolution:s,graphProps:t,onClick:this.clickPoint.bind(this,i,c)})})})}},ane=class extends F.Component{static propTypes={...qte,graphProps:t1.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}=J3(e);n.middle={...t,...Y3(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};n(t,{...t,middle:r})};closePolygon=()=>{v9(`[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}=this.props,{mark:s}=this.state;return(0,I.jsx)(ine,{...s||t,coordinatesOnHover:e,onChange:this.change,onChangeLabelProps:this.changeLabelProps,onChangeProps:this.changeProps,onClosePolygon:this.closePolygon,onDragStart:this.dragStart,onDragStop:this.dragStop,onClick:r,graphProps:n,isToolActive:i,labelNode:a,labelModeEnabled:o})}},one=(e,t)=>{if(t||=[],t.length===0)return{points:[e],closed:!1};if(t.length===1)return Q3(e,t[0])?{points:t,closed:!1}:{points:[...t,e],closed:!1};if(t.length>=2){let n=Q3(e,t[0]);return n?{points:t,closed:n}:t.find(t=>Q3(t,e))?{points:t,closed:!1}:{points:[...t,e],closed:!1}}},sne=()=>({type:`polygon`,Component:ane,complete:(e,t)=>({...t,building:!1,closed:!0}),addPoint:(e,t)=>{if(t){let{closed:n,points:r}=one(e,t.points);return{...t,closed:n,points:r,building:!n}}else return{type:`polygon`,points:[e],closed:!1,building:!0}}}),cne=z(LK)(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:e.typography.fontSize,borderRadius:`8px`,background:e.palette.common.white,color:H.BLACK,"& .MuiInputBase-input":{padding:0}})),lne=(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}},y9=({x:e,y:t,graphProps:n})=>{let r=`(${X3(e)}, ${X3(t)})`,i=(r.length||0)*6,a={position:`absolute`,pointerEvents:`auto`,width:i,padding:0,...lne(n,e,t,i)};return(0,I.jsx)(cne,{style:a,value:r,inputProps:{ariaLabel:`naked`}})};y9.propTypes={graphProps:t1,x:P.number,y:P.number};var une=z(`g`)(({disabled:e,correctness:t})=>({cursor:`pointer`,"& circle":{fill:`currentColor`},...e&&{...u9(`fill`),...u9(`color`)},...t===`correct`&&{...d9(`fill`),...d9(`color`)},...t===`incorrect`&&{...f9(`fill`),...f9(`color`)},...t===`missing`&&{...p9(`fill`),...p9(`color`)}})),dne=class extends F.Component{static propTypes={className:P.string,coordinatesOnHover:P.bool,correctness:P.string,disabled:P.bool,labelNode:P.object,x:P.number,y:P.number,graphProps:t1.isRequired,onClick:P.func,onTouchStart:P.func,onTouchEnd:P.func};constructor(e){super(e),this.state={showCoordinates:!1}}render(){let{className:e,coordinatesOnHover:t,x:n,y:r,disabled:i,correctness:a,graphProps:o,labelNode:s,style:c,onClick:l,onTouchStart:u,onTouchEnd:d,...f}=this.props,{showCoordinates:p}=this.state,{scale:m}=o,h=e6(o)?5:7;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`circle`,{style:{fill:`transparent`,cursor:`pointer`,pointerEvents:`all`},r:h*3,cx:m.x(n),cy:m.y(r),onMouseEnter:()=>this.setState({showCoordinates:!0}),onMouseLeave:()=>this.setState({showCoordinates:!1}),onTouchStart:u,onTouchEnd:d,onClick:l}),(0,I.jsxs)(une,{disabled:i,correctness:a,className:e,onMouseEnter:()=>this.setState({showCoordinates:!0}),onMouseLeave:()=>this.setState({showCoordinates:!1}),children:[(0,I.jsx)(`circle`,{...f,style:{fill:H.BLACK,cursor:`pointer`},r:h,cx:m.x(n),cy:m.y(r)}),s&&t&&p&&gd.createPortal((0,I.jsx)(y9,{graphProps:o,x:n,y:r}),s)]})]})}},fne=class extends F.Component{static propTypes={classes:P.object,className:P.string,correctness:P.string,disabled:P.bool,x:P.number,y:P.number,from:P.shape({x:P.number,y:P.number}).isRequired,to:P.shape({x:P.number,y:P.number}),graphProps:t1.isRequired};static defaultProps={from:{},to:{}};render(){let{classes:e,className:t,x:n,y:r,disabled:i,correctness:a,graphProps:o,from:s,to:c,...l}=this.props,{scale:u}=o,d=V3(s.x,s.y,c.x,c.y),f=``;return f=lc(s,c)?`0,0 0,0 0,0`:`0,0 ${H3.vector},${H3.vector*2}
365
+ -${H3.vector},${H3.vector*2}`,(0,I.jsx)(`g`,{className:L(e.point,i&&e.disabled,e[a],t),...l,children:(0,I.jsx)(`polygon`,{points:f,transform:`
366
+ translate(${u.x(n)}, ${u.y(r)})
367
+ rotate(${d} 0 0)`})})}},b9=({size:e,transform:t,points:n})=>(0,I.jsx)(`polygon`,{points:n||`0,0 ${e},${e/2} 0,${e}`,transform:t});b9.propTypes={points:P.string,size:P.number,transform:P.string},b9.defaultProps={points:``,size:10,transform:``};var pne=()=>`arrow-${(Math.random()*1e3).toFixed(0)}`,x9=({id:e,size:t,className:n})=>(0,I.jsx)(`marker`,{id:e,viewBox:`0 0 ${t} ${t}`,refX:t/2,refY:t/2,markerWidth:t,markerHeight:t,orient:`auto-start-reverse`,className:n,style:{fill:H.BLACK},children:(0,I.jsx)(b9,{size:t})});x9.propTypes={id:P.string,size:P.number,className:P.string},x9.defaultProps={size:5};var mne=class extends F.Component{static propTypes={classes:P.object,className:P.string,correctness:P.string,disabled:P.bool,x:P.number.isRequired,y:P.number.isRequired,angle:P.number.isRequired,graphProps:t1.isRequired};render(){let{classes:e,angle:t,className:n,x:r,y:i,disabled:a,correctness:o,graphProps:s,...c}=this.props,l=e6(s)?12:14,{scale:u}=s,d=u.x(r),f=u.y(i),p=`rotate(${-t}, ${d},${f})`,m=`${d},${f}
368
+ ${d-l},${f-l/2}
369
+ ${d-l}, ${f+l/2}`;return(0,I.jsx)(`g`,{className:L(e.point,a&&e.disabled,e[o],n),...c,children:(0,I.jsx)(b9,{size:l,transform:p,points:m})})}},S9={bounds:(e,{domain:t,range:n})=>{let{x:r,y:i}=e;return z3({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)=>B3(e).add(B3(t))},hne=z(`g`,{shouldForwardProp:e=>![`disabled`,`correctness`].includes(e)})(({disabled:e,correctness:t})=>({"& circle, & polygon":{cursor:`pointer`,fill:H.SECONDARY,...e&&u9(),...t===`correct`&&d9(),...t===`incorrect`&&f9(),...t===`missing`&&p9()}})),C9=e=>{let t=t=>(0,I.jsx)(hne,{disabled:t.disabled,correctness:t.correctness,children:(0,I.jsx)(e,{...t})});return t.displayName=`withStyledWrapper(${e.displayName||e.name||`Component`})`,t.propTypes={disabled:P.bool,correctness:P.string},t},w9=z0(S9)(C9(dne));z0(S9)(C9(fne)),z0(S9)(C9(mne));var gne=(e,t)=>()=>({type:e,Component:t,addPoint:(t,n)=>n&&Q3(n.root,t)?n:n?Q3(t,n.from)?{...n}:{...n,building:!1,to:t}:{type:e,building:!0,from:t}}),_ne=e=>class extends F.Component{static propTypes={...n1,graphProps:t1.isRequired};constructor(e){super(e),this.state={}}startDrag=()=>this.setState({mark:{...this.props.mark}});stopDrag=()=>{let{onChange:e,mark:t}=this.props,n={...this.state.mark};this.setState({mark:void 0},()=>{let{type:r}=n,i=r&&(r===`parabola`||r===`sine`||r===`absolute`||r===`exponential`)&&Z3(n.from,n.to);!i&&r&&r===`exponential`&&n.from&&n.to&&(i=n.from.y===0||n.to.y===0||n.from.y*n.to.y<0),!lc(t,n)&&!i&&e(t,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}),lc(i,a)||r(i,a)};render(){let{graphProps:t,onClick:n,labelNode:r,labelModeEnabled:i,coordinatesOnHover:a,gssLineData:o}=this.props,s=this.state.mark?this.state.mark:this.props.mark,c=tc(s.from),l=tc(s.to),u=tc(s.middle);return c&&s.isBackground&&(c.disabled=!0),l&&s.isBackground&&(l.disabled=!0),u&&s.isBackground&&(u.disabled=!0),(0,I.jsx)(e,{disabled:s.disabled,coordinatesOnHover:a,correctness:s.correctness,from:c,to:l,middle:u,graphProps:t,fill:s&&s.fill,gssLineData:o,onChange:this.changeMark,changeMarkProps:this.changeMarkProps,onClick:n,onDragStart:this.startDrag,onDragStop:this.stopDrag,labelNode:r,labelModeEnabled:i})}},vne=()=>({bounds:(e,{domain:t,range:n})=>u1(l1(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:d1(n).add(d1(t)),to:d1(r).add(d1(t))}}}),yne=(e,t)=>{let n=z0(vne())(e),r=t&&t.from?t.from:w9,i=t&&t.to?t.to:w9;class a extends F.Component{static propTypes={coordinatesOnHover:P.bool,graphProps:t1,from:Z$,to:Z$,middle:Z$,onChange:P.func,onDragStart:P.func,onDragStop:P.func,onClick:P.func,correctness:P.string,fill:P.string,gssLineData:P.object,disabled:P.bool,labelNode:P.object,labelModeEnabled:P.bool,changeMarkProps:P.func};onChangePoint=e=>{let{middle:t,onChange:n}=this.props,{from:r,to:i}=e;Q3(r,i)||(t&&(e.middle={...t,...Y3(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,...Y3(e,t)}),i(o)};dragFrom=e=>{let{from:t,to:n}=this.props;t.label&&(e.label=t.label),Q3(e,n)||this.onChangePoint({from:e,to:n})};dragTo=e=>{let{from:t,to:n}=this.props;n.label&&(e.label=n.label),Q3(t,e)||this.onChangePoint({from:t,to:e})};labelChange=(e,t)=>{let{changeMarkProps:n}=this.props,r={...e};(!e.label||sc(e.label))&&delete r.label,n({[t]:r})};clickPoint=(e,t,n)=>{let{changeMarkProps:r,disabled:i,from:a,to:o,labelModeEnabled:s,onClick:c}=this.props;if(!s){c(e||n);return}i||(t===`middle`&&!e&&a&&o&&(e={...e,...Y3(a,o)}),r({from:a,to:o,[t]:{label:``,...e}}),this.input[t]&&this.input[t].focus())};input={};render(){let{coordinatesOnHover:e,graphProps:t,fill:a,gssLineData:o,onDragStart:s,onDragStop:c,from:l,to:u,middle:d,disabled:f,correctness:p,onClick:m,labelNode:h,labelModeEnabled:g}=this.props,_={graphProps:t,fill:a,onDragStart:s,onDragStop:c,disabled:f,correctness:p,onClick:m};o&&o.selectedTool===`solutionSet`&&(_={graphProps:t,fill:a,disabled:f,correctness:p,onClick:m});let v=u?V0(U0(l,u)):0,y=null,b=null,x=null;return h&&(l&&Object.prototype.hasOwnProperty.call(l,`label`)&&(y=gd.createPortal((0,I.jsx)(_9,{inputRef:e=>this.input.from=e,disabled:!g,mark:l,graphProps:t,onChange:e=>this.labelChange({...l,label:e},`from`)}),h)),u&&Object.prototype.hasOwnProperty.call(u,`label`)&&(b=gd.createPortal((0,I.jsx)(_9,{inputRef:e=>this.input.to=e,disabled:!g,mark:u,graphProps:t,onChange:e=>this.labelChange({...u,label:e},`to`)}),h)),d&&Object.prototype.hasOwnProperty.call(d,`label`)&&(x=gd.createPortal((0,I.jsx)(_9,{inputRef:e=>this.input.middle=e,disabled:!g,mark:d,graphProps:t,onChange:e=>this.labelChange({...d,label:e},`middle`)}),h))),o&&o.selectedTool===`solutionSet`?(0,I.jsxs)(`g`,{children:[u&&(0,I.jsx)(n,{from:l,to:u,middle:d,..._}),x,(0,I.jsx)(r,{x:l.x,y:l.y,labelNode:h,coordinatesOnHover:e,..._}),y,u&&(0,I.jsx)(i,{x:u.x,y:u.y,angle:v,labelNode:h,coordinatesOnHover:e,..._}),b]}):(0,I.jsxs)(`g`,{children:[u&&(0,I.jsx)(n,{from:l,to:u,middle:d,onDrag:this.dragComp,..._,onClick:e=>this.clickPoint(d,`middle`,e)}),x,(0,I.jsx)(r,{x:l.x,y:l.y,labelNode:h,coordinatesOnHover:e,onDrag:this.dragFrom,..._,onClick:e=>this.clickPoint(l,`from`,e)}),y,u&&(0,I.jsx)(i,{x:u.x,y:u.y,angle:v,labelNode:h,coordinatesOnHover:e,onDrag:this.dragTo,..._,onClick:e=>this.clickPoint(u,`to`,e)}),b]})}}return a},T9={line:()=>({fill:`transparent`,stroke:H.BLACK,strokeWidth:4,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`,"&:hover":{strokeWidth:6,stroke:H.BLACK}}),dashedLine:()=>({fill:`transparent`,stroke:H.BLACK,strokeWidth:4,transition:`stroke 200ms ease-in, stroke-width 200ms ease-in`,"&:hover":{strokeWidth:6,stroke:H.BLACK},strokeDasharray:`3,3`}),arrow:()=>({fill:H.SECONDARY}),disabledArrow:()=>({...u9()}),disabled:()=>({...u9(`stroke`),strokeWidth:2}),correct:(e,t)=>({...d9(t)}),incorrect:(e,t)=>({...f9(t)}),missing:(e,t)=>({...p9(t)})},bne=z(`line`,{shouldForwardProp:e=>![`fill`,`disabled`,`correctness`].includes(e)})(({theme:e,fill:t,disabled:n,correctness:r})=>({...t===`Solid`?T9.line(e):T9.dashedLine(e),...n&&T9.disabled(e),...r===`correct`&&T9.correct(e,`stroke`),...r===`incorrect`&&T9.incorrect(e,`stroke`),...r===`missing`&&T9.missing(e,`stroke`)})),xne=z(x9,{shouldForwardProp:e=>![`suffix`].includes(e)})(({theme:e,suffix:t})=>({...t===`enabled`&&T9.arrow(e),...t===`disabled`&&T9.disabledArrow(e),...t===`correct`&&T9.correct(e),...t===`incorrect`&&T9.incorrect(e),...t===`missing`&&T9.missing(e)})),E9=e=>{let t=pne(),{className:n,correctness:r,disabled:i,graphProps:a,fill:o=`Solid`,from:s,to:c,...l}=e,{scale:u}=a,{domain:d,range:f}=t6(a),[p,m]=K0(d,f)(s,c),h=r||i&&`disabled`||`enabled`;return(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`defs`,{children:(0,I.jsx)(xne,{size:e6(a)?4:5,id:`${e.markerId||t}-${h}`,suffix:h})}),(0,I.jsx)(bne,{x1:u.x(p.x),y1:u.y(p.y),x2:u.x(m.x),y2:u.y(m.y),fill:o,disabled:i,correctness:r,className:n,markerEnd:`url(#${e.markerId||t}-${h})`,markerStart:`url(#${e.markerId||t}-${h})`,...l})]})};E9.propTypes={className:P.string,fill:P.string,correctness:P.string,disabled:P.bool,graphProps:t1,from:Z$,to:Z$,markerId:P.string};var Sne=gne(`line`,_ne(yne(E9))),Cne=[`line`,`polygon`],D9=[Sne(),sne()],wne=ep((0,I.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`}),`ExpandMore`),Tne=e=>D9.map(t=>({...t,toolbar:!!e.find(e=>e===t.type)}))||[],Ene=(e,t)=>t&&e&&(e.find(e=>e.type===t.type)||{}).toolbar,Dne=e=>e.find(e=>e.toolbar),One=e=>e.filter(e=>!!Cne.find(t=>t===e.type)),kne=(e,t)=>t.filter(t=>!!e.find(e=>e===t.type)),O9=e=>D9.find(t=>t.type===e)||null,Ane=z(`div`)(()=>({display:`flex`,flexDirection:`column`,width:`min-content`})),jne=z(`div`)(()=>({display:`flex`,justifyContent:`space-between`,padding:`calc(1.25rem - 12px) calc(1.25rem - 12px) 1.25rem`,color:Sp(),backgroundColor:`#9FA8DA`,"& button":{fontSize:`0.875rem`,padding:`0.25rem .3rem`,width:`5rem`}})),Mne=z(q5)(()=>({backgroundColor:Ip(),width:`100%`,boxShadow:`none`})),Nne=z(i7)(({theme:e})=>({padding:`0 ${e.spacing(1)}`,minHeight:`32px !important`,"& .MuiAccordionSummary-content":{margin:`4px 0 !important`}})),Pne=z(Z5)(({theme:e})=>({padding:0,marginTop:e.spacing(1),display:`flex`,justifyContent:`space-between`})),Fne=z(`div`)(()=>({display:`flex`,flexDirection:`column`,marginTop:`.5rem`})),k9=({children:e,title:t})=>(0,I.jsxs)(Mne,{square:!0,disableGutters:!0,children:[(0,I.jsx)(Nne,{expandIcon:(0,I.jsx)(wne,{}),children:(0,I.jsx)(JG,{variant:`subtitle1`,children:t})}),(0,I.jsx)(Pne,{children:e})]});k9.propTypes={children:P.node,title:P.string};var A9=class extends F.Component{static propTypes={...G6,onUndo:P.func,onRedo:P.func,onReset:P.func,toolbarTools:P.arrayOf(P.string),language:P.string};static defaultProps={collapsibleToolbar:!1,collapsibleToolbarTitle:``,disabledLabels:!1,disabledTitle:!1,showLabels:!0,showTitle:!0,toolbarTools:[]};constructor(e){super(e),this.state={currentTool:O9(e.defaultTool),labelModeEnabled:!1}}componentDidUpdate(e){let{defaultTool:t}=this.props;if(e.defaultTool!==t){let e=O9(t);this.setState({currentTool:e})}}changeCurrentTool=(e,t)=>this.setState({currentTool:t.find(t=>t.type===e)});toggleLabelMode=()=>this.setState(e=>({labelModeEnabled:!e.labelModeEnabled}));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,labels:d,labelsPlaceholders:f,onChangeLabels:p,onChangeMarks:m,onChangeTitle:h,onUndo:g,onRedo:_,range:v,size:y,showLabels:b,showPixelGuides:x,showTitle:S,title:C,titlePlaceholder:w,language:T,disableToolbar:E=!1,gssLineData:D,onChangeGssLineData:O,onSolutionSetSelected:k,onCustomReset:A}=this.props,{backgroundMarks:j,marks:M,toolbarTools:ee}=this.props;ee=gc(ee||[]).filter(e=>!!dc(e))||[],j=One(j||[]),M=kne(ee,M||[]),D&&D.lineA&&M[0]&&M[0].type===`line`&&(M[0].fill=D.lineA.lineType),D&&D.lineB&&M[1]&&M[1].type===`line`&&(M[1].fill=D.lineB.lineType);let N=Tne(ee);(!e||!Ene(N,e))&&(e=Dne(N));let te=D&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(E7,{numberOfLines:D.numberOfLines,gssLineData:D,onChange:O,disabled:!!s,language:T}),!s&&(0,I.jsx)(Fne,{children:(0,I.jsx)(Kte,{onUndo:g,onRedo:_,onReset:A,language:T})})]});return(0,I.jsxs)(Ane,{className:L(r),children:[!E&&(0,I.jsx)(jne,{children:a?(0,I.jsx)(k9,{title:o,children:te}):te}),(0,I.jsx)(`div`,{ref:e=>this.labelNode=e}),(0,I.jsx)(J6,{axesSettings:n,backgroundMarks:j,coordinatesOnHover:i,currentTool:e,disabledLabels:c,disabledTitle:l,domain:u,labels:d,labelModeEnabled:t,labelsPlaceholders:f,marks:M,onChangeMarks:s?void 0:m,onChangeLabels:p,onChangeTitle:h,range:v,size:y,showLabels:b,showPixelGuides:x,showTitle:S,title:C,titlePlaceholder:w,tools:N,gssLineData:D,onSolutionSetSelected:k,disabled:!!s})]})}},j9=null,Ine=()=>j9,Lne=()=>e=>t=>(j9=t,e(t)),Rne=n5(e=>({marks:e.marks.present}),e=>({onChangeMarks:t=>e(z5(t)),onUndo:()=>e(_5.undo()),onRedo:()=>e(_5.redo()),onReset:()=>e(z5([]))}))(A9),zne=class extends F.Component{static propTypes={onChangeMarks:P.func,marks:P.array};constructor(e){super(e);let t=R5();this.store=u5(t,{marks:e.marks},m5(Lne)),this.store.subscribe(this.onStoreChange)}componentDidUpdate(e){let{marks:t}=this.props;lc(this.store.getState().marks.present,t)||lc(e.marks,t)||t&&t.find(e=>e.correctness)||this.store.dispatch(z5(t))}onStoreChange=()=>{let{marks:e,onChangeMarks:t}=this.props,n=this.store.getState(),r=Ine(),i=r.type.includes(`UNDO`)||r.type.includes(`REDO`);lc(n.marks.present,e)||t(n.marks.present,i)};render(){let{onChangeMarks:e,marks:t,...n}=this.props,r=t&&t.find(e=>e.correctness);return r?(0,I.jsx)(A9,{...n,marks:t,disabled:r}):(0,I.jsx)(i5,{store:this.store,children:(0,I.jsx)(Rne,{...n})})}},Bne=z(KY)(()=>({fontSize:`max(1.25rem, 18px)`})),Vne=z(XY)(()=>({fontSize:`max(1rem, 14px)`})),M9=({text:e,title:t,onClose:n,onConfirm:r,open:i,onCloseText:a,onConfirmText:o,disableAutoFocus:s,disableEnforceFocus:c,disableRestoreFocus:l})=>(0,I.jsxs)(ZJ,{open:i,disableAutoFocus:s,disableEnforceFocus:c,disableRestoreFocus:l,onClose:n,children:[t&&(0,I.jsx)(Bne,{children:t}),e&&(0,I.jsx)(EJ,{children:(0,I.jsx)(Vne,{children:e})}),(0,I.jsxs)(HJ,{children:[n&&(0,I.jsx)(Mh,{onClick:n,color:`primary`,children:a}),r&&(0,I.jsx)(Mh,{autoFocus:!0,onClick:r,color:`primary`,children:o})]})]});M9.defaultProps={onCloseText:`CANCEL`,onConfirmText:`OK`,disableAutoFocus:!1,disableEnforceFocus:!1,disableRestoreFocus:!1},M9.propTypes={text:P.oneOfType([P.string,P.object]),title:P.string,onClose:P.func,onConfirm:P.func,open:P.bool,onConfirmText:P.string,onCloseText:P.string,disableAutoFocus:P.bool,disableEnforceFocus:P.bool,disableRestoreFocus:P.bool};function N9(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function P9(e,t){return!e||N9(e)?e:N9(e.default)?e.default:t&&N9(e[t])?e[t]:t&&N9(e[t]?.default)?e[t].default:e}P9(mg,`InputContainer`)||P9(Hne.InputContainer,`InputContainer`);var F9=Xg,I9=F9.default,Hne=I9&&typeof I9==`object`?I9:F9,L9=`height ease-in 300ms, opacity ease-in 300ms`,Une=z(`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,F.useRef)(null);return(0,I.jsx)(Ed,{nodeRef:i,in:t,appear:!0,mountOnEnter:!1,timeout:300,classNames:{enter:`enter`,enterDone:`enter-done`,exit:`exit`,exitDone:`exit-done`},children:(0,I.jsx)(Une,{ref:i,className:r,children:n})})};R9.propTypes={show:P.bool.isRequired,className:P.string,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired};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 Wne=B9(bg,`Readable`)||B9(Gne.Readable,`Readable`),V9=Xg,H9=V9.default,Gne=H9&&typeof H9==`object`?H9:V9,{translator:U9}=l9,Kne={WebkitTouchCallout:`none`,WebkitUserSelect:`none`,KhtmlUserSelect:`none`,MozUserSelect:`none`,msUserSelect:`none`,userSelect:`none`},qne=z(`div`)(()=>({width:`100%`,cursor:`pointer`})),Jne=z(`div`)(()=>({margin:`0 auto`,textAlign:`center`,display:`flex`})),Yne=z(`div`)(()=>({width:`fit-content`,minWidth:`140px`,alignSelf:`center`,verticalAlign:`middle`,color:`var(--correct-answer-toggle-label-color, ${Sp()})`,fontWeight:`normal`,...Kne})),W9=z(`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`}})),Xne=z(`div`)(()=>({width:`25px`,marginRight:`5px`,display:`flex`,alignItems:`center`})),Zne=class e extends F.Component{static propTypes={onToggle:P.func,toggled:P.bool,show:P.bool,hideMessage:P.string,showMessage:P.string,className:P.string,language:P.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=F.createRef(),this.closedIconRef=F.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,I.jsx)(qne,{className:e,children:(0,I.jsx)(R9,{show:this.state.show,children:(0,I.jsxs)(Jne,{onClick:this.onClick.bind(this),onTouchEnd:this.onTouch.bind(this),children:[(0,I.jsxs)(Xne,{children:[(0,I.jsx)(Ed,{nodeRef:this.openIconRef,timeout:400,in:t,exit:!t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,I.jsx)(W9,{ref:this.openIconRef,children:(0,I.jsx)(Nu,{open:t},`correct-open`)})}),(0,I.jsx)(Ed,{nodeRef:this.closedIconRef,timeout:5e3,in:!t,exit:t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,I.jsx)(W9,{ref:this.closedIconRef,children:(0,I.jsx)(Nu,{open:t},`correct-closed`)})})]}),(0,I.jsx)(Wne,{false:!0,children:(0,I.jsx)(Yne,{"aria-hidden":!this.state.show,children:t?n:r})})]})})})}};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 Qne=K9(Hh,`UiLayout`)||K9(Z9.UiLayout,`UiLayout`),q9=K9(yg,`PreviewPrompt`)||K9(Z9.PreviewPrompt,`PreviewPrompt`),J9=K9(Bm,`Collapsible`)||K9(Z9.Collapsible,`Collapsible`),Y9=Xg,X9=Y9.default,Z9=X9&&typeof X9==`object`?X9:Y9,$ne=z(Qne)({color:Sp(),backgroundColor:Wp()}),ere=z(J9)(({theme:e})=>({marginBottom:e.spacing(2)})),Q9=z(zne)(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2)})),tre=class extends F.Component{static propTypes={model:P.object.isRequired,session:P.object.isRequired,onAnswersChange:P.func};state={showingCorrect:!1,dialog:{open:!1}};handleAlertDialog=(e,t)=>this.setState({dialog:{open:e}},t);toggleCorrect=e=>this.setState({showingCorrect:e});onResetClick=()=>{let{model:e,session:t,setGssData:n}=this.props,{gssData:r}=e;this.setState({dialog:{open:!0,title:`Warning`,text:`This will remove all the elements added on the graph and reset graph to original state. Are you sure you want to continue?`,onConfirm:()=>{t.answer=[],r.selectedTool=`lineA`,r.lineA.lineType=`Solid`,r.lineB&&(r.lineB.lineType=`Solid`),n(r,t),this.handleAlertDialog(!1)},onClose:()=>this.handleAlertDialog(!1)}})};onSolutionSetSelected=e=>{let{model:t,session:n,setGssData:r}=this.props,{gssData:i,disabled:a}=t;if(!a){for(let t of i.sections)if($e(e,t)){let e={points:t,building:!1,type:`polygon`,closed:!0,isSolution:!0};n.answer=n.answer.filter(e=>e.type!==`polygon`),n.answer.push(e);break}r(i,n)}};onChangeGssLineData=(e,t)=>{let{model:n,session:r}=this.props,{domain:i,range:a,disabled:o}=n;if(!o)if(e.selectedTool===`solutionSet`){let n=r.answer.filter(e=>e.type!==`polygon`);if(!et(e,n))e.selectedTool=t,this.setState({dialog:{open:!0,title:`Warning`,text:`Please define the line(s) and then select a solution set for the item.`,onConfirm:()=>this.handleAlertDialog(!1)}});else{let t=r.answer.filter(e=>e.type!==`polygon`);e=Qe(e,t,i,a)}this.handleGssDataChange(e,r)}else{let n=r.answer.filter(e=>e.type===`polygon`);t===`solutionSet`&&n.length>0?this.setState({dialog:{open:!0,title:`Warning`,text:`Changing a line after adding a solution set will clear your selected solution set. Click 'Clear Solution Set' to change the line. Otherwise, click 'Cancel'.`,onConfirm:()=>{r.answer=r.answer.filter(e=>e.type!==`polygon`),this.handleGssDataChange(e,r),this.handleAlertDialog(!1)},onConfirmText:`CLEAR SOLUTION SET`,onClose:()=>{e.selectedTool=t,this.handleGssDataChange(e,r),this.handleAlertDialog(!1)}}}):this.handleGssDataChange(e,r)}};handleGssDataChange=(e,t)=>{let{setGssData:n}=this.props;t.answer&&t.answer.length>0&&t.answer[0]&&e.lineA&&(t.answer[0].fill=e.lineA.lineType),t.answer&&t.answer.length>1&&t.answer[1]&&e.lineB&&(t.answer[1].fill=e.lineB.lineType),(e.selectedTool===`lineB`&&t.answer.length===0||e.selectedTool===`lineB`&&t.answer[0].building)&&(this.setState({dialog:{open:!0,title:`Warning`,text:`Please add Line A to the graph before adding Line B`,onConfirm:()=>this.handleAlertDialog(!1)}}),e.selectedTool=`lineA`),e.selectedTool===`lineA`&&t.answer.length>1&&t.answer[1].building&&(this.setState({dialog:{open:!0,title:`Warning`,text:`Please add Line B to the graph before switching to Line A`,onConfirm:()=>this.handleAlertDialog(!1)}}),e.selectedTool=`lineB`),n(e,t)};render(){let{model:e,onAnswersChange:t,session:n}=this.props,{showingCorrect:r,dialog:i}=this.state,{answer:a}=n||{},{answersCorrected:o,arrows:s,coordinatesOnHover:c,correctResponse:l,defaultTool:u,disabled:d,domain:f,extraCSSRules:p,labels:m,labelsEnabled:h,prompt:g,range:_,rationale:v,size:y,showToggle:b,title:x,titleEnabled:S,teacherInstructions:C,language:w,gssLineData:T,gssData:E}=e||{},D=o||a||[],O=e.rationale&&(wg(e.rationale)||Eg(e.rationale)),k=e.teacherInstructions&&(wg(e.teacherInstructions)||Eg(e.teacherInstructions));return(0,I.jsxs)($ne,{extraCSSRules:p,children:[k&&(0,I.jsx)(ere,{labels:{hidden:`Show Teacher Instructions`,visible:`Hide Teacher Instructions`},children:(0,I.jsx)(q9,{prompt:C})}),g&&(0,I.jsx)(q9,{className:`prompt`,prompt:g}),(0,I.jsx)(Zne,{show:b,toggled:r,onToggle:this.toggleCorrect,language:w}),r&&b?(0,I.jsx)(Q9,{axesSettings:{includeArrows:s},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:y,title:x,language:w,gssLineData:T,onChangeGssLineData:this.onChangeGssLineData,onSolutionSetSelected:this.onSolutionSetSelected,toolbarTools:[`line`,`polygon`]}):(0,I.jsx)(Q9,{axesSettings:{includeArrows:s},coordinatesOnHover:c,defaultTool:u,disabled:d,disabledLabels:!0,disabledTitle:!0,domain:f,labels:m,marks:D,onChangeMarks:t,onCustomReset:this.onResetClick,range:_,showLabels:h,showTitle:S,size:y,title:x,language:w,gssLineData:E,onChangeGssLineData:this.onChangeGssLineData,onSolutionSetSelected:this.onSolutionSetSelected,toolbarTools:[`line`,`polygon`]}),O&&(0,I.jsx)(J9,{labels:{hidden:`Show Rationale`,visible:`Hide Rationale`},children:(0,I.jsx)(q9,{prompt:v})}),(0,I.jsx)(M9,{open:i.open,title:i.title,text:i.text,onClose:i.onClose,onConfirm:i.onConfirm,onConfirmText:i.onConfirmText?i.onConfirmText:`OK`})]})}},nre=g(),$9=class extends HTMLElement{constructor(){super(),this._root=null}set model(e){this._model=e,this._render()}set session(e){this._session=e,this._session.answer||(this._session.answer=[]);let{answer:t}=this._session||{},{gssLineData:n,domain:r,range:i}=this._model,a=t&&t.filter(e=>e.type===`polygon`).length>0;n.numberOfLines===1?this._model.gssData={numberOfLines:1,selectedTool:a?`solutionSet`:`lineA`,sections:[],lineA:{lineType:t&&t.length>0?t[0].fill:`Solid`}}:this._model.gssData={numberOfLines:2,selectedTool:a?`solutionSet`:`lineA`,sections:[],lineA:{lineType:t&&t.length>0?t[0].fill:`Solid`},lineB:{lineType:t&&t.length>1?t[1].fill:`Solid`}},a&&(this._model.gssData=Qe(this._model.gssData,t,r,i)),this._render()}get session(){return this._session}connectedCallback(){this._render()}isComplete=e=>Array.isArray(e)&&e.length>0;changeAnswers=(e,t)=>{let{gssData:n}=this._model;n.selectedTool===`lineA`&&e.length>0&&(e[0].fill=n.lineA.lineType),n.selectedTool===`lineB`&&e.length>1&&(e[1].fill=n.lineB.lineType),e.length===0&&(n.selectedTool=`lineA`,this._model.gssData=n),t?this._session.answer=e:this._session.answer=tt(e),this.dispatchEvent(new _(this.tagName.toLowerCase(),this.isComplete(this._session.answer))),this._render()};setGssData=(e,t)=>{this._model.gssData=e,this._session=t,this.dispatchEvent(new _(this.tagName.toLowerCase(),this.isComplete(this._session.answer))),this._render()};_render(){if(!this._model||!this._session)return;let e=F.createElement(tre,{model:this._model,session:this._session,onAnswersChange:this.changeAnswers,setGssData:this.setGssData});this._root||=(0,nre.createRoot)(this),this._root.render(e),queueMicrotask(()=>{Ne(this)})}disconnectedCallback(){this._root&&=(this._root.unmount(),null)}};return typeof window<`u`&&!customElements.get(`graphing-solution-set-element`)&&customElements.define(`graphing-solution-set-element`,$9),$9})();