@prismicio/editor-fields 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/EditorConfig.d.ts +1 -0
  2. package/dist/NestableWidgetSwitch.d.ts +3 -4
  3. package/dist/SectionEditor.d.ts +3 -4
  4. package/dist/fields/EmbedField/EmbedField.d.ts +3 -3
  5. package/dist/fields/GeoPointField.d.ts +11 -0
  6. package/dist/fields/ImageField/{CroppedDialog/index.d.ts → CropperDialog/CropperDialog.d.ts} +1 -1
  7. package/dist/fields/ImageField/{CroppedDialog → CropperDialog}/croppedImage.d.ts +1 -1
  8. package/dist/fields/ImageField/CropperDialog/index.d.ts +1 -0
  9. package/dist/fields/ImageField/ImageField.d.ts +12 -0
  10. package/dist/fields/ImageField/MediaPicker/MediaLibrary/MediaLibrary.d.ts +13 -2
  11. package/dist/fields/ImageField/MediaPicker/MediaLibrary/mediaLibraryData.d.ts +62 -38
  12. package/dist/fields/ImageField/MediaPicker/MediaPicker.d.ts +2 -2
  13. package/dist/fields/ImageField/MediaPicker/mediaPickerData.d.ts +26 -0
  14. package/dist/fields/ImageField/index.d.ts +1 -12
  15. package/dist/fields/KeyTextField.d.ts +3 -4
  16. package/dist/fields/LinkField/LinkField.d.ts +11 -0
  17. package/dist/fields/LinkField/LinkFieldActions.d.ts +5 -2
  18. package/dist/fields/LinkField/index.d.ts +2 -12
  19. package/dist/fields/LinkField/useLinkField.d.ts +17 -0
  20. package/dist/fields/RichTextField/RichTextField.d.ts +2 -2
  21. package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
  22. package/dist/fields/RichTextField/coreExtensions/Placeholder.d.ts +7 -2
  23. package/dist/fields/RichTextField/globalExtensions/TextDirection.d.ts +3 -3
  24. package/dist/fields/externalLinks.d.ts +2 -0
  25. package/dist/index.es.js +19754 -19081
  26. package/dist/index.umd.js +39 -43
  27. package/dist/slices/SharedSliceEditor.d.ts +3 -4
  28. package/dist/zones/SliceZoneEditor.d.ts +3 -4
  29. package/dist/zones/StaticZoneEditor.d.ts +3 -4
  30. package/package.json +24 -21
  31. package/dist/fields/ImageField/MediaPicker/MediaLibrary.d.ts +0 -1
  32. package/dist/fields/ImageField/MediaPicker/UnsplashLibrary.d.ts +0 -6
  33. package/dist/fields/ImageField/MediaPicker/unsplashData.d.ts +0 -115
  34. /package/dist/fields/ImageField/{imageField.d.ts → imageFieldUtils.d.ts} +0 -0
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Sn,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],U):(Sn=typeof globalThis<"u"?globalThis:Sn||self,U(Sn.EditorFields={},Sn.React,Sn.EditorUi,Sn.ReactDOM))})(this,function(Sn,U,C,s_){"use strict";var Gxe=Object.defineProperty;var Yxe=(Sn,U,C)=>U in Sn?Gxe(Sn,U,{enumerable:!0,configurable:!0,writable:!0,value:C}):Sn[U]=C;var Vf=(Sn,U,C)=>(Yxe(Sn,typeof U!="symbol"?U+"":U,C),C);function VR(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const $e=VR(U),D6=VR(s_);var he=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var I={},q6={get exports(){return I},set exports(e){I=e}},Hf={};/**
1
+ (function(yn,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],j):(yn=typeof globalThis<"u"?globalThis:yn||self,j(yn.EditorFields={},yn.React,yn.EditorUi,yn.ReactDOM))})(this,function(yn,j,w,O_){"use strict";var pAe=Object.defineProperty;var hAe=(yn,j,w)=>j in yn?pAe(yn,j,{enumerable:!0,configurable:!0,writable:!0,value:w}):yn[j]=w;var ad=(yn,j,w)=>(hAe(yn,typeof j!="symbol"?j+"":j,w),w);function mM(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _e=mM(j),PH=mM(O_);var de=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ac(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var _={},WH={get exports(){return _},set exports(e){_=e}},ud={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var HR;function U6(){if(HR)return Hf;HR=1;var e=U,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(u,s,c){var l,f={},d=null,p=null;c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),s.ref!==void 0&&(p=s.ref);for(l in s)r.call(s,l)&&!o.hasOwnProperty(l)&&(f[l]=s[l]);if(u&&u.defaultProps)for(l in s=u.defaultProps,s)f[l]===void 0&&(f[l]=s[l]);return{$$typeof:t,type:u,key:d,ref:p,props:f,_owner:i.current}}return Hf.Fragment=n,Hf.jsx=a,Hf.jsxs=a,Hf}var Gf={};/**
9
+ */var vM;function LH(){if(vM)return ud;vM=1;var e=j,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(u,s,c){var l,f={},d=null,p=null;c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),s.ref!==void 0&&(p=s.ref);for(l in s)r.call(s,l)&&!o.hasOwnProperty(l)&&(f[l]=s[l]);if(u&&u.defaultProps)for(l in s=u.defaultProps,s)f[l]===void 0&&(f[l]=s[l]);return{$$typeof:t,type:u,key:d,ref:p,props:f,_owner:i.current}}return ud.Fragment=n,ud.jsx=a,ud.jsxs=a,ud}var sd={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,30 +14,30 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var GR;function B6(){return GR||(GR=1,process.env.NODE_ENV!=="production"&&function(){var e=U,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function m(w){if(w===null||typeof w!="object")return null;var B=h&&w[h]||w[v];return typeof B=="function"?B:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(w){{for(var B=arguments.length,ne=new Array(B>1?B-1:0),Ie=1;Ie<B;Ie++)ne[Ie-1]=arguments[Ie];S("error",w,ne)}}function S(w,B,ne){{var Ie=_.ReactDebugCurrentFrame,Xe=Ie.getStackAddendum();Xe!==""&&(B+="%s",ne=ne.concat([Xe]));var ut=ne.map(function(Ge){return String(Ge)});ut.unshift("Warning: "+B),Function.prototype.apply.call(console[w],console,ut)}}var b=!1,$=!1,T=!1,M=!1,R=!1,q;q=Symbol.for("react.module.reference");function Y(w){return!!(typeof w=="string"||typeof w=="function"||w===r||w===o||R||w===i||w===c||w===l||M||w===p||b||$||T||typeof w=="object"&&w!==null&&(w.$$typeof===d||w.$$typeof===f||w.$$typeof===a||w.$$typeof===u||w.$$typeof===s||w.$$typeof===q||w.getModuleId!==void 0))}function N(w,B,ne){var Ie=w.displayName;if(Ie)return Ie;var Xe=B.displayName||B.name||"";return Xe!==""?ne+"("+Xe+")":ne}function Z(w){return w.displayName||"Context"}function ie(w){if(w==null)return null;if(typeof w.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof w=="object")switch(w.$$typeof){case u:var B=w;return Z(B)+".Consumer";case a:var ne=w;return Z(ne._context)+".Provider";case s:return N(w,w.render,"ForwardRef");case f:var Ie=w.displayName||null;return Ie!==null?Ie:ie(w.type)||"Memo";case d:{var Xe=w,ut=Xe._payload,Ge=Xe._init;try{return ie(Ge(ut))}catch{return null}}}return null}var J=Object.assign,ye=0,we,x,k,E,O,F,j;function X(){}X.__reactDisabledLog=!0;function te(){{if(ye===0){we=console.log,x=console.info,k=console.warn,E=console.error,O=console.group,F=console.groupCollapsed,j=console.groupEnd;var w={configurable:!0,enumerable:!0,value:X,writable:!0};Object.defineProperties(console,{info:w,log:w,warn:w,error:w,group:w,groupCollapsed:w,groupEnd:w})}ye++}}function xe(){{if(ye--,ye===0){var w={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},w,{value:we}),info:J({},w,{value:x}),warn:J({},w,{value:k}),error:J({},w,{value:E}),group:J({},w,{value:O}),groupCollapsed:J({},w,{value:F}),groupEnd:J({},w,{value:j})})}ye<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=_.ReactCurrentDispatcher,Ne;function ze(w,B,ne){{if(Ne===void 0)try{throw Error()}catch(Xe){var Ie=Xe.stack.trim().match(/\n( *(at )?)/);Ne=Ie&&Ie[1]||""}return`
18
- `+Ne+w}}var He=!1,it;{var Ft=typeof WeakMap=="function"?WeakMap:Map;it=new Ft}function qt(w,B){if(!w||He)return"";{var ne=it.get(w);if(ne!==void 0)return ne}var Ie;He=!0;var Xe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ut;ut=ce.current,ce.current=null,te();try{if(B){var Ge=function(){throw Error()};if(Object.defineProperty(Ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ge,[])}catch(Ma){Ie=Ma}Reflect.construct(w,[],Ge)}else{try{Ge.call()}catch(Ma){Ie=Ma}w.call(Ge.prototype)}}else{try{throw Error()}catch(Ma){Ie=Ma}w()}}catch(Ma){if(Ma&&Ie&&typeof Ma.stack=="string"){for(var je=Ma.stack.split(`
19
- `),Gn=Ie.stack.split(`
20
- `),Pt=je.length-1,Ut=Gn.length-1;Pt>=1&&Ut>=0&&je[Pt]!==Gn[Ut];)Ut--;for(;Pt>=1&&Ut>=0;Pt--,Ut--)if(je[Pt]!==Gn[Ut]){if(Pt!==1||Ut!==1)do if(Pt--,Ut--,Ut<0||je[Pt]!==Gn[Ut]){var ni=`
21
- `+je[Pt].replace(" at new "," at ");return w.displayName&&ni.includes("<anonymous>")&&(ni=ni.replace("<anonymous>",w.displayName)),typeof w=="function"&&it.set(w,ni),ni}while(Pt>=1&&Ut>=0);break}}}finally{He=!1,ce.current=ut,xe(),Error.prepareStackTrace=Xe}var Kf=w?w.displayName||w.name:"",W6=Kf?ze(Kf):"";return typeof w=="function"&&it.set(w,W6),W6}function Ht(w,B,ne){return qt(w,!1)}function xn(w){var B=w.prototype;return!!(B&&B.isReactComponent)}function Nr(w,B,ne){if(w==null)return"";if(typeof w=="function")return qt(w,xn(w));if(typeof w=="string")return ze(w);switch(w){case c:return ze("Suspense");case l:return ze("SuspenseList")}if(typeof w=="object")switch(w.$$typeof){case s:return Ht(w.render);case f:return Nr(w.type,B,ne);case d:{var Ie=w,Xe=Ie._payload,ut=Ie._init;try{return Nr(ut(Xe),B,ne)}catch{}}}return""}var fr=Object.prototype.hasOwnProperty,Q={},re=_.ReactDebugCurrentFrame;function ke(w){if(w){var B=w._owner,ne=Nr(w.type,w._source,B?B.type:null);re.setExtraStackFrame(ne)}else re.setExtraStackFrame(null)}function Ot(w,B,ne,Ie,Xe){{var ut=Function.call.bind(fr);for(var Ge in w)if(ut(w,Ge)){var je=void 0;try{if(typeof w[Ge]!="function"){var Gn=Error((Ie||"React class")+": "+ne+" type `"+Ge+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof w[Ge]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Gn.name="Invariant Violation",Gn}je=w[Ge](B,Ge,Ie,ne,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Pt){je=Pt}je&&!(je instanceof Error)&&(ke(Xe),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ie||"React class",ne,Ge,typeof je),ke(null)),je instanceof Error&&!(je.message in Q)&&(Q[je.message]=!0,ke(Xe),g("Failed %s type: %s",ne,je.message),ke(null))}}}var ei=Array.isArray;function Ui(w){return ei(w)}function Bi(w){{var B=typeof Symbol=="function"&&Symbol.toStringTag,ne=B&&w[Symbol.toStringTag]||w.constructor.name||"Object";return ne}}function wa(w){try{return Ca(w),!1}catch{return!0}}function Ca(w){return""+w}function Ea(w){if(wa(w))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Bi(w)),Ca(w)}var ti=_.ReactCurrentOwner,ju={key:!0,ref:!0,__self:!0,__source:!0},Df,P,A;A={};function L(w){if(fr.call(w,"ref")){var B=Object.getOwnPropertyDescriptor(w,"ref").get;if(B&&B.isReactWarning)return!1}return w.ref!==void 0}function Pe(w){if(fr.call(w,"key")){var B=Object.getOwnPropertyDescriptor(w,"key").get;if(B&&B.isReactWarning)return!1}return w.key!==void 0}function W(w,B){if(typeof w.ref=="string"&&ti.current&&B&&ti.current.stateNode!==B){var ne=ie(ti.current.type);A[ne]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ie(ti.current.type),w.ref),A[ne]=!0)}}function ae(w,B){{var ne=function(){Df||(Df=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",B))};ne.isReactWarning=!0,Object.defineProperty(w,"key",{get:ne,configurable:!0})}}function ge(w,B){{var ne=function(){P||(P=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",B))};ne.isReactWarning=!0,Object.defineProperty(w,"ref",{get:ne,configurable:!0})}}var ve=function(w,B,ne,Ie,Xe,ut,Ge){var je={$$typeof:t,type:w,key:B,ref:ne,props:Ge,_owner:ut};return je._store={},Object.defineProperty(je._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(je,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ie}),Object.defineProperty(je,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Xe}),Object.freeze&&(Object.freeze(je.props),Object.freeze(je)),je};function Ce(w,B,ne,Ie,Xe){{var ut,Ge={},je=null,Gn=null;ne!==void 0&&(Ea(ne),je=""+ne),Pe(B)&&(Ea(B.key),je=""+B.key),L(B)&&(Gn=B.ref,W(B,Xe));for(ut in B)fr.call(B,ut)&&!ju.hasOwnProperty(ut)&&(Ge[ut]=B[ut]);if(w&&w.defaultProps){var Pt=w.defaultProps;for(ut in Pt)Ge[ut]===void 0&&(Ge[ut]=Pt[ut])}if(je||Gn){var Ut=typeof w=="function"?w.displayName||w.name||"Unknown":w;je&&ae(Ge,Ut),Gn&&ge(Ge,Ut)}return ve(w,je,Gn,Xe,Ie,ti.current,Ge)}}var ct=_.ReactCurrentOwner,Hn=_.ReactDebugCurrentFrame;function Fr(w){if(w){var B=w._owner,ne=Nr(w.type,w._source,B?B.type:null);Hn.setExtraStackFrame(ne)}else Hn.setExtraStackFrame(null)}var qf;qf=!1;function zi(w){return typeof w=="object"&&w!==null&&w.$$typeof===t}function Uf(){{if(ct.current){var w=ie(ct.current.type);if(w)return`
22
-
23
- Check the render method of \``+w+"`."}return""}}function Bf(w){{if(w!==void 0){var B=w.fileName.replace(/^.*[\\\/]/,""),ne=w.lineNumber;return`
24
-
25
- Check your code at `+B+":"+ne+"."}return""}}var Ra={};function UR(w){{var B=Uf();if(!B){var ne=typeof w=="string"?w:w.displayName||w.name;ne&&(B=`
26
-
27
- Check the top-level render call using <`+ne+">.")}return B}}function zf(w,B){{if(!w._store||w._store.validated||w.key!=null)return;w._store.validated=!0;var ne=UR(B);if(Ra[ne])return;Ra[ne]=!0;var Ie="";w&&w._owner&&w._owner!==ct.current&&(Ie=" It was passed a child from "+ie(w._owner.type)+"."),Fr(w),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ne,Ie),Fr(null)}}function Oc(w,B){{if(typeof w!="object")return;if(Ui(w))for(var ne=0;ne<w.length;ne++){var Ie=w[ne];zi(Ie)&&zf(Ie,B)}else if(zi(w))w._store&&(w._store.validated=!0);else if(w){var Xe=m(w);if(typeof Xe=="function"&&Xe!==w.entries)for(var ut=Xe.call(w),Ge;!(Ge=ut.next()).done;)zi(Ge.value)&&zf(Ge.value,B)}}}function Uxe(w){{var B=w.type;if(B==null||typeof B=="string")return;var ne;if(typeof B=="function")ne=B.propTypes;else if(typeof B=="object"&&(B.$$typeof===s||B.$$typeof===f))ne=B.propTypes;else return;if(ne){var Ie=ie(B);Ot(ne,w.props,"prop",Ie,w)}else if(B.PropTypes!==void 0&&!qf){qf=!0;var Xe=ie(B);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Xe||"Unknown")}typeof B.getDefaultProps=="function"&&!B.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Bxe(w){{for(var B=Object.keys(w.props),ne=0;ne<B.length;ne++){var Ie=B[ne];if(Ie!=="children"&&Ie!=="key"){Fr(w),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ie),Fr(null);break}}w.ref!==null&&(Fr(w),g("Invalid attribute `ref` supplied to `React.Fragment`."),Fr(null))}}function P6(w,B,ne,Ie,Xe,ut){{var Ge=Y(w);if(!Ge){var je="";(w===void 0||typeof w=="object"&&w!==null&&Object.keys(w).length===0)&&(je+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Gn=Bf(Xe);Gn?je+=Gn:je+=Uf();var Pt;w===null?Pt="null":Ui(w)?Pt="array":w!==void 0&&w.$$typeof===t?(Pt="<"+(ie(w.type)||"Unknown")+" />",je=" Did you accidentally export a JSX literal instead of a component?"):Pt=typeof w,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Pt,je)}var Ut=Ce(w,B,ne,Xe,ut);if(Ut==null)return Ut;if(Ge){var ni=B.children;if(ni!==void 0)if(Ie)if(Ui(ni)){for(var Kf=0;Kf<ni.length;Kf++)Oc(ni[Kf],w);Object.freeze&&Object.freeze(ni)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Oc(ni,w)}return w===r?Bxe(Ut):Uxe(Ut),Ut}}function zxe(w,B,ne){return P6(w,B,ne,!0)}function Kxe(w,B,ne){return P6(w,B,ne,!1)}var Vxe=Kxe,Hxe=zxe;Gf.Fragment=r,Gf.jsx=Vxe,Gf.jsxs=Hxe}()),Gf}(function(e){process.env.NODE_ENV==="production"?e.exports=U6():e.exports=B6()})(q6);var YR=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},c_=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},JR=function(e){var t=c_(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},l_=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},ZR=function(e){var t=l_(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}},z6=function(e){return function(t){return t(e)}};function D(e){return e}var Cc=D;function Yn(e){return function(){return e}}var f_=Yn(!0),XR=Yn(!1),QR=Yn(null),d_=Yn(void 0),K6=d_;function V6(e){return function(t,n){return e(n,t)}}function V(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function eM(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function H6(e){return e+1}function G6(e){return e-1}function tM(e){throw new Error("Called `absurd` function which should be uncallable")}function Y6(e){return function(t){return e.apply(void 0,t)}}function J6(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function y(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return u(a(o(i(r(n(t(e)))))));case 9:return s(u(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var Z6=tM,Jn=function(e,t){return t};function X6(e){return function(t){return!e(t)}}var Q6=function(){return{concat:function(e,t){return V(e,t)},empty:D}};const nM=Object.freeze(Object.defineProperty({__proto__:null,SK:Jn,absurd:tM,apply:z6,constFalse:XR,constNull:QR,constTrue:f_,constUndefined:d_,constVoid:K6,constant:Yn,decrement:G6,flip:V6,flow:V,getBooleanAlgebra:YR,getEndomorphismMonoid:Q6,getMonoid:JR,getRing:ZR,getSemigroup:c_,getSemiring:l_,hole:Z6,identity:D,increment:H6,not:X6,pipe:y,tuple:eM,tupled:Y6,unsafeCoerce:Cc,untupled:J6},Symbol.toStringTag,{value:"Module"}));var Pr=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},rM=function(e){return Pr(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},iM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Pr(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},eG=function(e,t){return y(e,oM(t))},oM=function(e){return function(t){return Pr(function(n,r){return t.equals(e(n),e(r))})}},aM="Eq",Ec={equals:function(e,t){return e===t}},tG={equals:function(){return!0}},uM=function(){return{concat:function(e,t){return Pr(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},nG=function(){return{concat:uM().concat,empty:tG}},sM={URI:aM,contramap:eG},rG=iM,iG=rM,oG=Ec.equals,aG=sM,uG=Ec,sG=Ec,cG=Ec,lG={equals:function(e,t){return e.valueOf()===t.valueOf()}};const fG=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:sM,URI:aM,contramap:oM,eq:aG,eqBoolean:uG,eqDate:lG,eqNumber:cG,eqStrict:Ec,eqString:sG,fromEquals:Pr,getMonoid:nG,getSemigroup:uM,getStructEq:iG,getTupleEq:rG,strictEqual:oG,struct:rM,tuple:iM},Symbol.toStringTag,{value:"Module"}));function Rc(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function Ke(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function wt(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function Mc(e,t){var n=Rc(e,t);return{map:function(r,i){return y(r,n(i))}}}const dG=Object.freeze(Object.defineProperty({__proto__:null,bindTo:wt,flap:Ke,getFunctorComposition:Mc,map:Rc},Symbol.toStringTag,{value:"Module"}));var pG=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Wt=function(e){return e._tag==="None"},bt=function(e){return e._tag==="Some"},be={_tag:"None"},pe=function(e){return{_tag:"Some",value:e}},Gt=function(e){return e._tag==="Left"},p_=function(e){return e._tag==="Right"},$o=function(e){return{_tag:"Left",left:e}},xa=function(e){return{_tag:"Right",right:e}},Yf=function(e){return[e]},gt=function(e){return e.length>0},dr=function(e){return e[0]},xc=function(e){return e.slice(1)},rn=[],Yt={},lt=Object.prototype.hasOwnProperty,um=function(e){return pG([e[0]],e.slice(1),!0)},Me=function(e,t){return{left:e,right:t}},hG=function(e,t){return y(e,h_(t))},mG=function(e,t){return y(e,cM(t))},vG=function(e,t,n){return y(e,lM(t,n))},h_=function(e){return function(t){return Me(Jf(t),e(Zf(t)))}},cM=function(e){return function(t){return Me(e(Jf(t)),Zf(t))}},lM=function(e,t){return function(n){return Me(e(Jf(n)),t(Zf(n)))}},m_="Separated",gG={URI:m_,mapLeft:mG,bimap:vG},fM={URI:m_,map:hG},yG=Ke(fM),Jf=function(e){return e.left},Zf=function(e){return e.right};const bG=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:gG,Functor:fM,URI:m_,bimap:lM,flap:yG,left:Jf,map:h_,mapLeft:cM,right:Zf,separated:Me},Symbol.toStringTag,{value:"Module"}));function To(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function Ct(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Et(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Rt(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}function Jt(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function v_(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):v_(e,t-1,i)}}var g_={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function _G(e){return lt.call(g_,e)||(g_[e]=v_(eM,e-1,[])),g_[e]}function SG(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=_G(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function $G(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return v_(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function TG(e){return function(t){for(var n=Object.keys(t),r=n.length,i=$G(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const IG=Object.freeze(Object.defineProperty({__proto__:null,ap:To,apFirst:Ct,apS:Rt,apSecond:Et,getApplySemigroup:Jt,sequenceS:TG,sequenceT:SG},Symbol.toStringTag,{value:"Module"}));function ft(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Mt(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}const OG=Object.freeze(Object.defineProperty({__proto__:null,bind:Mt,chainFirst:ft},Symbol.toStringTag,{value:"Module"}));var dM=function(e){return function(t,n){return t===n||e(t,n)===0}},Lu=function(e){return{equals:dM(e),compare:function(t,n){return t===n?0:e(t,n)}}},pM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Lu(function(n,r){for(var i=0;i<e.length-1;i++){var o=e[i].compare(n[i],r[i]);if(o!==0)return o}return e[i].compare(n[i],r[i])})},y_=function(e){return Lu(function(t,n){return e.compare(n,t)})},wG=function(e,t){return y(e,sm(t))},sm=function(e){return function(t){return Lu(function(n,r){return t.compare(e(n),e(r))})}},hM="Ord",mM=function(){return{concat:function(e,t){return Lu(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},b_=function(){return{concat:mM().concat,empty:Lu(function(){return 0})}},vM={URI:hM,contramap:wG},CG={equals:f_,compare:Yn(0)},EG=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},gM=function(e){return function(t,n){return e.compare(t,n)===-1}},yM=function(e){return function(t,n){return e.compare(t,n)===1}},RG=function(e){return function(t,n){return e.compare(t,n)!==1}},MG=function(e){return function(t,n){return e.compare(t,n)!==-1}},cm=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},lm=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},bM=function(e){var t=cm(e),n=lm(e);return function(r,i){return function(o){return n(t(o,i),r)}}},xG=function(e){var t=gM(e),n=yM(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},kG=pM,AG=y_,NG=vM;function FG(e,t){return e<t?-1:e>t?1:0}var __={equals:Ec.equals,compare:FG},PG=__,WG=__,fm=__,jG=y(fm,sm(function(e){return e.valueOf()}));const LG=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:vM,URI:hM,between:xG,clamp:bM,contramap:sm,equals:EG,equalsDefault:dM,fromCompare:Lu,geq:MG,getDualOrd:AG,getMonoid:b_,getSemigroup:mM,getTupleOrd:kG,gt:yM,leq:RG,lt:gM,max:lm,min:cm,ord:NG,ordBoolean:PG,ordDate:jG,ordNumber:fm,ordString:WG,reverse:y_,trivial:CG,tuple:pM},Symbol.toStringTag,{value:"Module"}));var _M=function(e){return{concat:function(t,n){return e.concat(n,t)}}},DG=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},qG=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},UG=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},SM=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const BG=Object.freeze(Object.defineProperty({__proto__:null,concatAll:SM,endo:UG,filterFirst:DG,filterSecond:qG,reverse:_M},Symbol.toStringTag,{value:"Module"}));var dm=function(e){return{concat:cm(e)}},pm=function(e){return{concat:lm(e)}},S_=function(e){return{concat:function(){return e}}},$_=_M,T_=function(e){return{concat:function(t,n){var r={};for(var i in e)lt.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},I_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,o){return i.concat(n[o],r[o])})}}},$M=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},O_=function(){return{concat:D}},hm=function(){return{concat:function(e,t){return t}}},w_=SM,TM=S_(void 0),zG=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},KG=hm,VG=O_,HG=I_,GG=T_,YG=$_,JG=pm,ZG=dm,XG=$M;function QG(e){var t=w_(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var IM={concat:function(e,t){return e&&t}},OM={concat:function(e,t){return e||t}},e9=c_,wM={concat:function(e,t){return e+t}},CM={concat:function(e,t){return e+t}},EM={concat:function(e,t){return e*t}};const RM=Object.freeze(Object.defineProperty({__proto__:null,concatAll:w_,constant:S_,first:O_,fold:QG,getDualSemigroup:YG,getFirstSemigroup:VG,getFunctionSemigroup:e9,getIntercalateSemigroup:XG,getJoinSemigroup:JG,getLastSemigroup:KG,getMeetSemigroup:ZG,getObjectSemigroup:zG,getStructSemigroup:GG,getTupleSemigroup:HG,intercalate:$M,last:hm,max:pm,min:dm,reverse:$_,semigroupAll:IM,semigroupAny:OM,semigroupProduct:EM,semigroupString:wM,semigroupSum:CM,semigroupVoid:TM,struct:T_,tuple:I_},Symbol.toStringTag,{value:"Module"}));var Xf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Qf=rn,Ki=gt,mm=function(e,t){return e<0||e>=t.length},C_=function(e){return function(t){return Xf([e],t,!0)}},kc=C_,E_=function(e){return function(t){return Xf(Xf([],t,!0),[e],!1)}},vm=E_,gm=function(e,t,n){if(Ki(n)){var r=um(n);return r.splice(e,0,t),r}return[t]},R_=function(e,t,n){if(n[e]===t)return n;var r=um(n);return r[e]=t,r},M_=function(e){return function(t){if(t.length===1)return t;for(var n=[An(t)],r=ii(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},MM=function(e){if(Ki(e)){var t=b_();return A_(e.reduce(t.concat,t.empty))}return D},x_=function(e){var t=M_(e);return function(n){return function(r){return t(y(r,td(n)))}}},k_=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(mm(Math.abs(r),t)||r===0)return t;if(r<0){var i=_m(-r)(t),o=i[0],a=i[1];return y(a,td(o))}else return k_(r-n)(t)}},ed=function(e){return Ki(e)?pe(e):be},ym=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},t9=function(e){return ym(function(){return e})},xM=function(e,t){return e<=t?ym(function(n){return e+n})(t-e+1):[e]},kM=function(e){return[An(e),ii(e)]},AM=function(e){return[Ac(e),Aa(e)]},n9=function(e){return ed(e.slice())};function NM(e){return function(t){return t.concat(e)}}function td(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var r9=function(e){return e.length===1?e:Xf([Aa(e)],e.slice(0,-1).reverse(),!0)};function FM(e){return function(t){var n=t.length;if(n===0)return Qf;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var i9=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);lt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},A_=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},o9=function(e,t){return PM(e,function(){return t})},PM=function(e,t){return function(n){return mm(e,n)?be:pe(R_(e,t(n[e]),n))}},WM=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function jM(e,t){return t===void 0?function(n){return jM(n,e)}:WM(e,t,function(n,r){return[n,r]})}var a9=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},bm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},N_=function(e){return function(t){var n=ii(t);return Ki(n)?y(n,bm(e),kc(An(t))):t}},LM=function(e){return function(t){for(var n=um(e(0,An(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},F_=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Ki(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},_m=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,Qf]:[y(t.slice(1,n),kc(An(t))),t.slice(n)]}},DM=function(e){return F_(_m(e))},ri=function(e,t){return y(e,B_(t))},P_=function(e,t){return y(e,z_(t))},nd=function(e,t){return y(e,VM(t))},W_=function(e,t){return y(e,Sm(t))},qM=function(e,t){return y(e,U_(t))},rd=function(e,t,n){return y(e,K_(t,n))},id=function(e){var t=V_(e);return function(n,r){return y(n,t(r))}},od=function(e,t,n){return y(e,H_(t,n))},j_=function(e){var t=HM(e);return function(n,r){return y(n,t(r))}},UM=function(e,t){return y(e,KM(t))},L_=function(e,t,n){return y(e,$m(t,n))},D_=function(e){var t=G_(e);return function(n,r){return y(n,t(r))}},q_=function(e,t,n){return y(e,Tm(t,n))},BM=function(e){var t=Om(e);return function(n,r){return y(n,t(r))}},ka=Yf,zM=function(e){return function(t){return y(t,NM(e()))}},KM=zM,VM=function(e){return Sm(function(t){return y(e,B_(t))})},Sm=function(e){return LM(function(t,n){return e(n)})},U_=function(e){return function(t){for(var n=ii(t),r=[e(t)];Ki(n);)r.push(e(n)),n=ii(n);return r}},u9=U_(D),s9=Sm(D),B_=function(e){return z_(function(t,n){return e(n)})},z_=function(e){return function(t){for(var n=[e(0,An(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},K_=function(e,t){return $m(e,function(n,r,i){return t(r,i)})},V_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i){return e.concat(r,t(i))},t(n[0]))}}},H_=function(e,t){return Tm(e,function(n,r,i){return t(r,i)})},$m=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},G_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i,o){return e.concat(r,t(o+1,i))},t(0,n[0]))}}},Tm=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},HM=function(e){var t=Om(e);return function(n){return t(function(r,i){return n(i)})}},Im=function(e){return Om(e)(Jn)},Om=function(e){return function(t){return function(n){for(var r=e.map(t(0,An(n)),ka),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return y(o,vm(a))}}),t(i,n[i]));return r}}},wm=dr,kn="ReadonlyNonEmptyArray",GM=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},c9=function(){return{concat:td}},YM=function(e){return Pr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},l9=function(e){var t=x_(e);return{concat:function(n,r){return t(r)(n)}}},Y_={URI:kn,map:ri},f9=Ke(Y_),d9={URI:kn,of:ka},p9={URI:kn,map:ri,mapWithIndex:P_},Cm={URI:kn,map:ri,ap:nd},h9=Ct(Cm),m9=Et(Cm),v9={URI:kn,map:ri,ap:nd,of:ka},J_={URI:kn,map:ri,ap:nd,chain:W_},g9=ft(J_),y9={URI:kn,map:ri,ap:nd,of:ka,chain:W_},b9={URI:kn,reduce:rd,foldMap:id,reduceRight:od},_9={URI:kn,reduce:rd,foldMap:id,reduceRight:od,reduceWithIndex:L_,foldMapWithIndex:D_,reduceRightWithIndex:q_},S9={URI:kn,map:ri,reduce:rd,foldMap:id,reduceRight:od,traverse:j_,sequence:Im},$9={URI:kn,map:ri,mapWithIndex:P_,reduce:rd,foldMap:id,reduceRight:od,traverse:j_,sequence:Im,reduceWithIndex:L_,foldMapWithIndex:D_,reduceRightWithIndex:q_,traverseWithIndex:BM},T9={URI:kn,map:ri,alt:UM},I9={URI:kn,map:ri,extend:qM,extract:wm},O9=ka(Yt),w9=wt(Y_),C9=Mt(J_),E9=Rt(Cm),An=wm,ii=xc,Aa=function(e){return e[e.length-1]},Ac=function(e){return e.slice(0,-1)},JM=function(e){var t=dm(e);return function(n){return n.reduce(t.concat)}},ZM=function(e){var t=pm(e);return function(n){return n.reduce(t.concat)}},Em=function(e){return function(t){return t.reduce(e.concat)}},R9=function(e){return function(t){return e(An(t),ii(t))}},M9=function(e){return function(t){return e(Ac(t),Aa(t))}},XM=function(e){return function(t){return Xf([e(An(t))],ii(t),!0)}},x9=function(e){return XM(function(){return e})},QM=function(e){return function(t){return y(Ac(t),vm(e(Aa(t))))}},k9=function(e){return QM(function(){return e})},Z_=function(e){var t=Em(e);return function(n){return V(N_(n),t)}};function A9(e){var t=A_(e),n=FM(e);return function(r){return Ki(r)?n(t(r)):Qf}}function N9(e){return ex(function(t,n){return e(n)})}var ex=function(e){return function(t){return ed(t.filter(function(n,r){return e(r,n)}))}},F9=kM,P9=AM;function tx(e,t){return t===void 0?kc(e):y(t,kc(e))}var nx=function(e,t){return y(e,td([t]))},W9=function(e,t){return function(n){return e<0||e>n.length?be:pe(gm(e,t,n))}},j9=bm,L9=Em,D9={URI:kn,of:ka,map:ri,mapWithIndex:P_,ap:nd,chain:W_,extend:qM,extract:wm,reduce:rd,foldMap:id,reduceRight:od,traverse:j_,sequence:Im,reduceWithIndex:L_,foldMapWithIndex:D_,reduceRightWithIndex:q_,traverseWithIndex:BM,alt:UM};const q9=Object.freeze(Object.defineProperty({__proto__:null,Alt:T9,Applicative:v9,Apply:Cm,Chain:J_,Comonad:I9,Do:O9,Foldable:b9,FoldableWithIndex:_9,Functor:Y_,FunctorWithIndex:p9,Monad:y9,Pointed:d9,Traversable:S9,TraversableWithIndex:$9,URI:kn,alt:KM,altW:zM,ap:VM,apFirst:h9,apS:E9,apSecond:m9,append:vm,appendW:E_,bind:C9,bindTo:w9,chain:Sm,chainFirst:g9,chainWithIndex:LM,chop:F_,chunksOf:DM,concat:td,concatAll:Em,concatW:NM,cons:tx,duplicate:u9,empty:Qf,extend:U_,extract:wm,filter:N9,filterWithIndex:ex,flap:f9,flatten:s9,fold:L9,foldMap:V_,foldMapWithIndex:G_,fromArray:n9,fromReadonlyArray:ed,getEq:YM,getSemigroup:c9,getShow:GM,getUnionSemigroup:l9,group:FM,groupBy:i9,groupSort:A9,head:An,init:Ac,insertAt:W9,intercalate:Z_,intersperse:N_,isNonEmpty:Ki,isOutOfBound:mm,last:Aa,makeBy:ym,map:B_,mapWithIndex:z_,matchLeft:R9,matchRight:M9,max:ZM,min:JM,modifyAt:PM,modifyHead:XM,modifyLast:QM,of:ka,prepend:kc,prependAll:bm,prependToAll:j9,prependW:C_,range:xM,readonlyNonEmptyArray:D9,reduce:K_,reduceRight:H_,reduceRightWithIndex:Tm,reduceWithIndex:$m,replicate:t9,reverse:r9,rotate:k_,sequence:Im,snoc:nx,sort:A_,sortBy:MM,splitAt:_m,tail:ii,traverse:HM,traverseWithIndex:Om,unappend:AM,uncons:F9,union:x_,uniq:M_,unprepend:kM,unsafeInsertAt:gm,unsafeUpdateAt:R_,unsnoc:P9,unzip:a9,updateAt:o9,updateHead:x9,updateLast:k9,zip:jM,zipWith:WM},Symbol.toStringTag,{value:"Module"}));var rx={equals:function(e,t){return e===t}},ix={concat:function(e,t){return e+t}},ox="",U9={concat:ix.concat,empty:ox},K={equals:rx.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},B9={show:function(e){return JSON.stringify(e)}},z9=function(e){return typeof e=="string"},K9=function(e){return e.toUpperCase()},V9=function(e){return e.toLowerCase()},H9=function(e,t){return function(n){return n.replace(e,t)}},G9=function(e){return e.trim()},Y9=function(e){return e.trimLeft()},J9=function(e){return e.trimRight()},Z9=function(e,t){return function(n){return n.slice(e,t)}},X9=function(e){return e.length===0},Q9=function(e){return e.length},eY=function(e){return function(t){var n=t.split(e);return Ki(n)?n:[t]}},tY=function(e,t){return function(n){return n.includes(e,t)}},nY=function(e,t){return function(n){return n.startsWith(e,t)}},rY=function(e,t){return function(n){return n.endsWith(e,t)}};const iY=Object.freeze(Object.defineProperty({__proto__:null,Eq:rx,Monoid:U9,Ord:K,Semigroup:ix,Show:B9,empty:ox,endsWith:rY,includes:tY,isEmpty:X9,isString:z9,replace:H9,size:Q9,slice:Z9,split:eY,startsWith:nY,toLowerCase:V9,toUpperCase:K9,trim:G9,trimLeft:Y9,trimRight:J9},Symbol.toStringTag,{value:"Module"}));function oi(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ai(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function X_(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?pe(o):be})})}}}}const oY=Object.freeze(Object.defineProperty({__proto__:null,filterE:X_,wiltDefault:oi,witherDefault:ai},Symbol.toStringTag,{value:"Module"}));var aY=function(e){return Object.assign({},e)},uY=function(e){return Object.assign({},e)},ax=function(e){return Object.keys(e).length},ui=function(e){for(var t in e)if(lt.call(e,t))return!1;return!0},Nc=function(e){return function(t){return Object.keys(t).sort(e.compare)}},sY=Nc(K);function Rm(e){if(typeof e=="function")return Rm(K)(e);var t=Nc(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var Mm=Rm(K)(function(e,t){return[e,t]});function cY(e){return function(t){var n=Mm(t),r=n.length;return e.unfold(0,function(i){return i<r?pe([n[i],i+1]):be})}}var Q_=function(e,t){return function(n){if(lt.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},Io=function(e,t){return lt.call(t,e)};function xm(e){return function(t){if(!lt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var lY=function(e,t){return function(n){if(!Io(e,n))return be;if(n[e]===t)return pe(n);var r=Object.assign({},n);return r[e]=t,pe(r)}},fY=function(e,t){return function(n){if(!Io(e,n))return be;var r=t(n[e]);if(r===n[e])return pe(n);var i=Object.assign({},n);return i[e]=r,pe(i)}};function dY(e){var t=xm(e);return function(n){var r=Du(e,n);return Wt(r)?be:pe([r.value,t(n)])}}function km(e){return function(t,n){if(n===void 0){var r=km(e);return function(o){return r(o,t)}}for(var i in t)if(!lt.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function Du(e,t){return t===void 0?function(n){return Du(e,n)}:lt.call(t,e)?pe(t[e]):be}var ad={};function Am(e){return function(t){var n={};for(var r in t)lt.call(t,r)&&(n[r]=e(r,t[r]));return n}}function eS(e){return Am(function(t,n){return e(n)})}function Fc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Fc(K).apply(void 0,e);var n=Nc(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=0;c<s;c++){var l=u[c];a=i(l,a,o[l])}return a}}}function Pc(e){if("compare"in e){var t=Nc(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=t(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n.concat(o,r(c,i[c]))}return o}}}}return Pc(K)(e)}function Wc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Wc(K).apply(void 0,e);var n=Nc(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=s-1;c>=0;c--){var l=u[c];a=i(l,o[l],a)}return a}}}var ux=function(e,t){var n;return n={},n[e]=t,n};function sx(e){var t=sd(K)(e);return function(n){return function(r){return t(r,n)}}}function Nm(e){var t=Vi(K)(e);return function(n){return function(r){return t(r,n)}}}function jc(e){return ud(K)(e)}var pY=function(e){var t=Nm(e);return function(n){return function(r){return e.map(y(r,t(n)),Oo)}}},hY=function(e){var t=Nm(e);return function(n){return function(r){return e.map(y(r,t(n)),wo)}}};function Fm(e){return function(t){var n={},r={};for(var i in t)if(lt.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right;break}}return Me(n,r)}}function Pm(e){return function(t){var n={},r={};for(var i in t)if(lt.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Me(n,r)}}function Wm(e){return function(t){var n={};for(var r in t)if(lt.call(t,r)){var i=e(r,t[r]);bt(i)&&(n[r]=i.value)}return n}}function jm(e){return function(t){var n={},r=!1;for(var i in t)if(lt.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function cx(e,t){var n=tS(e,t);return function(r){return n(r,D)}}function tS(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),u=a[0],s=a[1];return i[u]=lt.call(i,u)?e.concat(i[u],s):s,i})}}var mY=Mm,vY=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function lx(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function fx(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function nS(e){return function(t,n){if(n===void 0){var r=nS(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var rS=function(e){return function(t){return function(n){if(ui(n))return t;if(ui(t))return n;var r={};for(var i in n)Io(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)Io(i,r)||(r[i]=t[i]);return r}}},iS=function(e){return function(t){return function(n){if(ui(n)||ui(t))return ad;var r={};for(var i in n)Io(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},oS=function(e){return function(t){if(ui(t))return e;if(ui(e))return t;var n={};for(var r in t)Io(r,e)||(n[r]=t[r]);for(var r in e)Io(r,t)||(n[r]=e[r]);return n}},pr=function(e,t){return y(e,eS(t))},qu=function(e,t){return y(e,Am(t))},hr=function(e){var t=cd(e);return function(n,r,i){return y(n,t(r,i))}},mr=function(e){return function(t){var n=ld(e)(t);return function(r,i){return y(r,n(i))}}},vr=function(e){var t=fd(e);return function(n,r,i){return y(n,t(r,i))}},Uu=function(e,t){return y(e,aS(t))},Bu=function(e,t){return y(e,uS(t))},zu=function(e,t){return y(e,Bm(t))},Ku=function(e,t){return y(e,sS(t))},Vu=function(e){var t=Fc(e);return function(n,r,i){return y(n,t(r,i))}},Hu=function(e){var t=Pc(e);return function(n){var r=t(n);return function(i,o){return y(i,r(o))}}},Gu=function(e){var t=Wc(e);return function(n,r,i){return y(n,t(r,i))}},Lm=function(e,t){return y(e,Fm(t))},Dm=function(e,t){return y(e,Pm(t))},qm=function(e,t){return y(e,Wm(t))},Um=function(e,t){return y(e,jm(t))},Vi=function(e){var t=sd(e);return function(n){var r=t(n);return function(i,o){return r(i,V(Jn,o))}}},ud=function(e){var t=Vi(e);return function(n){var r=t(n);return function(i){return r(i,D)}}},sd=function(e){return function(t){var n=Nc(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(ad);for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){var h;return Object.assign({},d,(h={},h[f]=p,h))}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},aS=function(e){return jm(function(t,n){return e(n)})},uS=function(e){return Wm(function(t,n){return e(n)})},Bm=function(e){return Pm(function(t,n){return e(n)})},sS=function(e){return Fm(function(t,n){return e(n)})};function cd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Fc(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return cd(K).apply(void 0,e)}function ld(e){if("compare"in e){var t=Pc(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return ld(K)(e)}function fd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Wc(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return fd(K).apply(void 0,e)}var Oo=function(e){var t={};for(var n in e)if(lt.call(e,n)){var r=e[n];bt(r)&&(t[n]=r.value)}return t},wo=function(e){var t={},n={};for(var r in e)if(lt.call(e,r)){var i=e[r];Gt(i)?t[r]=i.left:n[r]=i.right}return Me(t,n)},on="ReadonlyRecord";function zm(e){return"compare"in e?function(t){return{show:function(n){var r=Rm(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:zm(K)(e)}function dx(e){var t=km(e);return Pr(function(n,r){return t(n)(r)&&t(r)(n)})}function px(e){return{concat:function(t,n){if(ui(t))return n;if(ui(n))return t;var r=Object.assign({},t);for(var i in n)lt.call(n,i)&&(r[i]=lt.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:ad}}var hx={URI:on,map:pr},gY=Ke(hx),yY={URI:on,map:pr,mapWithIndex:qu},bY=function(e){return{URI:on,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e)}},_Y=function(e){return{URI:on,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),reduceWithIndex:Vu(e),foldMapWithIndex:Hu(e),reduceRightWithIndex:Gu(e)}},dd={URI:on,compact:Oo,separate:wo},SY={URI:on,map:pr,compact:Oo,separate:wo,filter:Uu,filterMap:Bu,partition:zu,partitionMap:Ku},$Y={URI:on,map:pr,mapWithIndex:qu,compact:Oo,separate:wo,filter:Uu,filterMap:Bu,partition:zu,partitionMap:Ku,filterMapWithIndex:qm,filterWithIndex:Um,partitionMapWithIndex:Lm,partitionWithIndex:Dm},mx=function(e){return{URI:on,map:pr,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),traverse:Vi(e),sequence:ud(e)}},TY=function(e){return{URI:on,map:pr,mapWithIndex:qu,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),reduceWithIndex:Vu(e),foldMapWithIndex:Hu(e),reduceRightWithIndex:Gu(e),traverse:Vi(e),sequence:ud(e),traverseWithIndex:sd(e)}},IY=function(e){var t=mx(e);return{URI:on,map:pr,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),traverse:t.traverse,sequence:t.sequence,compact:Oo,separate:wo,filter:Uu,filterMap:Bu,partition:zu,partitionMap:Ku,wither:ai(t,dd),wilt:oi(t,dd)}},vx=function(e){var t=rS(e);return{concat:function(n,r){return t(r)(n)}}},OY=function(e){return{concat:vx(e).concat,empty:ad}},wY=function(e){var t=iS(e);return{concat:function(n,r){return t(r)(n)}}},CY=function(){return{concat:function(e,t){return oS(t)(e)}}},EY={URI:on,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K)},RY={URI:on,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),reduceWithIndex:Vu(K),foldMapWithIndex:Hu(K),reduceRightWithIndex:Gu(K)},cS={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Vi(K),sequence:jc},MY={URI:on,map:pr,mapWithIndex:qu,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),reduceWithIndex:Vu(K),foldMapWithIndex:Hu(K),reduceRightWithIndex:Gu(K),traverse:Vi(K),sequence:jc,traverseWithIndex:sd(K)},gx=ai(cS,dd),yx=oi(cS,dd),xY={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Vi(K),sequence:jc,compact:Oo,separate:wo,filter:Uu,filterMap:Bu,partition:zu,partitionMap:Ku,wither:gx,wilt:yx},lS=Q_;function bx(e,t){return lt.call(t===void 0?this:t,e)}var kY={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Vi(K),sequence:jc,compact:Oo,separate:wo,filter:Uu,filterMap:Bu,partition:zu,partitionMap:Ku,mapWithIndex:qu,reduceWithIndex:Vu(K),foldMapWithIndex:Hu(K),reduceRightWithIndex:Gu(K),filterMapWithIndex:qm,filterWithIndex:Um,partitionMapWithIndex:Lm,partitionWithIndex:Dm,traverseWithIndex:sd(K),wither:gx,wilt:yx};const AY=Object.freeze(Object.defineProperty({__proto__:null,Compactable:dd,Filterable:SY,FilterableWithIndex:$Y,Foldable:EY,FoldableWithIndex:RY,Functor:hx,FunctorWithIndex:yY,Traversable:cS,TraversableWithIndex:MY,URI:on,Witherable:xY,_filter:Uu,_filterMap:Bu,_filterMapWithIndex:qm,_filterWithIndex:Um,_foldMap:mr,_foldMapWithIndex:Hu,_map:pr,_mapWithIndex:qu,_partition:zu,_partitionMap:Ku,_partitionMapWithIndex:Lm,_partitionWithIndex:Dm,_reduce:hr,_reduceRight:vr,_reduceRightWithIndex:Gu,_reduceWithIndex:Vu,_sequence:ud,_traverse:Vi,collect:Rm,compact:Oo,deleteAt:xm,difference:oS,elem:nS,empty:ad,every:lx,filter:aS,filterMap:uS,filterMapWithIndex:Wm,filterWithIndex:jm,flap:gY,foldMap:ld,foldMapWithIndex:Pc,fromEntries:vY,fromFoldable:cx,fromFoldableMap:tS,fromRecord:aY,getDifferenceMagma:CY,getEq:dx,getFoldable:bY,getFoldableWithIndex:_Y,getIntersectionSemigroup:wY,getMonoid:px,getShow:zm,getTraversable:mx,getTraversableWithIndex:TY,getUnionMonoid:OY,getUnionSemigroup:vx,getWitherable:IY,has:Io,hasOwnProperty:bx,insertAt:lS,intersection:iS,isEmpty:ui,isSubrecord:km,keys:sY,lookup:Du,map:eS,mapWithIndex:Am,modifyAt:fY,partition:Bm,partitionMap:sS,partitionMapWithIndex:Fm,partitionWithIndex:Pm,pop:dY,readonlyRecord:kY,reduce:cd,reduceRight:fd,reduceRightWithIndex:Wc,reduceWithIndex:Fc,separate:wo,sequence:jc,singleton:ux,size:ax,some:fx,toEntries:mY,toReadonlyArray:Mm,toRecord:uY,toUnfoldable:cY,traverse:Nm,traverseWithIndex:sx,union:rS,updateAt:lY,upsertAt:Q_,wilt:hY,wither:pY},Symbol.toStringTag,{value:"Module"})),fS=U.createContext(void 0);function pd(){const e=U.useContext(fS);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}var ot={},H={},NY={get exports(){return H},set exports(e){H=e}};(function(e){var t,n,r,i,o,a,u,s,c,l,f,d,p,h,v,m,_,g,S,b,$,T,M,R,q,Y,N,Z,ie;(function(J){var ye=typeof he=="object"?he:typeof self=="object"?self:typeof this=="object"?this:{};J(we(ye,we(e.exports)));function we(x,k){return x!==ye&&(typeof Object.create=="function"?Object.defineProperty(x,"__esModule",{value:!0}):x.__esModule=!0),function(E,O){return x[E]=k?k(E,O):O}}})(function(J){var ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,k){x.__proto__=k}||function(x,k){for(var E in k)Object.prototype.hasOwnProperty.call(k,E)&&(x[E]=k[E])};t=function(x,k){if(typeof k!="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");ye(x,k);function E(){this.constructor=x}x.prototype=k===null?Object.create(k):(E.prototype=k.prototype,new E)},n=Object.assign||function(x){for(var k,E=1,O=arguments.length;E<O;E++){k=arguments[E];for(var F in k)Object.prototype.hasOwnProperty.call(k,F)&&(x[F]=k[F])}return x},r=function(x,k){var E={};for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&k.indexOf(O)<0&&(E[O]=x[O]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function")for(var F=0,O=Object.getOwnPropertySymbols(x);F<O.length;F++)k.indexOf(O[F])<0&&Object.prototype.propertyIsEnumerable.call(x,O[F])&&(E[O[F]]=x[O[F]]);return E},i=function(x,k,E,O){var F=arguments.length,j=F<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,E):O,X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(x,k,E,O);else for(var te=x.length-1;te>=0;te--)(X=x[te])&&(j=(F<3?X(j):F>3?X(k,E,j):X(k,E))||j);return F>3&&j&&Object.defineProperty(k,E,j),j},o=function(x,k){return function(E,O){k(E,O,x)}},a=function(x,k,E,O,F,j){function X(xn){if(xn!==void 0&&typeof xn!="function")throw new TypeError("Function expected");return xn}for(var te=O.kind,xe=te==="getter"?"get":te==="setter"?"set":"value",ce=!k&&x?O.static?x:x.prototype:null,Ne=k||(ce?Object.getOwnPropertyDescriptor(ce,O.name):{}),ze,He=!1,it=E.length-1;it>=0;it--){var Ft={};for(var qt in O)Ft[qt]=qt==="access"?{}:O[qt];for(var qt in O.access)Ft.access[qt]=O.access[qt];Ft.addInitializer=function(xn){if(He)throw new TypeError("Cannot add initializers after decoration has completed");j.push(X(xn||null))};var Ht=(0,E[it])(te==="accessor"?{get:Ne.get,set:Ne.set}:Ne[xe],Ft);if(te==="accessor"){if(Ht===void 0)continue;if(Ht===null||typeof Ht!="object")throw new TypeError("Object expected");(ze=X(Ht.get))&&(Ne.get=ze),(ze=X(Ht.set))&&(Ne.set=ze),(ze=X(Ht.init))&&F.push(ze)}else(ze=X(Ht))&&(te==="field"?F.push(ze):Ne[xe]=ze)}ce&&Object.defineProperty(ce,O.name,Ne),He=!0},u=function(x,k,E){for(var O=arguments.length>2,F=0;F<k.length;F++)E=O?k[F].call(x,E):k[F].call(x);return O?E:void 0},s=function(x){return typeof x=="symbol"?x:"".concat(x)},c=function(x,k,E){return typeof k=="symbol"&&(k=k.description?"[".concat(k.description,"]"):""),Object.defineProperty(x,"name",{configurable:!0,value:E?"".concat(E," ",k):k})},l=function(x,k){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(x,k)},f=function(x,k,E,O){function F(j){return j instanceof E?j:new E(function(X){X(j)})}return new(E||(E=Promise))(function(j,X){function te(Ne){try{ce(O.next(Ne))}catch(ze){X(ze)}}function xe(Ne){try{ce(O.throw(Ne))}catch(ze){X(ze)}}function ce(Ne){Ne.done?j(Ne.value):F(Ne.value).then(te,xe)}ce((O=O.apply(x,k||[])).next())})},d=function(x,k){var E={label:0,sent:function(){if(j[0]&1)throw j[1];return j[1]},trys:[],ops:[]},O,F,j,X;return X={next:te(0),throw:te(1),return:te(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function te(ce){return function(Ne){return xe([ce,Ne])}}function xe(ce){if(O)throw new TypeError("Generator is already executing.");for(;X&&(X=0,ce[0]&&(E=0)),E;)try{if(O=1,F&&(j=ce[0]&2?F.return:ce[0]?F.throw||((j=F.return)&&j.call(F),0):F.next)&&!(j=j.call(F,ce[1])).done)return j;switch(F=0,j&&(ce=[ce[0]&2,j.value]),ce[0]){case 0:case 1:j=ce;break;case 4:return E.label++,{value:ce[1],done:!1};case 5:E.label++,F=ce[1],ce=[0];continue;case 7:ce=E.ops.pop(),E.trys.pop();continue;default:if(j=E.trys,!(j=j.length>0&&j[j.length-1])&&(ce[0]===6||ce[0]===2)){E=0;continue}if(ce[0]===3&&(!j||ce[1]>j[0]&&ce[1]<j[3])){E.label=ce[1];break}if(ce[0]===6&&E.label<j[1]){E.label=j[1],j=ce;break}if(j&&E.label<j[2]){E.label=j[2],E.ops.push(ce);break}j[2]&&E.ops.pop(),E.trys.pop();continue}ce=k.call(x,E)}catch(Ne){ce=[6,Ne],F=0}finally{O=j=0}if(ce[0]&5)throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}},p=function(x,k){for(var E in x)E!=="default"&&!Object.prototype.hasOwnProperty.call(k,E)&&ie(k,x,E)},ie=Object.create?function(x,k,E,O){O===void 0&&(O=E);var F=Object.getOwnPropertyDescriptor(k,E);(!F||("get"in F?!k.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return k[E]}}),Object.defineProperty(x,O,F)}:function(x,k,E,O){O===void 0&&(O=E),x[O]=k[E]},h=function(x){var k=typeof Symbol=="function"&&Symbol.iterator,E=k&&x[k],O=0;if(E)return E.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&O>=x.length&&(x=void 0),{value:x&&x[O++],done:!x}}};throw new TypeError(k?"Object is not iterable.":"Symbol.iterator is not defined.")},v=function(x,k){var E=typeof Symbol=="function"&&x[Symbol.iterator];if(!E)return x;var O=E.call(x),F,j=[],X;try{for(;(k===void 0||k-- >0)&&!(F=O.next()).done;)j.push(F.value)}catch(te){X={error:te}}finally{try{F&&!F.done&&(E=O.return)&&E.call(O)}finally{if(X)throw X.error}}return j},m=function(){for(var x=[],k=0;k<arguments.length;k++)x=x.concat(v(arguments[k]));return x},_=function(){for(var x=0,k=0,E=arguments.length;k<E;k++)x+=arguments[k].length;for(var O=Array(x),F=0,k=0;k<E;k++)for(var j=arguments[k],X=0,te=j.length;X<te;X++,F++)O[F]=j[X];return O},g=function(x,k,E){if(E||arguments.length===2)for(var O=0,F=k.length,j;O<F;O++)(j||!(O in k))&&(j||(j=Array.prototype.slice.call(k,0,O)),j[O]=k[O]);return x.concat(j||Array.prototype.slice.call(k))},S=function(x){return this instanceof S?(this.v=x,this):new S(x)},b=function(x,k,E){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var O=E.apply(x,k||[]),F,j=[];return F={},X("next"),X("throw"),X("return"),F[Symbol.asyncIterator]=function(){return this},F;function X(He){O[He]&&(F[He]=function(it){return new Promise(function(Ft,qt){j.push([He,it,Ft,qt])>1||te(He,it)})})}function te(He,it){try{xe(O[He](it))}catch(Ft){ze(j[0][3],Ft)}}function xe(He){He.value instanceof S?Promise.resolve(He.value.v).then(ce,Ne):ze(j[0][2],He)}function ce(He){te("next",He)}function Ne(He){te("throw",He)}function ze(He,it){He(it),j.shift(),j.length&&te(j[0][0],j[0][1])}},$=function(x){var k,E;return k={},O("next"),O("throw",function(F){throw F}),O("return"),k[Symbol.iterator]=function(){return this},k;function O(F,j){k[F]=x[F]?function(X){return(E=!E)?{value:S(x[F](X)),done:!1}:j?j(X):X}:j}},T=function(x){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var k=x[Symbol.asyncIterator],E;return k?k.call(x):(x=typeof h=="function"?h(x):x[Symbol.iterator](),E={},O("next"),O("throw"),O("return"),E[Symbol.asyncIterator]=function(){return this},E);function O(j){E[j]=x[j]&&function(X){return new Promise(function(te,xe){X=x[j](X),F(te,xe,X.done,X.value)})}}function F(j,X,te,xe){Promise.resolve(xe).then(function(ce){j({value:ce,done:te})},X)}},M=function(x,k){return Object.defineProperty?Object.defineProperty(x,"raw",{value:k}):x.raw=k,x};var we=Object.create?function(x,k){Object.defineProperty(x,"default",{enumerable:!0,value:k})}:function(x,k){x.default=k};R=function(x){if(x&&x.__esModule)return x;var k={};if(x!=null)for(var E in x)E!=="default"&&Object.prototype.hasOwnProperty.call(x,E)&&ie(k,x,E);return we(k,x),k},q=function(x){return x&&x.__esModule?x:{default:x}},Y=function(x,k,E,O){if(E==="a"&&!O)throw new TypeError("Private accessor was defined without a getter");if(typeof k=="function"?x!==k||!O:!k.has(x))throw new TypeError("Cannot read private member from an object whose class did not declare it");return E==="m"?O:E==="a"?O.call(x):O?O.value:k.get(x)},N=function(x,k,E,O,F){if(O==="m")throw new TypeError("Private method is not writable");if(O==="a"&&!F)throw new TypeError("Private accessor was defined without a setter");if(typeof k=="function"?x!==k||!F:!k.has(x))throw new TypeError("Cannot write private member to an object whose class did not declare it");return O==="a"?F.call(x,E):F?F.value=E:k.set(x,E),E},Z=function(x,k){if(k===null||typeof k!="object"&&typeof k!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof x=="function"?k===x:x.has(k)},J("__extends",t),J("__assign",n),J("__rest",r),J("__decorate",i),J("__param",o),J("__esDecorate",a),J("__runInitializers",u),J("__propKey",s),J("__setFunctionName",c),J("__metadata",l),J("__awaiter",f),J("__generator",d),J("__exportStar",p),J("__createBinding",ie),J("__values",h),J("__read",v),J("__spread",m),J("__spreadArrays",_),J("__spreadArray",g),J("__await",S),J("__asyncGenerator",b),J("__asyncDelegator",$),J("__asyncValues",T),J("__makeTemplateObject",M),J("__importStar",R),J("__importDefault",q),J("__classPrivateFieldGet",Y),J("__classPrivateFieldSet",N),J("__classPrivateFieldIn",Z)})})(NY);var Yu={};function _x(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const FY=Object.freeze(Object.defineProperty({__proto__:null,altAll:_x},Symbol.toStringTag,{value:"Module"}));function PY(e){return _x(e)(e.zero())}const WY=Object.freeze(Object.defineProperty({__proto__:null,altAll:PY},Symbol.toStringTag,{value:"Module"}));function Wr(e){var t=Jt(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Sx(e,t){var n=Mc(e,t).map,r=To(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return y(i,r(o))}}}const jY=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:Sx,getApplicativeMonoid:Wr},Symbol.toStringTag,{value:"Module"}));function Hi(e){return function(t){return function(n){return e.fromEither(Wt(n)?$o(t()):xa(n.value))}}}function Na(e){return function(t,n){return function(r){return e.fromEither(t(r)?xa(r):$o(n(r)))}}}function Gi(e){var t=Hi(e);return function(n){var r=t(n);return function(i){return V(i,r)}}}function Ju(e,t){var n=Gi(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function gr(e){return function(t){return V(t,e.fromEither)}}function Co(e,t){var n=gr(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Eo(e,t){return V(gr(e),ft(t))}function Zu(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?xa(o):$o(r(o)))})}}}const LY=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:Co,chainFirstEitherK:Eo,chainOptionK:Ju,filterOrElse:Zu,fromEitherK:gr,fromOption:Hi,fromOptionK:Gi,fromPredicate:Na},Symbol.toStringTag,{value:"Module"}));var hd=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Ro=function(e){return e.length>0},Km=function(e,t){return e<0||e>=t.length},dS=function(e){return function(t){return hd([e],t,!0)}},Lc=dS,pS=function(e){return function(t){return hd(hd([],t,!0),[e],!1)}},md=pS,hS=function(e,t,n){if(Ro(n)){var r=vd(n);return r.splice(e,0,t),r}return[t]},mS=function(e,t,n){var r=vd(n);return r[e]=t,r},vS=function(e){return function(t){if(t.length===1)return Dc(t);for(var n=[jr(t)],r=ci(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},$x=function(e){if(Ro(e)){var t=b_();return _S(e.reduce(t.concat,t.empty))}return Dc},gS=function(e){var t=vS(e);return function(n){return function(r){return t(y(r,Hm(n)))}}},yS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Km(Math.abs(r),t)||r===0)return Dc(t);if(r<0){var i=Ym(-r)(t),o=i[0],a=i[1];return y(a,Hm(o))}else return yS(r-n)(t)}},vd=um,bS=function(e){return Ro(e)?pe(e):be},Vm=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},DY=function(e){return Vm(function(){return e})},Tx=function(e,t){return e<=t?Vm(function(n){return e+n})(t-e+1):[e]},Ix=function(e){return[jr(e),ci(e)]},Ox=function(e){return[Uc(e),qc(e)]};function wx(e){return function(t){return t.concat(e)}}function Hm(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var qY=function(e){return hd([qc(e)],e.slice(0,-1).reverse(),!0)};function Cx(e){return function(t){var n=t.length;if(n===0)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var UY=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);lt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},_S=function(e){return function(t){return t.slice().sort(e.compare)}},BY=function(e,t){return function(n){return e<0||e>n.length?be:pe(hS(e,t,n))}},zY=function(e,t){return Ex(e,function(){return t})},Ex=function(e,t){return function(n){return Km(e,n)?be:pe(mS(e,t(n[e]),n))}},Dc=vd,Fa=function(e){return[e]},Rx=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function Mx(e,t){return t===void 0?function(n){return Mx(n,e)}:Rx(e,t,function(n,r){return[n,r]})}var KY=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Gm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},xx=function(e){return function(t){var n=ci(t);return Ro(n)?y(n,Gm(e),Lc(jr(t))):Dc(t)}},kx=G_,Ax=V_,Nx=function(e){return function(t){for(var n=vd(e(0,jr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},SS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Ro(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Ym=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[Dc(t),[]]:[y(t.slice(1,n),Lc(jr(t))),t.slice(n)]}},Fx=function(e){return SS(Ym(e))},si=function(e,t){return y(e,RS(t))},$S=function(e,t){return y(e,MS(t))},gd=function(e,t){return y(e,qx(t))},TS=function(e,t){return y(e,Jm(t))},Px=function(e,t){return y(e,ES(t))},yd=function(e,t,n){return y(e,Ux(t,n))},bd=function(e){var t=Ax(e);return function(n,r){return y(n,t(r))}},_d=function(e,t,n){return y(e,zx(t,n))},IS=function(e){var t=Vx(e);return function(n,r){return y(n,t(r))}},Wx=function(e,t){return y(e,Dx(t))},OS=function(e,t,n){return y(e,Bx(t,n))},wS=function(e){var t=kx(e);return function(n,r){return y(n,t(r))}},CS=function(e,t,n){return y(e,Kx(t,n))},jx=function(e){var t=Xm(e);return function(n,r){return y(n,t(r))}},Lx=function(e){return function(t){return y(t,wx(e()))}},Dx=Lx,qx=function(e){return Jm(function(t){return y(e,RS(t))})},Jm=function(e){return Nx(function(t,n){return e(n)})},ES=function(e){return function(t){for(var n=ci(t),r=[e(t)];Ro(n);)r.push(e(n)),n=ci(n);return r}},VY=ES(D),HY=Jm(D),RS=function(e){return MS(function(t,n){return e(n)})},MS=function(e){return function(t){for(var n=[e(0,jr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},Ux=K_,Bx=$m,zx=H_,Kx=Tm,Vx=function(e){var t=Xm(e);return function(n){return t(function(r,i){return n(i)})}},Zm=function(e){return Xm(e)(function(t,n){return n})},Xm=function(e){return function(t){return function(n){for(var r=e.map(t(0,jr(n)),Fa),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return y(o,md(a))}}),t(i,n[i]));return r}}},xS=An,Nn="NonEmptyArray",GY=GM,YY=function(){return{concat:Hm}},JY=YM,ZY=function(e){var t=gS(e);return{concat:function(n,r){return t(r)(n)}}},kS={URI:Nn,map:si},XY=Ke(kS),QY={URI:Nn,of:Fa},eJ={URI:Nn,map:si,mapWithIndex:$S},Qm={URI:Nn,map:si,ap:gd},tJ=Ct(Qm),nJ=Et(Qm),rJ={URI:Nn,map:si,ap:gd,of:Fa},AS={URI:Nn,map:si,ap:gd,chain:TS},iJ=ft(AS),oJ={URI:Nn,map:si,ap:gd,of:Fa,chain:TS},aJ={URI:Nn,reduce:yd,foldMap:bd,reduceRight:_d},uJ={URI:Nn,reduce:yd,foldMap:bd,reduceRight:_d,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS},sJ={URI:Nn,map:si,reduce:yd,foldMap:bd,reduceRight:_d,traverse:IS,sequence:Zm},cJ={URI:Nn,map:si,mapWithIndex:$S,reduce:yd,foldMap:bd,reduceRight:_d,traverse:IS,sequence:Zm,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS,traverseWithIndex:jx},lJ={URI:Nn,map:si,alt:Wx},fJ={URI:Nn,map:si,extend:Px,extract:xS},dJ=Fa(Yt),pJ=wt(kS),hJ=Mt(AS),mJ=Rt(Qm),jr=An,ci=function(e){return e.slice(1)},qc=Aa,Uc=function(e){return e.slice(0,-1)},vJ=JM,gJ=ZM,yJ=function(e){return function(t){return t.reduce(e.concat)}},bJ=function(e){return function(t){return e(jr(t),ci(t))}},_J=function(e){return function(t){return e(Uc(t),qc(t))}},Hx=function(e){return function(t){return hd([e(jr(t))],ci(t),!0)}},SJ=function(e){return Hx(function(){return e})},Gx=function(e){return function(t){return y(Uc(t),md(e(qc(t))))}},$J=function(e){return Gx(function(){return e})},TJ=Z_;function IJ(e){var t=_S(e),n=Cx(e);return function(r){return Ro(r)?n(t(r)):[]}}function OJ(e){return Yx(function(t,n){return e(n)})}var Yx=function(e){return function(t){return bS(t.filter(function(n,r){return e(r,n)}))}},wJ=Ix,CJ=Ox;function Jx(e,t){return t===void 0?Lc(e):y(t,Lc(e))}var Zx=function(e,t){return y(e,md(t))},EJ=Gm,RJ=Em,MJ={URI:Nn,of:Fa,map:si,mapWithIndex:$S,ap:gd,chain:TS,extend:Px,extract:xS,reduce:yd,foldMap:bd,reduceRight:_d,traverse:IS,sequence:Zm,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS,traverseWithIndex:jx,alt:Wx};const xJ=Object.freeze(Object.defineProperty({__proto__:null,Alt:lJ,Applicative:rJ,Apply:Qm,Chain:AS,Comonad:fJ,Do:dJ,Foldable:aJ,FoldableWithIndex:uJ,Functor:kS,FunctorWithIndex:eJ,Monad:oJ,Pointed:QY,Traversable:sJ,TraversableWithIndex:cJ,URI:Nn,alt:Dx,altW:Lx,ap:qx,apFirst:tJ,apS:mJ,apSecond:nJ,append:md,appendW:pS,bind:hJ,bindTo:pJ,chain:Jm,chainFirst:iJ,chainWithIndex:Nx,chop:SS,chunksOf:Fx,concat:Hm,concatAll:yJ,concatW:wx,cons:Jx,copy:Dc,duplicate:VY,extend:ES,extract:xS,filter:OJ,filterWithIndex:Yx,flap:XY,flatten:HY,fold:RJ,foldMap:Ax,foldMapWithIndex:kx,fromArray:bS,fromReadonlyNonEmptyArray:vd,getEq:JY,getSemigroup:YY,getShow:GY,getUnionSemigroup:ZY,group:Cx,groupBy:UY,groupSort:IJ,head:jr,init:Uc,insertAt:BY,intercalate:TJ,intersperse:xx,isNonEmpty:Ro,isOutOfBound:Km,last:qc,makeBy:Vm,map:RS,mapWithIndex:MS,matchLeft:bJ,matchRight:_J,max:gJ,min:vJ,modifyAt:Ex,modifyHead:Hx,modifyLast:Gx,nonEmptyArray:MJ,of:Fa,prepend:Lc,prependAll:Gm,prependToAll:EJ,prependW:dS,range:Tx,reduce:Ux,reduceRight:zx,reduceRightWithIndex:Kx,reduceWithIndex:Bx,replicate:DY,reverse:qY,rotate:yS,sequence:Zm,snoc:Zx,sort:_S,sortBy:$x,splitAt:Ym,tail:ci,traverse:Vx,traverseWithIndex:Xm,unappend:Ox,uncons:wJ,union:gS,uniq:vS,unprepend:Ix,unsafeInsertAt:hS,unsafeUpdateAt:mS,unsnoc:CJ,unzip:KY,updateAt:zY,updateHead:SJ,updateLast:$J,zip:Mx,zipWith:Rx},Symbol.toStringTag,{value:"Module"}));var kJ=function(e){return typeof e=="number"},NS={equals:function(e,t){return e===t}},ev={equals:NS.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},AJ={equals:NS.equals,compare:ev.compare,top:1/0,bottom:-1/0},NJ={show:function(e){return JSON.stringify(e)}},Xx={concat:function(e,t){return e-t}},FS={concat:function(e,t){return e+t}},PS={concat:function(e,t){return e*t}},FJ={concat:FS.concat,empty:0},PJ={concat:PS.concat,empty:1},WJ={add:FS.concat,zero:0,mul:PS.concat,one:1,sub:Xx.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const jJ=Object.freeze(Object.defineProperty({__proto__:null,Bounded:AJ,Eq:NS,Field:WJ,MagmaSub:Xx,MonoidProduct:PJ,MonoidSum:FJ,Ord:ev,SemigroupProduct:PS,SemigroupSum:FS,Show:NJ,isNumber:kJ},Symbol.toStringTag,{value:"Module"}));function Bc(e,t){return function(n){return n?t.of(void 0):e.zero()}}const LJ=Object.freeze(Object.defineProperty({__proto__:null,guard:Bc},Symbol.toStringTag,{value:"Module"}));var DJ=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Yi=function(e){return e.length===0},xt=Ki,qJ=kc,UJ=C_,tv=vm,BJ=E_,Qx=function(e,t){return e<=0?$t:ym(t)(e)},zJ=function(e,t){return Qx(e,function(){return t})};function KJ(e){return function(t){return e(t)?[t]:$t}}var ek=function(e){return Wt(e)?$t:[e.value]},tk=function(e){return Gt(e)?$t:[e.right]},nk=function(e,t){return function(n){return xt(n)?t(n):e()}},rk=nk,ik=function(e,t){return function(n){return xt(n)?t(An(n),ii(n)):e()}},ok=ik,VJ=ok,ak=function(e,t){return function(n){return xt(n)?t(Ac(n),Aa(n)):e()}},uk=ak,HJ=uk,sk=function(e){return function(t){if(Yi(t))return $t;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},GJ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},YJ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},JJ=function(e){return e.length},zc=mm;function Xu(e,t){return t===void 0?function(n){return Xu(e,n)}:zc(e,t)?be:pe(t[e])}var ck=function(e){return xt(e)?pe(An(e)):be},WS=function(e){return xt(e)?pe(Aa(e)):be},ZJ=function(e){return xt(e)?pe(ii(e)):be},XJ=function(e){return xt(e)?pe(Ac(e)):be},QJ=function(e){return function(t){return zc(e,t)?t:e===0?$t:t.slice(0,e)}},e7=function(e){return function(t){return zc(e,t)?t:e===0?$t:t.slice(-e)}};function t7(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}var a=n.length;return a===t.length?t:a===0?$t:n}}var lk=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function n7(e){return function(t){var n=jS(lk(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var r7=function(e){return function(t){return e<=0||Yi(t)?t:e>=t.length?$t:t.slice(e,t.length)}},i7=function(e){return function(t){return e<=0||Yi(t)?t:e>=t.length?$t:t.slice(0,t.length-e)}};function o7(e){return function(t){var n=lk(t,e);return n===0?t:n===t.length?$t:t.slice(n)}}var nv=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return pe(n);return be}};function rv(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return pe(t[n]);return be}}var fk=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(bt(r))return r}return be}};function dk(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return pe(t[n]);return be}}var pk=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(bt(r))return r}return be}},hk=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return pe(n);return be}},a7=function(e,t){return function(n){return e<0||e>n.length?be:pe(gm(e,t,n))}},u7=function(e,t){return mk(e,function(){return t})},s7=function(e){return function(t){return zc(e,t)?be:pe(Bk(e,t))}},mk=function(e,t){return function(n){return zc(e,n)?be:pe(mv(e,t(n[e]),n))}},c7=function(e){return e.length<=1?e:e.slice().reverse()},l7=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},f7=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},d7=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},vk=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function gk(e,t){return t===void 0?function(n){return gk(n,e)}:vk(e,t,function(n,r){return[n,r]})}var p7=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},yk=function(e){var t=bm(e);return function(n){return xt(n)?t(n):n}},h7=function(e){var t=N_(e);return function(n){return xt(n)?t(n):n}},m7=function(e){var t=k_(e);return function(n){return xt(n)?t(n):n}};function Sd(e){return function(t,n){if(n===void 0){var r=Sd(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var v7=function(e){var t=M_(e);return function(n){return xt(n)?t(n):n}},g7=function(e){var t=MM(e);return function(n){return xt(n)?t(n):n}},y7=function(e){var t=F_(e);return function(n){return xt(n)?t(n):$t}},jS=function(e){return function(t){return e>=1&&xt(t)?_m(e)(t):Yi(t)?[t,$t]:[$t,t]}},b7=function(e){var t=DM(e);return function(n){return xt(n)?t(n):$t}},_7=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ek(e.apply(void 0,t))}};function S7(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return xt(o)?y(An(o),Td(function(a){return r(y(i,tv(a)),ii(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:$t};return r($t,e)}var bk=function(e){return function(t){return Yi(t)?e:Yi(e)?t:t.concat(e)}},$7=bk;function LS(e){var t=x_(e);return function(n,r){if(r===void 0){var i=LS(e);return function(o){return i(o,n)}}return xt(n)&&xt(r)?t(r)(n):xt(n)?n:r}}function DS(e){var t=Sd(e);return function(n,r){if(r===void 0){var i=DS(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function qS(e){var t=Sd(e);return function(n,r){if(r===void 0){var i=qS(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var an=function(e,t){return y(e,lv(t))},iv=function(e,t){return y(e,Rk(t))},Pa=function(e,t){return y(e,Ek(t))},$d=function(e,t){return y(e,Td(t))},ov=function(e,t){return y(e,li(t))},av=function(e,t){return y(e,JS(t))},uv=function(e,t){return y(e,Mk(t))},sv=function(e,t){return y(e,xk(t))},_k=function(e,t){return y(e,ZS(t))},Sk=function(e,t){return y(e,XS(t))},US=function(e,t){return y(e,Ck(t))},Qu=function(e,t,n){return y(e,dv(t,n))},Kc=function(e){var t=e$(e);return function(n,r){return y(n,t(r))}},Vc=function(e,t,n){return y(e,t$(t,n))},BS=function(e,t,n){return y(e,Id(t,n))},zS=function(e){var t=fv(e);return function(n,r){return y(n,t(r))}},KS=function(e,t,n){return y(e,pv(t,n))},$k=function(e,t){return y(e,YS(t))},Tk=function(e,t){return y(e,kk(t))},Ik=function(e,t){return y(e,QS(t))},cv=function(e){var t=Ak(e);return function(n,r){return y(n,t(r))}},Ok=function(e){var t=n$(e);return function(n,r){return y(n,t(r))}},VS=function(e,t){return y(e,s$(t))},HS=function(e,t){return y(e,c$(t))},es=ka,Hc=function(){return $t},wk=function(e){return function(t){return t.concat(e())}},Ck=wk,Ek=function(e){return Td(function(t){return y(e,lv(t))})},Td=function(e){return function(t){return y(t,sk(function(n,r){return e(r)}))}},GS=Td(D),lv=function(e){return function(t){return t.map(function(n){return e(n)})}},Rk=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},Gc=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Me(t,n)},li=function(e){return function(t){return t.filter(e)}},YS=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);bt(i)&&n.push(i.value)}return n}},JS=function(e){return YS(function(t,n){return e(n)})},Yc=JS(D),Mk=function(e){return ZS(function(t,n){return e(n)})},ZS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Me(n,r)}},xk=function(e){return XS(function(t,n){return e(n)})},XS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Me(n,r)}},kk=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},QS=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},T7=QS(D),fv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},dv=function(e,t){return Id(e,function(n,r,i){return t(r,i)})},e$=function(e){var t=fv(e);return function(n){return t(function(r,i){return n(i)})}},Id=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},t$=function(e,t){return pv(e,function(n,r,i){return t(r,i)})},pv=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},Ak=function(e){var t=n$(e);return function(n){return t(function(r,i){return n(i)})}},Od=function(e){return function(t){return Qu(t,e.of(Hc()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return y(i,tv(o))}}),r)})}},n$=function(e){return function(t){return Id(e.of(Hc()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return y(o,tv(a))}}),t(n,i))})}},I7=function(e){var t=l$(e);return function(n){return function(r){return t(r,n)}}},O7=function(e){var t=f$(e);return function(n){return function(r){return t(r,n)}}},r$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(bt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},dt="ReadonlyArray",Nk=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},Fk=function(){return{concat:function(e,t){return Yi(e)?t:Yi(t)?e:e.concat(t)}}},w7=function(){return{concat:Fk().concat,empty:$t}},Pk=function(e){return Pr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},Wk=function(e){return Lu(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var u=e.compare(t[a],n[a]);if(u!==0)return u}return ev.compare(r,i)})},jk=function(e){var t=LS(e);return{concat:function(n,r){return t(r)(n)}}},C7=function(e){return{concat:jk(e).concat,empty:$t}},E7=function(e){var t=DS(e);return{concat:function(n,r){return t(r)(n)}}},R7=function(e){var t=qS(e);return{concat:function(n,r){return t(r)(n)}}},i$={URI:dt,map:an},M7=Ke(i$),Lk={URI:dt,of:es},x7={URI:dt,map:an,mapWithIndex:iv},hv={URI:dt,map:an,ap:Pa},k7=Ct(hv),A7=Et(hv),N7={URI:dt,map:an,ap:Pa,of:es},o$={URI:dt,map:an,ap:Pa,chain:$d},F7={URI:dt,map:an,ap:Pa,of:es,chain:$d},P7=ft(o$),W7={URI:dt,unfold:r$},j7={URI:dt,map:an,alt:US},Dk={URI:dt,zero:Hc},L7=Bc(Dk,Lk),D7={URI:dt,map:an,ap:Pa,of:es,alt:US,zero:Hc},q7={URI:dt,map:an,extend:Ik},a$={URI:dt,compact:Yc,separate:Gc},U7={URI:dt,map:an,compact:Yc,separate:Gc,filter:ov,filterMap:av,partition:uv,partitionMap:sv},B7={URI:dt,map:an,mapWithIndex:iv,compact:Yc,separate:Gc,filter:ov,filterMap:av,partition:uv,partitionMap:sv,partitionMapWithIndex:Sk,partitionWithIndex:_k,filterMapWithIndex:$k,filterWithIndex:Tk},z7={URI:dt,reduce:Qu,foldMap:Kc,reduceRight:Vc},K7={URI:dt,reduce:Qu,foldMap:Kc,reduceRight:Vc,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS},u$={URI:dt,map:an,reduce:Qu,foldMap:Kc,reduceRight:Vc,traverse:cv,sequence:Od},V7={URI:dt,map:an,mapWithIndex:iv,reduce:Qu,foldMap:Kc,reduceRight:Vc,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS,traverse:cv,sequence:Od,traverseWithIndex:Ok},s$=function(e){return function(t){for(var n=DJ([],e(t),!0),r=[];n.length>0;){var i=n.shift();Gt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},H7={URI:dt,map:an,ap:Pa,chain:$d,chainRec:VS},c$=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Gt(c)?e(c.left).forEach(function(l){return r.push(l)}):i.push(c.right)}for(var a=0,u=n;a<u.length;a++){var s=u[a];o(s)}for(;r.length>0;)o(r.shift());return i}},G7={URI:dt,map:an,ap:Pa,chain:$d,chainRec:HS},l$=ai(u$,a$),f$=oi(u$,a$),qk={URI:dt,map:an,compact:Yc,separate:Gc,filter:ov,filterMap:av,partition:uv,partitionMap:sv,reduce:Qu,foldMap:Kc,reduceRight:Vc,traverse:cv,sequence:Od,wither:l$,wilt:f$},Y7=X_(qk),Uk={URI:dt,fromEither:tk},J7=gr(Uk),Z7=gm,mv=function(e,t,n){return xt(n)?R_(e,t,n):n},Bk=function(e,t){var n=t.slice();return n.splice(e,1),n},X7=function(e){return e.slice()},Q7=function(e){return Yi(e)?$t:e.slice()},$t=Qf;function zk(e){return function(t){return t.every(e)}}var Kk=function(e){return function(t){return t.some(e)}},eZ=Kk,Vk=function(e){var t=Z_(e);return function(n){return rk(function(){return e.empty},t(n))}},tZ=es(Yt),nZ=wt(i$),rZ=Mt(o$),iZ=Rt(hv),oZ=xM,aZ=tx,uZ=nx,sZ=yk,cZ={URI:dt,compact:Yc,separate:Gc,map:an,ap:Pa,of:es,chain:$d,filter:ov,filterMap:av,partition:uv,partitionMap:sv,mapWithIndex:iv,partitionMapWithIndex:Sk,partitionWithIndex:_k,filterMapWithIndex:$k,filterWithIndex:Tk,alt:US,zero:Hc,unfold:r$,reduce:Qu,foldMap:Kc,reduceRight:Vc,traverse:cv,sequence:Od,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS,traverseWithIndex:Ok,extend:Ik,wither:l$,wilt:f$};const lZ=Object.freeze(Object.defineProperty({__proto__:null,Alt:j7,Alternative:D7,Applicative:N7,Apply:hv,Chain:o$,ChainRecBreadthFirst:G7,ChainRecDepthFirst:H7,Compactable:a$,Do:tZ,Extend:q7,Filterable:U7,FilterableWithIndex:B7,Foldable:z7,FoldableWithIndex:K7,FromEither:Uk,Functor:i$,FunctorWithIndex:x7,Monad:F7,Pointed:Lk,Traversable:u$,TraversableWithIndex:V7,URI:dt,Unfoldable:W7,Witherable:qk,Zero:Dk,_chainRecBreadthFirst:HS,_chainRecDepthFirst:VS,alt:Ck,altW:wk,ap:Ek,apFirst:k7,apS:iZ,apSecond:A7,append:tv,appendW:BJ,bind:rZ,bindTo:nZ,chain:Td,chainFirst:P7,chainRecBreadthFirst:c$,chainRecDepthFirst:s$,chainWithIndex:sk,chop:y7,chunksOf:b7,compact:Yc,comprehension:S7,concat:$7,concatW:bk,cons:aZ,deleteAt:s7,difference:qS,dropLeft:r7,dropLeftWhile:o7,dropRight:i7,duplicate:T7,elem:Sd,empty:$t,every:zk,exists:eZ,extend:QS,filter:li,filterE:Y7,filterMap:JS,filterMapWithIndex:YS,filterWithIndex:kk,findFirst:rv,findFirstMap:fk,findIndex:nv,findLast:dk,findLastIndex:hk,findLastMap:pk,flap:M7,flatten:GS,foldLeft:VJ,foldMap:e$,foldMapWithIndex:fv,foldRight:HJ,fromArray:Q7,fromEither:tk,fromEitherK:J7,fromOption:ek,fromOptionK:_7,fromPredicate:KJ,getDifferenceMagma:R7,getEq:Pk,getIntersectionSemigroup:E7,getMonoid:w7,getOrd:Wk,getSemigroup:Fk,getShow:Nk,getUnionMonoid:C7,getUnionSemigroup:jk,guard:L7,head:ck,init:XJ,insertAt:a7,intercalate:Vk,intersection:DS,intersperse:h7,isEmpty:Yi,isNonEmpty:xt,isOutOfBound:zc,last:WS,lefts:f7,lookup:Xu,makeBy:Qx,map:lv,mapWithIndex:Rk,match:rk,matchLeft:ok,matchLeftW:ik,matchRight:uk,matchRightW:ak,matchW:nk,modifyAt:mk,of:es,partition:Mk,partitionMap:xk,partitionMapWithIndex:XS,partitionWithIndex:ZS,prepend:qJ,prependAll:yk,prependToAll:sZ,prependW:UJ,range:oZ,readonlyArray:cZ,reduce:dv,reduceRight:t$,reduceRightWithIndex:pv,reduceWithIndex:Id,replicate:zJ,reverse:c7,rights:l7,rotate:m7,scanLeft:GJ,scanRight:YJ,separate:Gc,sequence:Od,size:JJ,snoc:uZ,some:Kk,sort:d7,sortBy:g7,spanLeft:n7,splitAt:jS,tail:ZJ,takeLeft:QJ,takeLeftWhile:t7,takeRight:e7,toArray:X7,traverse:Ak,traverseWithIndex:n$,unfold:r$,union:LS,uniq:v7,unsafeDeleteAt:Bk,unsafeInsertAt:Z7,unsafeUpdateAt:mv,unzip:p7,updateAt:u7,wilt:O7,wither:I7,zero:Hc,zip:gk,zipWith:vk},Symbol.toStringTag,{value:"Module"}));var Wa=function(e){return e.length===0},jt=Ro,fZ=Lc,dZ=dS,vv=md,pZ=pS,Hk=function(e,t){return e<=0?[]:Vm(t)(e)},hZ=function(e,t){return Hk(e,function(){return t})};function mZ(e){return function(t){return e(t)?[t]:[]}}var Gk=function(e){return Wt(e)?[]:[e.value]},Yk=function(e){return Gt(e)?[]:[e.right]},Jk=function(e,t){return function(n){return jt(n)?t(n):e()}},vZ=Jk,Zk=function(e,t){return function(n){return jt(n)?t(jr(n),ci(n)):e()}},Xk=Zk,gZ=Xk,Qk=function(e,t){return function(n){return jt(n)?t(Uc(n),qc(n)):e()}},eA=Qk,yZ=eA,tA=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},bZ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},_Z=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},SZ=function(e){return e.length},wd=Km,$Z=Xu,TZ=ck,IZ=WS,OZ=function(e){return jt(e)?pe(ci(e)):be},wZ=function(e){return jt(e)?pe(Uc(e)):be},CZ=function(e){return function(t){return wd(e,t)?$n(t):t.slice(0,e)}},EZ=function(e){return function(t){return wd(e,t)?$n(t):e===0?[]:t.slice(-e)}};function RZ(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}return n}}var nA=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function MZ(e){return function(t){var n=uA(nA(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var xZ=function(e){return function(t){return e<=0||Wa(t)?$n(t):e>=t.length?[]:t.slice(e,t.length)}},kZ=function(e){return function(t){return e<=0||Wa(t)?$n(t):e>=t.length?[]:t.slice(0,t.length-e)}};function AZ(e){return function(t){return t.slice(nA(t,e))}}var NZ=nv;function FZ(e){return rv(e)}var PZ=fk;function WZ(e){return dk(e)}var jZ=pk,LZ=hk,$n=function(e){return e.slice()},DZ=function(e,t){return function(n){return e<0||e>n.length?be:pe(PA(e,t,n))}},qZ=function(e,t){return rA(e,function(){return t})},UZ=function(e){return function(t){return wd(e,t)?be:pe(jA(e,t))}},rA=function(e,t){return function(n){return wd(e,n)?be:pe(WA(e,t(n[e]),n))}},BZ=function(e){return Wa(e)?[]:e.slice().reverse()},zZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},KZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},VZ=function(e){return function(t){return t.length<=1?$n(t):t.slice().sort(e.compare)}},iA=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function oA(e,t){return t===void 0?function(n){return oA(n,e)}:iA(e,t,function(n,r){return[n,r]})}var HZ=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},aA=function(e){var t=Gm(e);return function(n){return jt(n)?t(n):[]}},GZ=function(e){var t=xx(e);return function(n){return jt(n)?t(n):$n(n)}},YZ=function(e){var t=yS(e);return function(n){return jt(n)?t(n):$n(n)}},d$=Sd,JZ=function(e){var t=vS(e);return function(n){return jt(n)?t(n):$n(n)}},ZZ=function(e){var t=$x(e);return function(n){return jt(n)?t(n):$n(n)}},XZ=function(e){var t=SS(e);return function(n){return jt(n)?t(n):[]}},uA=function(e){return function(t){return e>=1&&jt(t)?Ym(e)(t):Wa(t)?[$n(t),[]]:[[],$n(t)]}},QZ=function(e){var t=Fx(e);return function(n){return jt(n)?t(n):[]}},e8=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Gk(e.apply(void 0,t))}};function t8(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return jt(o)?y(jr(o),Ed(function(a){return r(y(i,vv(a)),ci(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var sA=function(e){return function(t){return Wa(t)?$n(e):Wa(e)?$n(t):t.concat(e)}},n8=sA;function p$(e){var t=gS(e);return function(n,r){if(r===void 0){var i=p$(e);return function(o){return i(o,n)}}return jt(n)&&jt(r)?t(r)(n):jt(n)?$n(n):$n(r)}}function h$(e){var t=d$(e);return function(n,r){if(r===void 0){var i=h$(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function m$(e){var t=d$(e);return function(n,r){if(r===void 0){var i=m$(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var un=function(e,t){return y(e,_$(t))},gv=function(e,t){return y(e,vA(t))},ja=function(e,t){return y(e,mA(t))},Cd=function(e,t){return y(e,Ed(t))},yv=function(e,t){return y(e,gA(t))},bv=function(e,t){return y(e,T$(t))},_v=function(e,t){return y(e,yA(t))},Sv=function(e,t){return y(e,bA(t))},cA=function(e,t){return y(e,I$(t))},lA=function(e,t){return y(e,O$(t))},v$=function(e,t){return y(e,SA(t))},ts=function(e,t,n){return y(e,OA(t,n))},Jc=function(e){var t=TA(e);return function(n,r){return y(n,t(r))}},Zc=function(e,t,n){return y(e,wA(t,n))},g$=function(e,t,n){return y(e,C$(t,n))},y$=function(e){var t=IA(e);return function(n,r){return y(n,t(r))}},b$=function(e,t,n){return y(e,CA(t,n))},fA=function(e,t){return y(e,$$(t))},dA=function(e,t){return y(e,$A(t))},pA=function(e,t){return y(e,w$(t))},$v=function(e){var t=Tv(e);return function(n,r){return y(n,t(r))}},hA=function(e){var t=E$(e);return function(n,r){return y(n,t(r))}},r8=VS,i8=HS,La=Fa,Xc=function(){return[]},_$=function(e){return function(t){return t.map(function(n){return e(n)})}},mA=function(e){return Ed(function(t){return y(e,_$(t))})},Ed=function(e){return function(t){return y(t,tA(function(n,r){return e(r)}))}},S$=Ed(D),vA=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},$$=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);bt(i)&&n.push(i.value)}return n}},T$=function(e){return $$(function(t,n){return e(n)})},Qc=T$(D),el=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Me(t,n)},gA=function(e){return function(t){return t.filter(e)}},yA=function(e){return I$(function(t,n){return e(n)})},I$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Me(n,r)}},bA=function(e){return O$(function(t,n){return e(n)})},O$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Me(n,r)}},_A=function(e){return function(t){return t.concat(e())}},SA=_A,$A=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},w$=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},o8=w$(D),TA=e$,IA=fv,OA=dv,C$=Id,wA=t$,CA=pv,Tv=function(e){var t=E$(e);return function(n){return t(function(r,i){return n(i)})}},Rd=function(e){return function(t){return ts(t,e.of(Xc()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return y(i,vv(o))}}),r)})}},E$=function(e){return function(t){return C$(e.of(Xc()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return y(o,vv(a))}}),t(n,i))})}},a8=function(e){var t=F$(e);return function(n){return function(r){return t(r,n)}}},u8=function(e){var t=P$(e);return function(n){return function(r){return t(r,n)}}},R$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(bt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},pt="Array",s8=Nk,EA=function(){return{concat:function(e,t){return e.concat(t)}}},M$=function(){return{concat:EA().concat,empty:[]}},RA=Pk,c8=Wk,MA=function(e){var t=p$(e);return{concat:function(n,r){return t(r)(n)}}},l8=function(e){return{concat:MA(e).concat,empty:[]}},f8=function(e){var t=h$(e);return{concat:function(n,r){return t(r)(n)}}},d8=function(e){var t=m$(e);return{concat:function(n,r){return t(r)(n)}}},x$={URI:pt,map:un},p8=Ke(x$),xA={URI:pt,of:La},h8={URI:pt,map:un,mapWithIndex:gv},Iv={URI:pt,map:un,ap:ja},m8=Ct(Iv),v8=Et(Iv),g8={URI:pt,map:un,ap:ja,of:La},k$={URI:pt,map:un,ap:ja,chain:Cd},y8=ft(k$),b8={URI:pt,map:un,ap:ja,of:La,chain:Cd},_8={URI:pt,unfold:R$},S8={URI:pt,map:un,alt:v$},kA={URI:pt,zero:Xc},$8=Bc(kA,xA),T8={URI:pt,map:un,ap:ja,of:La,alt:v$,zero:Xc},I8={URI:pt,map:un,extend:pA},A$={URI:pt,compact:Qc,separate:el},O8={URI:pt,map:un,compact:Qc,separate:el,filter:yv,filterMap:bv,partition:_v,partitionMap:Sv},w8={URI:pt,map:un,mapWithIndex:gv,compact:Qc,separate:el,filter:yv,filterMap:bv,partition:_v,partitionMap:Sv,partitionMapWithIndex:lA,partitionWithIndex:cA,filterMapWithIndex:fA,filterWithIndex:dA},AA={URI:pt,reduce:ts,foldMap:Jc,reduceRight:Zc},C8={URI:pt,reduce:ts,foldMap:Jc,reduceRight:Zc,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$},N$={URI:pt,map:un,reduce:ts,foldMap:Jc,reduceRight:Zc,traverse:$v,sequence:Rd},E8={URI:pt,map:un,mapWithIndex:gv,reduce:ts,foldMap:Jc,reduceRight:Zc,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$,traverse:$v,sequence:Rd,traverseWithIndex:hA},F$=ai(N$,A$),P$=oi(N$,A$),NA={URI:pt,map:un,compact:Qc,separate:el,filter:yv,filterMap:bv,partition:_v,partitionMap:Sv,reduce:ts,foldMap:Jc,reduceRight:Zc,traverse:$v,sequence:Rd,wither:F$,wilt:P$},R8=s$,M8={URI:pt,map:un,ap:ja,chain:Cd,chainRec:r8},x8=c$,k8={URI:pt,map:un,ap:ja,chain:Cd,chainRec:i8},A8=X_(NA),FA={URI:pt,fromEither:Yk},N8=gr(FA),PA=hS,WA=function(e,t,n){return jt(n)?mS(e,t,n):[]},jA=function(e,t){var n=t.slice();return n.splice(e,1),n},F8=zk,LA=function(e){return function(t){return t.some(e)}},P8=LA,W8=Vk,j8=La(Yt),L8=wt(x$),D8=Mt(k$),q8=Rt(Iv),U8=Tx,B8=[],z8=Jx,K8=Zx,V8=aA,H8={URI:pt,compact:Qc,separate:el,map:un,ap:ja,of:La,chain:Cd,filter:yv,filterMap:bv,partition:_v,partitionMap:Sv,mapWithIndex:gv,partitionMapWithIndex:lA,partitionWithIndex:cA,filterMapWithIndex:fA,filterWithIndex:dA,alt:v$,zero:Xc,unfold:R$,reduce:ts,foldMap:Jc,reduceRight:Zc,traverse:$v,sequence:Rd,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$,traverseWithIndex:hA,extend:pA,wither:F$,wilt:P$};const G8=Object.freeze(Object.defineProperty({__proto__:null,Alt:S8,Alternative:T8,Applicative:g8,Apply:Iv,Chain:k$,ChainRecBreadthFirst:k8,ChainRecDepthFirst:M8,Compactable:A$,Do:j8,Extend:I8,Filterable:O8,FilterableWithIndex:w8,Foldable:AA,FoldableWithIndex:C8,FromEither:FA,Functor:x$,FunctorWithIndex:h8,Monad:b8,Pointed:xA,Traversable:N$,TraversableWithIndex:E8,URI:pt,Unfoldable:_8,Witherable:NA,Zero:kA,alt:SA,altW:_A,ap:mA,apFirst:m8,apS:q8,apSecond:v8,append:vv,appendW:pZ,array:H8,bind:D8,bindTo:L8,chain:Ed,chainFirst:y8,chainRecBreadthFirst:x8,chainRecDepthFirst:R8,chainWithIndex:tA,chop:XZ,chunksOf:QZ,compact:Qc,comprehension:t8,concat:n8,concatW:sA,cons:z8,copy:$n,deleteAt:UZ,difference:m$,dropLeft:xZ,dropLeftWhile:AZ,dropRight:kZ,duplicate:o8,elem:d$,empty:B8,every:F8,exists:P8,extend:w$,filter:gA,filterE:A8,filterMap:T$,filterMapWithIndex:$$,filterWithIndex:$A,findFirst:FZ,findFirstMap:PZ,findIndex:NZ,findLast:WZ,findLastIndex:LZ,findLastMap:jZ,flap:p8,flatten:S$,foldLeft:gZ,foldMap:TA,foldMapWithIndex:IA,foldRight:yZ,fromEither:Yk,fromEitherK:N8,fromOption:Gk,fromOptionK:e8,fromPredicate:mZ,getDifferenceMagma:d8,getEq:RA,getIntersectionSemigroup:f8,getMonoid:M$,getOrd:c8,getSemigroup:EA,getShow:s8,getUnionMonoid:l8,getUnionSemigroup:MA,guard:$8,head:TZ,init:wZ,insertAt:DZ,intercalate:W8,intersection:h$,intersperse:GZ,isEmpty:Wa,isNonEmpty:jt,isOutOfBound:wd,last:IZ,lefts:KZ,lookup:$Z,makeBy:Hk,map:_$,mapWithIndex:vA,match:vZ,matchLeft:Xk,matchLeftW:Zk,matchRight:eA,matchRightW:Qk,matchW:Jk,modifyAt:rA,of:La,partition:yA,partitionMap:bA,partitionMapWithIndex:O$,partitionWithIndex:I$,prepend:fZ,prependAll:aA,prependToAll:V8,prependW:dZ,range:U8,reduce:OA,reduceRight:wA,reduceRightWithIndex:CA,reduceWithIndex:C$,replicate:hZ,reverse:BZ,rights:zZ,rotate:YZ,scanLeft:bZ,scanRight:_Z,separate:el,sequence:Rd,size:SZ,snoc:K8,some:LA,sort:VZ,sortBy:ZZ,spanLeft:MZ,splitAt:uA,tail:OZ,takeLeft:CZ,takeLeftWhile:RZ,takeRight:EZ,traverse:Tv,traverseWithIndex:E$,unfold:R$,union:p$,uniq:JZ,unsafeDeleteAt:jA,unsafeInsertAt:PA,unsafeUpdateAt:WA,unzip:HZ,updateAt:qZ,wilt:u8,wither:a8,zero:Xc,zip:oA,zipWith:iA},Symbol.toStringTag,{value:"Module"})),Y8=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var J8=function(e){return typeof e=="boolean"},DA=function(e,t){return function(n){return n?t():e()}},qA=DA,UA=qA,Z8=UA,BA={equals:function(e,t){return e===t}},X8={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},zA={concat:function(e,t){return e&&t}},KA={concat:function(e,t){return e||t}},Q8={concat:zA.concat,empty:!0},eX={concat:KA.concat,empty:!1},tX={equals:BA.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},nX={show:function(e){return JSON.stringify(e)}};const rX=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:X8,Eq:BA,MonoidAll:Q8,MonoidAny:eX,Ord:tX,SemigroupAll:zA,SemigroupAny:KA,Show:nX,fold:Z8,foldW:qA,isBoolean:J8,match:UA,matchW:DA},Symbol.toStringTag,{value:"Module"}));var VA=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}},iX={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},oX=VA,aX={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},uX=YR;const sX=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:aX,booleanAlgebraVoid:iX,getDualBooleanAlgebra:oX,getFunctionBooleanAlgebra:uX,reverse:VA},Symbol.toStringTag,{value:"Module"}));var cX=function(e){return bM(e)(e.bottom,e.top)},lX=function(e){var t=y_(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},fX={equals:fm.equals,compare:fm.compare,top:1/0,bottom:-1/0};const dX=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:fX,clamp:cX,reverse:lX},Symbol.toStringTag,{value:"Module"}));function HA(e){return{meet:cm(e),join:lm(e)}}const pX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:HA},Symbol.toStringTag,{value:"Module"}));function hX(e){var t=HA(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const mX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:hX},Symbol.toStringTag,{value:"Module"})),vX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),bX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var W$=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const _X=Object.freeze(Object.defineProperty({__proto__:null,tailRec:W$},Symbol.toStringTag,{value:"Module"}));function j$(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function GA(e,t){var n=j$(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},D),n(r,i))}}function SX(e){return j$(e,e)}function $X(e){return GA(e,e)}const TX=Object.freeze(Object.defineProperty({__proto__:null,fanIn:GA,fanin:$X,split:j$,splitChoice:SX},Symbol.toStringTag,{value:"Module"})),IX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var OX=function(e,t){return y(e,YA(t))},YA=function(e){return function(t){return V(e,t)}},JA="Predicate",ZA=function(){return{concat:function(e,t){return y(e,QA(t))}}},wX=function(){return{concat:ZA().concat,empty:XR}},XA=function(){return{concat:function(e,t){return y(e,eN(t))}}},CX=function(){return{concat:XA().concat,empty:f_}},EX={URI:JA,contramap:OX},Md=function(e){return function(t){return!e(t)}},QA=function(e){return function(t){return function(n){return t(n)||e(n)}}},eN=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const RX=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:EX,URI:JA,and:eN,contramap:YA,getMonoidAll:CX,getMonoidAny:wX,getSemigroupAll:XA,getSemigroupAny:ZA,not:Md,or:QA},Symbol.toStringTag,{value:"Module"}));var at=be,_t=pe;function Ov(e){return function(t){return e(t)?_t(t):at}}var wv=function(e){return e._tag==="Right"?at:_t(e.left)},xd=function(e){return e._tag==="Left"?at:_t(e.right)},yr=function(e,t){return y(e,Ji(t))},ns=function(e,t){return y(e,iN(t))},Cv=function(e,t){return y(e,Ad(t))},Ev=function(e,t,n){return y(e,aN(t,n))},Rv=function(e){var t=uN(e);return function(n,r){return y(n,t(r))}},Mv=function(e,t,n){return y(e,sN(t,n))},L$=function(e){var t=vN(e);return function(n,r){return y(n,t(r))}},D$=function(e,t){return y(e,lN(t))},kd=function(e,t){return y(e,dN(t))},q$=function(e,t){return y(e,pN(t))},tN=function(e,t){return y(e,K$(t))},U$=function(e,t){return y(e,hN(t))},B$=function(e,t){return y(e,mN(t))},Bt="Option",MX=function(e){return{show:function(t){return Le(t)?"none":"some(".concat(e.show(t.value),")")}}},nN=function(e){return{equals:function(t,n){return t===n||(Le(t)?Le(n):Le(n)?!1:e.equals(t.value,n.value))}}},xX=function(e){return{equals:nN(e).equals,compare:function(t,n){return t===n?0:Nv(t)?Nv(n)?e.compare(t.value,n.value):1:-1}}},z$=function(e){return{concat:function(t,n){return Le(t)?n:Le(n)?t:_t(e.concat(t.value,n.value))},empty:at}},Ji=function(e){return function(t){return Le(t)?at:_t(e(t.value))}},tl={URI:Bt,map:yr},Mo=_t,rN={URI:Bt,of:Mo},iN=function(e){return function(t){return Le(t)||Le(e)?at:_t(t.value(e.value))}},nl={URI:Bt,map:yr,ap:ns},oN={URI:Bt,map:yr,ap:ns,of:Mo},Ad=function(e){return function(t){return Le(t)?at:e(t.value)}},Nd={URI:Bt,map:yr,ap:ns,chain:Cv},kX={URI:Bt,map:yr,ap:ns,of:Mo,chain:Cv},aN=function(e,t){return function(n){return Le(n)?e:t(e,n.value)}},uN=function(e){return function(t){return function(n){return Le(n)?e.empty:t(n.value)}}},sN=function(e,t){return function(n){return Le(n)?e:t(n.value,e)}},AX={URI:Bt,reduce:Ev,foldMap:Rv,reduceRight:Mv},cN=function(e){return function(t){return Le(t)?e():t}},lN=cN,NX={URI:Bt,map:yr,alt:D$},xv=function(){return at},fN={URI:Bt,zero:xv},FX=Bc(fN,rN),PX={URI:Bt,map:yr,ap:ns,of:Mo,alt:D$,zero:xv},K$=function(e){return function(t){return Le(t)?at:_t(e(t))}},WX={URI:Bt,map:yr,extend:tN},rl=Ad(D),jX=Me(at,at),il=function(e){return Le(e)?jX:Me(wv(e.value),xd(e.value))},rs={URI:Bt,compact:rl,separate:il},dN=function(e){return function(t){return Le(t)?at:e(t.value)?t:at}},pN=function(e){return function(t){return Le(t)?at:e(t.value)}},hN=function(e){return function(t){return Me(kd(t,Md(e)),kd(t,e))}},mN=function(e){return V(Ji(e),il)},xo={URI:Bt,map:yr,compact:rl,separate:il,filter:kd,filterMap:q$,partition:U$,partitionMap:B$},vN=function(e){return function(t){return function(n){return Le(n)?e.of(at):e.map(t(n.value),_t)}}},kv=function(e){return function(t){return Le(t)?e.of(at):e.map(t.value,_t)}},V$={URI:Bt,map:yr,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:L$,sequence:kv},H$=ai(V$,rs),G$=oi(V$,rs),LX=function(e){var t=H$(e);return function(n){return function(r){return t(r,n)}}},DX=function(e){var t=G$(e);return function(n){return function(r){return t(r,n)}}},qX={URI:Bt,map:yr,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:L$,sequence:kv,compact:rl,separate:il,filter:kd,filterMap:q$,partition:U$,partitionMap:B$,wither:H$,wilt:G$},Y$=function(){return at},UX={URI:Bt,map:yr,ap:ns,of:Mo,chain:Cv,throwError:Y$},ol=xd,Av={URI:Bt,fromEither:ol},Nv=bt,Le=function(e){return e._tag==="None"},J$=function(e,t){return function(n){return Le(n)?e():t(n.value)}},BX=J$,ko=J$,Ao=ko,Z$=function(e){return function(t){return Le(t)?e():t.value}},X$=Z$,zX=Ke(tl),KX=Ct(nl),VX=Et(nl),HX=rl,GX=ft(Nd),YX=K$(D),JX=gr(Av),ZX=Co(Av,Nd),XX=Eo(Av,Nd),is=function(e){return e==null?at:_t(e)},gN=function(e){try{return _t(e())}catch{return at}},QX=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return gN(function(){return e.apply(void 0,t)})}},eQ=function(e){return V(e,is)},yN=function(e){return function(t){return Le(t)?at:is(e(t.value))}},Q$=ko(QR,D),bN=ko(d_,D);function _N(e){return function(t,n){if(n===void 0){var r=_N(e);return function(i){return r(t,i)}}return Le(n)?!1:e.equals(t,n.value)}}var tQ=function(e){return function(t){return Le(t)?!1:e(t.value)}},nQ=Mo(Yt),rQ=wt(tl),iQ=Mt(Nd),oQ=Rt(nl),SN=Mo(rn),Fv=function(e){return function(t){var n=e(0,dr(t));if(Le(n))return at;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Le(o))return at;r.push(o.value)}return _t(r)}},e0=function(e){var t=Fv(e);return function(n){return gt(n)?t(n):SN}},aQ=e0,$N=function(e){return e0(function(t,n){return e(n)})},uQ=$N(D);function sQ(e){return function(t){return Nv(e(t))}}var cQ=yN,TN={URI:Bt,map:yr,of:Mo,ap:ns,chain:Cv,reduce:Ev,foldMap:Rv,reduceRight:Mv,traverse:L$,sequence:kv,zero:xv,alt:D$,extend:tN,compact:rl,separate:il,filter:kd,filterMap:q$,partition:U$,partitionMap:B$,wither:H$,wilt:G$,throwError:Y$},lQ=Jt(nl),fQ=Wr(oN),IN=function(){return z$(O_())},dQ=function(){return z$(hm())};const pQ=Object.freeze(Object.defineProperty({__proto__:null,Alt:NX,Alternative:PX,ApT:SN,Applicative:oN,Apply:nl,Chain:Nd,Compactable:rs,Do:nQ,Extend:WX,Filterable:xo,Foldable:AX,FromEither:Av,Functor:tl,Monad:kX,MonadThrow:UX,Pointed:rN,Traversable:V$,URI:Bt,Witherable:qX,Zero:fN,alt:lN,altW:cN,ap:iN,apFirst:KX,apS:oQ,apSecond:VX,bind:iQ,bindTo:rQ,chain:Ad,chainEitherK:ZX,chainFirst:GX,chainFirstEitherK:XX,chainNullableK:yN,compact:rl,duplicate:YX,elem:_N,exists:tQ,extend:K$,filter:dN,filterMap:pN,flap:zX,flatten:HX,fold:Ao,foldMap:uN,foldW:BX,fromEither:ol,fromEitherK:JX,fromNullable:is,fromNullableK:eQ,fromPredicate:Ov,getApplyMonoid:fQ,getApplySemigroup:lQ,getEq:nN,getFirstMonoid:IN,getLastMonoid:dQ,getLeft:wv,getMonoid:z$,getOrElse:X$,getOrElseW:Z$,getOrd:xX,getRefinement:sQ,getRight:xd,getShow:MX,guard:FX,isNone:Le,isSome:Nv,map:Ji,mapNullable:cQ,match:ko,matchW:J$,none:at,of:Mo,option:TN,partition:hN,partitionMap:mN,reduce:aN,reduceRight:sN,separate:il,sequence:kv,sequenceArray:uQ,some:_t,throwError:Y$,toNullable:Q$,toUndefined:bN,traverse:vN,traverseArray:$N,traverseArrayWithIndex:aQ,traverseReadonlyArrayWithIndex:e0,traverseReadonlyNonEmptyArrayWithIndex:Fv,tryCatch:gN,tryCatchK:QX,wilt:DX,wither:LX,zero:xv},Symbol.toStringTag,{value:"Module"}));function Zi(e,t){return function(n){return e.map(n,t.compact)}}function No(e,t,n){var r=Zi(e,t),i=Rc(e,n);return function(o){return Me(r(y(o,i(wv))),r(y(o,i(xd))))}}function hQ(e,t){var n=Mc(e,t).map;return{map:n,compact:Zi(e,t),separate:No(e,t,t)}}const mQ=Object.freeze(Object.defineProperty({__proto__:null,compact:Zi,getCompactableComposition:hQ,separate:No},Symbol.toStringTag,{value:"Module"}));var vQ=function(e){return function(){return console.log(e)}},gQ=function(e){return function(){return console.warn(e)}},yQ=function(e){return function(){return console.error(e)}},bQ=function(e){return function(){return console.info(e)}};const _Q=Object.freeze(Object.defineProperty({__proto__:null,error:yQ,info:bQ,log:vQ,warn:gQ},Symbol.toStringTag,{value:"Module"}));var al=Cc;function SQ(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var $Q=D,TQ=D,IQ=D,OQ=D,wQ=D,CQ=D,EQ=D,RQ=D,MQ=D;function ON(e){return{URI:as,_E:void 0,map:t0,ap:function(t,n){return al(e.concat(t,n))}}}function wN(e){var t=ON(e);return{URI:as,_E:void 0,map:t.map,ap:t.ap,of:function(){return al(e.empty)}}}var CN=function(e,t){return y(e,MN())},t0=function(e,t){return y(e,xN())},EN=function(e,t,n){return y(e,kN(t))},RN=function(e,t){return y(e,AN(t))},MN=function(){return Cc},xN=function(){return Cc},kN=function(e){return function(t){return al(e(t))}},AN=function(e){return function(t){return al(e(t))}},as="Const",NN={URI:as,map:t0},xQ=Ke(NN),kQ={URI:as,contramap:CN},AQ={URI:as,bimap:EN,mapLeft:RN},NQ={URI:as,map:t0,contramap:CN,bimap:EN,mapLeft:RN};const FQ=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:AQ,Contravariant:kQ,Functor:NN,URI:as,bimap:kN,const_:NQ,contramap:MN,flap:xQ,getApplicative:wN,getApply:ON,getBooleanAlgebra:MQ,getBounded:IQ,getEq:$Q,getHeytingAlgebra:RQ,getMonoid:wQ,getOrd:TQ,getRing:EQ,getSemigroup:OQ,getSemiring:CQ,getShow:SQ,make:al,map:xN,mapLeft:AN},Symbol.toStringTag,{value:"Module"})),PQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var WQ={equals:function(e,t){return e.valueOf()===t.valueOf()}},jQ={equals:function(e,t){return e.getDate()===t.getDate()}},LQ={equals:function(e,t){return e.getMonth()===t.getMonth()}},DQ={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},qQ=y(ev,sm(function(e){return e.valueOf()})),UQ=function(){return new Date},BQ=function(){return new Date().getTime()};const zQ=Object.freeze(Object.defineProperty({__proto__:null,Eq:WQ,Ord:qQ,create:UQ,eqDate:jQ,eqMonth:LQ,eqYear:DQ,now:BQ},Symbol.toStringTag,{value:"Module"}));var Tt=$o,Ye=xa,Tn=function(e,t){return y(e,cs(t))},us=function(e,t){return y(e,jN(t))},ul=function(e,t){return y(e,Lr(t))},Fd=function(e,t,n){return y(e,DN(t,n))},Pd=function(e){return function(t,n){var r=qN(e);return y(t,r(n))}},Wd=function(e,t,n){return y(e,UN(t,n))},Pv=function(e){var t=BN(e);return function(n,r){return y(n,t(r))}},n0=function(e,t,n){return y(e,s0(t,n))},r0=function(e,t){return y(e,qd(t))},FN=function(e,t){return y(e,KN(t))},i0=function(e,t){return y(e,c0(t))},o0=function(e,t){return W$(t(e),function(n){return le(n)?Ye(Tt(n.left)):le(n.right)?Tt(t(n.right.left)):Ye(Ye(n.right.right))})},It="Either",KQ=function(e,t){return{show:function(n){return le(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},VQ=function(e,t){return{equals:function(n,r){return n===r||(le(n)?le(r)&&e.equals(n.left,r.left):l0(r)&&t.equals(n.right,r.right))}}},jd=function(e){return{concat:function(t,n){return le(n)?t:le(t)?n:Ye(e.concat(t.right,n.right))}}},ss=function(e){var t=Tt(e.empty);return{URI:It,_E:void 0,compact:function(n){return le(n)?n:n.right._tag==="None"?t:Ye(n.right.value)},separate:function(n){return le(n)?Me(n,n):le(n.right)?Me(Ye(n.right.left),t):Me(t,Ye(n.right.right))}}},sl=function(e){var t=Tt(e.empty),n=ss(e),r=n.compact,i=n.separate,o=function(u,s){return le(u)||s(u.right)?u:t},a=function(u,s){return le(u)?Me(u,u):s(u.right)?Me(t,Ye(u.right)):Me(Ye(u.right),t)};return{URI:It,_E:void 0,map:Tn,compact:r,separate:i,filter:o,filterMap:function(u,s){if(le(u))return u;var c=s(u.right);return c._tag==="None"?t:Ye(c.value)},partition:a,partitionMap:function(u,s){if(le(u))return Me(u,u);var c=s(u.right);return le(c)?Me(Ye(c.left),t):Me(t,Ye(c.right))}}},HQ=function(e){var t=sl(e),n=ss(e);return{URI:It,_E:void 0,map:Tn,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:Pv,sequence:Dd,reduce:Fd,foldMap:Pd,reduceRight:Wd,wither:ai(u0,n),wilt:oi(u0,n)}},Da=function(e){return{URI:It,_E:void 0,map:Tn,ap:function(t,n){return le(t)?le(n)?Tt(e.concat(t.left,n.left)):t:le(n)?n:Ye(t.right(n.right))},of:Xi}},PN=function(e){return{URI:It,_E:void 0,map:Tn,alt:function(t,n){if(l0(t))return t;var r=n();return le(r)?Tt(e.concat(t.left,r.left)):r}}},cs=function(e){return function(t){return le(t)?t:Ye(e(t.right))}},qa={URI:It,map:Tn},Xi=Ye,GQ={URI:It,of:Xi},WN=function(e){return function(t){return le(t)?t:le(e)?e:Ye(t.right(e.right))}},jN=WN,cl={URI:It,map:Tn,ap:us},LN={URI:It,map:Tn,ap:us,of:Xi},a0=function(e){return function(t){return le(t)?t:e(t.right)}},Lr=a0,Ld={URI:It,map:Tn,ap:us,chain:ul},YQ={URI:It,map:Tn,ap:us,of:Xi,chain:ul},DN=function(e,t){return function(n){return le(n)?e:t(e,n.right)}},qN=function(e){return function(t){return function(n){return le(n)?e.empty:t(n.right)}}},UN=function(e,t){return function(n){return le(n)?e:t(n.right,e)}},JQ={URI:It,reduce:Fd,foldMap:Pd,reduceRight:Wd},BN=function(e){return function(t){return function(n){return le(n)?e.of(Tt(n.left)):e.map(t(n.right),Ye)}}},Dd=function(e){return function(t){return le(t)?e.of(Tt(t.left)):e.map(t.right,Ye)}},u0={URI:It,map:Tn,reduce:Fd,foldMap:Pd,reduceRight:Wd,traverse:Pv,sequence:Dd},s0=function(e,t){return function(n){return le(n)?Tt(e(n.left)):Ye(t(n.right))}},qd=function(e){return function(t){return le(t)?Tt(e(t.left)):t}},ZQ={URI:It,bimap:n0,mapLeft:r0},zN=function(e){return function(t){return le(t)?e():t}},KN=zN,XQ={URI:It,map:Tn,alt:FN},c0=function(e){return function(t){return le(t)?t:Ye(e(t))}},QQ={URI:It,map:Tn,extend:i0},eee={URI:It,map:Tn,ap:us,chain:ul,chainRec:o0},Wv=Tt,tee={URI:It,map:Tn,ap:us,of:Xi,chain:ul,throwError:Wv},ll={URI:It,fromEither:D},nee=Na(ll),VN=Hi(ll),le=Gt,l0=p_,f0=function(e,t){return function(n){return le(n)?e(n.left):t(n.right)}},HN=f0,Ua=f0,d0=Ua,p0=function(e){return function(t){return le(t)?e(t.left):t.right}},ree=p0,iee=Ke(qa),GN=Ct(cl),oee=GN,YN=Et(cl),aee=YN,JN=ft(Ld),uee=JN,ZN=a0(D),see=ZN,cee=c0(D),lee=Gi(ll),fee=Ju(ll,Ld),XN=Zu(ll,Ld),dee=XN,QN=function(e){return le(e)?Ye(e.left):Tt(e.right)},eF=function(e){return function(t){return le(t)?e(t.left):t}},tF=eF,h0=function(e){return function(t){return t==null?Tt(e):Ye(t)}},ls=function(e,t){try{return Ye(e())}catch(n){return Tt(t(n))}},pee=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return ls(function(){return e.apply(void 0,n)},t)}},nF=function(e){var t=h0(e);return function(n){return V(n,t)}},hee=function(e){var t=nF(e);return function(n){return Lr(t(n))}},rF=HN(D,D);function mee(e){return e instanceof Error?e:new Error(String(e))}function iF(e){return function(t,n){if(n===void 0){var r=iF(e);return function(i){return r(t,i)}}return le(n)?!1:e.equals(t,n.right)}}var vee=function(e){return function(t){return le(t)?!1:e(t.right)}},gee=Xi(Yt),yee=wt(qa),oF=Mt(Ld),bee=oF,aF=Rt(cl),_ee=aF,uF=Xi(rn),Ud=function(e){return function(t){var n=e(0,dr(t));if(le(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(le(o))return o;r.push(o.right)}return Ye(r)}},m0=function(e){var t=Ud(e);return function(n){return gt(n)?t(n):uF}},See=m0,sF=function(e){return m0(function(t,n){return e(n)})},$ee=sF(D);function Tee(e,t){return ls(function(){return JSON.parse(e)},t)}var Iee=function(e,t){return ls(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},Oee={URI:It,map:Tn,of:Xi,ap:us,chain:ul,reduce:Fd,foldMap:Pd,reduceRight:Wd,traverse:Pv,sequence:Dd,bimap:n0,mapLeft:r0,alt:FN,extend:i0,chainRec:o0,throwError:Wv},wee=Jt(cl),Cee=Wr(LN),Eee=function(e,t){return Jt(Da(e))(t)},Ree=function(e,t){return Wr(Da(e))(t)};function Mee(e){var t=Da(e).ap,n=PN(e).alt;return{URI:It,_E:void 0,map:Tn,of:Xi,chain:ul,bimap:n0,mapLeft:r0,reduce:Fd,foldMap:Pd,reduceRight:Wd,extend:i0,traverse:Pv,sequence:Dd,chainRec:o0,throwError:Wv,ap:t,alt:n}}const cF=Object.freeze(Object.defineProperty({__proto__:null,Alt:XQ,ApT:uF,Applicative:LN,Apply:cl,Bifunctor:ZQ,Chain:Ld,ChainRec:eee,Do:gee,Extend:QQ,Foldable:JQ,FromEither:ll,Functor:qa,Monad:YQ,MonadThrow:tee,Pointed:GQ,Traversable:u0,URI:It,alt:KN,altW:zN,ap:jN,apFirst:GN,apFirstW:oee,apS:aF,apSW:_ee,apSecond:YN,apSecondW:aee,apW:WN,bimap:s0,bind:oF,bindTo:yee,bindW:bee,chain:Lr,chainFirst:JN,chainFirstW:uee,chainNullableK:hee,chainOptionK:fee,chainW:a0,duplicate:cee,either:Oee,elem:iF,exists:vee,extend:c0,filterOrElse:XN,filterOrElseW:dee,flap:iee,flatten:see,flattenW:ZN,fold:d0,foldMap:qN,foldW:HN,fromNullable:h0,fromNullableK:nF,fromOption:VN,fromOptionK:lee,fromPredicate:nee,getAltValidation:PN,getApplicativeValidation:Da,getApplyMonoid:Cee,getApplySemigroup:wee,getCompactable:ss,getEq:VQ,getFilterable:sl,getOrElse:ree,getOrElseW:p0,getSemigroup:jd,getShow:KQ,getValidation:Mee,getValidationMonoid:Ree,getValidationSemigroup:Eee,getWitherable:HQ,isLeft:le,isRight:l0,left:Tt,map:cs,mapLeft:qd,match:Ua,matchW:f0,of:Xi,orElse:tF,orElseW:eF,parseJSON:Tee,reduce:DN,reduceRight:UN,right:Ye,sequence:Dd,sequenceArray:$ee,stringifyJSON:Iee,swap:QN,throwError:Wv,toError:mee,toUnion:rF,traverse:BN,traverseArray:sF,traverseArrayWithIndex:See,traverseReadonlyArrayWithIndex:m0,traverseReadonlyNonEmptyArrayWithIndex:Ud,tryCatch:ls,tryCatchK:pee},Symbol.toStringTag,{value:"Module"}));function fs(e){return V(Ye,e.of)}function fl(e){return V(Tt,e.of)}function dl(e){return function(t){return e.map(t,Ye)}}function pl(e){return function(t){return e.map(t,Tt)}}function jv(e){return function(t){return V(h0(t),e.of)}}function Lv(e){var t=jv(e);return function(n){var r=t(n);return function(i){return V(i,r)}}}function v0(e){var t=ds(e),n=Lv(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function hl(e){return Rc(e,qa)}function ml(e){return To(e,cl)}function ds(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?e.of(r):t(r.right)})}}}function vl(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?t():e.of(r)})}}}function gl(e){return function(t,n){return function(r){return e.map(r,s0(t,n))}}}function yl(e){return function(t){return function(n){return e.map(n,qd(t))}}}function Bd(e,t){return function(n){return function(r){return e.chain(r,Ua(function(i){return e.map(n(),qd(function(o){return t.concat(i,o)}))},fs(e)))}}}function zd(e){return function(t,n){return function(r){return e.map(r,Ua(t,n))}}}function bl(e){return function(t,n){return function(r){return e.chain(r,Ua(t,n))}}}function _l(e){return function(t){return function(n){return e.chain(n,Ua(t,e.of))}}}function ps(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?t(r.left):e.of(r)})}}}function Kd(e){var t=ps(e);return function(n){return t(function(r){return e.map(n(r),function(i){return le(i)?i:Tt(r)})})}}function Vd(e){return function(t){return function(n){return e.chain(n,Ua(function(r){return e.map(t(r),Tt)},function(r){return e.of(Ye(r))}))}}}function Sl(e){return function(t){return e.map(t,QN)}}function Hd(e){return function(t){return e.map(t,rF)}}function xee(e){var t=ml(e),n=hl(e),r=ds(e),i=vl(e),o=gl(e),a=yl(e),u=bl(e),s=_l(e),c=ps(e);return{map:function(l,f){return y(l,n(f))},ap:function(l,f){return y(l,t(f))},of:fs(e),chain:function(l,f){return y(l,r(f))},alt:function(l,f){return y(l,i(f))},bimap:function(l,f,d){return y(l,o(f,d))},mapLeft:function(l,f){return y(l,a(f))},fold:function(l,f,d){return y(l,u(f,d))},getOrElse:function(l,f){return y(l,s(f))},orElse:function(l,f){return y(l,c(f))},swap:Sl(e),rightM:dl(e),leftM:pl(e),left:fl(e)}}const kee=Object.freeze(Object.defineProperty({__proto__:null,alt:vl,altValidation:Bd,ap:ml,bimap:gl,chain:ds,chainNullableK:v0,fromNullable:jv,fromNullableK:Lv,getEitherM:xee,getOrElse:_l,left:fl,leftF:pl,map:hl,mapLeft:yl,match:zd,matchE:bl,orElse:ps,orElseFirst:Kd,orLeft:Vd,right:fs,rightF:dl,swap:Sl,toUnion:Hd},Symbol.toStringTag,{value:"Module"}));var Aee="Endomorphism",lF=function(){return{concat:function(e,t){return V(e,t)}}},fF=function(){return{concat:lF().concat,empty:D}};const Nee=Object.freeze(Object.defineProperty({__proto__:null,URI:Aee,getMonoid:fF,getSemigroup:lF},Symbol.toStringTag,{value:"Module"})),Fee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function dF(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}function Pee(e,t){var n=t.zero,r=dF(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}var Wee={add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const jee=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:Wee,gcd:dF,lcm:Pee},Symbol.toStringTag,{value:"Module"}));function Fo(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function Po(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function Ba(e,t){var n=Fo(e,t);return function(r){var i=n(Md(r)),o=n(r);return function(a){return Me(i(a),o(a))}}}function za(e,t){var n=Po(e,t);return function(r){return function(i){return Me(y(i,n(function(o){return wv(r(o))})),y(i,n(function(o){return xd(r(o))})))}}}function Lee(e,t){var n=Mc(e,t).map,r=Zi(e,t),i=No(e,t,t),o=Fo(e,t),a=Po(e,t),u=Ba(e,t),s=za(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return y(c,o(l))},filterMap:function(c,l){return y(c,a(l))},partition:function(c,l){return y(c,u(l))},partitionMap:function(c,l){return y(c,s(l))}}}const Dee=Object.freeze(Object.defineProperty({__proto__:null,filter:Fo,filterMap:Po,getFilterableComposition:Lee,partition:Ba,partitionMap:za},Symbol.toStringTag,{value:"Module"})),qee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function pF(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function hF(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function mF(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function Uee(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(o,a){return e.chain(o,function(u){return r(u,a)})})}}}function Bee(e,t){return function(n,r){var i=function(o,a){var u=o.init,s=o.acc;return u?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(s,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function vF(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function zee(e,t){var n=function(i,o){return e.ap(e.map(i,Yn),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function Kee(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(o,a){return e.chain(o,function(u){return i(u,a)})})}}var Vee=vF;function g0(e,t){var n=pF(e,t),r=hF(e,t),i=mF(e,t);return{reduce:function(o,a,u){return y(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return y(u,a(s))}},reduceRight:function(o,a,u){return y(o,i(a,u))}}}const Hee=Object.freeze(Object.defineProperty({__proto__:null,foldM:Kee,foldMap:hF,getFoldableComposition:g0,intercalate:Bee,reduce:pF,reduceM:Uee,reduceRight:mF,toArray:Vee,toReadonlyArray:vF,traverse_:zee},Symbol.toStringTag,{value:"Module"}));function gF(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,u){return t.reduceWithIndex(u,a,function(s,c,l){return r([o,s],c,l)})})}}}function yF(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(o){return function(a){return r(a,function(u,s){return i(s,function(c,l){return o([u,c],l)})})}}}}function bF(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,u){return t.reduceRightWithIndex(a,u,function(s,c,l){return r([o,s],c,l)})})}}}function Gee(e,t){var n=g0(e,t),r=gF(e,t),i=yF(e,t),o=bF(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return y(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return y(s,u(c))}},reduceRightWithIndex:function(a,u,s){return y(a,o(u,s))}}}const Yee=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:yF,getFoldableWithIndexComposition:Gee,reduceRightWithIndex:bF,reduceWithIndex:gF},Symbol.toStringTag,{value:"Module"}));function Qi(e){return function(t){return V(t,e.fromIO)}}function Wo(e,t){return function(n){var r=V(n,e.fromIO);return function(i){return t.chain(i,r)}}}function jo(e,t){var n=ft(t);return function(r){return n(V(r,e.fromIO))}}const Jee=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:jo,chainIOK:Wo,fromIOK:Qi},Symbol.toStringTag,{value:"Module"}));var _F=function(){return D},Zee=D,Gd=function(e){return function(t){return function(n){return t(e(n))}}},Yd=function(e){return function(t){return e(t)(t)}},Xee=Yd,Lo=function(e,t){return y(e,hs(t))},Jd=function(e,t){return y(e,TF(t))},y0=function(e,t){return y(e,IF(t))},SF=function(e,t){return y(e,wF(t))},Dv=function(e,t,n){return y(e,CF(t,n))},hs=function(e){return function(t){return function(n){return e(t(n))}}},$F=function(e){return function(t){return function(n){return t(n)(e(n))}}},TF=$F,eo=Yn,b0=function(e){return function(t){return function(n){return e(t(n))(n)}}},IF=b0,OF=b0(D),Qee=OF,wF=function(e){return function(t){return V(e,t)}},CF=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},_0=function(){return D},S0=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},$0=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},T0=function(e){return d0(function(t){return $o(e(t))},Ye)},I0=function(e){return d0(Tt,function(t){return xa(e(t))})},Dr="Reader",sn={URI:Dr,map:Lo},ete=Ke(sn),O0={URI:Dr,of:eo},Do={URI:Dr,map:Lo,ap:Jd},EF=Ct(Do),tte=EF,RF=Et(Do),nte=RF,MF={URI:Dr,map:Lo,ap:Jd,of:eo},w0={URI:Dr,map:Lo,ap:Jd,chain:y0},qo={URI:Dr,map:Lo,of:eo,ap:Jd,chain:y0},xF=ft(w0),rte=xF,ite={URI:Dr,map:Lo,promap:Dv},ote={URI:Dr,compose:SF,id:_0},ate={URI:Dr,map:Lo,promap:Dv,first:S0,second:$0},ute={URI:Dr,map:Lo,promap:Dv,left:T0,right:I0},ste=wt(sn),kF=Mt(w0),cte=kF,lte=eo(Yt),AF=Rt(Do),fte=AF,NF=eo(rn),ms=function(e){return function(t){return function(n){for(var r=[e(0,dr(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},C0=function(e){var t=ms(e);return function(n){return gt(n)?t(n):NF}},dte=C0,FF=function(e){return C0(function(t,n){return e(n)})},pte=FF(D),hte={URI:Dr,map:Lo,of:eo,ap:Jd,chain:y0,promap:Dv,compose:SF,id:_0,first:S0,second:$0,left:T0,right:I0},mte=Jt(Do),vte=Wr(MF);const gte=Object.freeze(Object.defineProperty({__proto__:null,ApT:NF,Applicative:MF,Apply:Do,Category:ote,Chain:w0,Choice:ute,Do:lte,Functor:sn,Monad:qo,Pointed:O0,Profunctor:ite,Strong:ate,URI:Dr,ap:TF,apFirst:EF,apFirstW:tte,apS:AF,apSW:fte,apSecond:RF,apSecondW:nte,apW:$F,ask:_F,asks:Zee,asksReader:Xee,asksReaderW:Yd,bind:kF,bindTo:ste,bindW:cte,chain:IF,chainFirst:xF,chainFirstW:rte,chainW:b0,compose:wF,first:S0,flap:ete,flatten:Qee,flattenW:OF,getMonoid:vte,getSemigroup:mte,id:_0,left:T0,local:Gd,map:hs,of:eo,promap:CF,reader:hte,right:I0,second:$0,sequenceArray:pte,traverseArray:FF,traverseArrayWithIndex:dte,traverseReadonlyArrayWithIndex:C0,traverseReadonlyNonEmptyArrayWithIndex:ms},Symbol.toStringTag,{value:"Module"}));function Zd(e){return function(){return e.fromReader(_F())}}function Xd(e){return e.fromReader}function vs(e){return function(t){return V(t,e.fromReader)}}function Qd(e,t){var n=vs(e);return function(r){return function(i){return t.chain(i,n(r))}}}function ep(e,t){return V(vs(e),ft(t))}const yte=Object.freeze(Object.defineProperty({__proto__:null,ask:Zd,asks:Xd,chainFirstReaderK:ep,chainReaderK:Qd,fromReaderK:vs},Symbol.toStringTag,{value:"Module"}));var PF=function(){return function(e){return[e,e]}},WF=function(e){return function(){return[void 0,e]}},jF=function(e){return function(t){return[void 0,e(t)]}},LF=function(e){return function(t){return[e(t),t]}},tp=function(e,t){return y(e,qF(t))},qv=function(e,t){return y(e,UF(t))},DF=function(e,t){return y(e,E0(t))},qF=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},UF=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),u=a[0],s=a[1];return[i(u),s]}}},np=function(e){return function(t){return[e,t]}},E0=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},bte=E0(D),Ka="State",R0={URI:Ka,map:tp},_te=Ke(R0),Ste={URI:Ka,of:np},Uv={URI:Ka,map:tp,ap:qv},$te=Ct(Uv),Tte=Et(Uv),Ite={URI:Ka,map:tp,ap:qv,of:np},M0={URI:Ka,map:tp,ap:qv,chain:DF},BF={URI:Ka,map:tp,ap:qv,of:np,chain:DF},Ote=ft(M0),wte={URI:Ka,fromState:D},Cte=function(e){return function(t){return t(e)[0]}},Ete=function(e){return function(t){return t(e)[1]}},Rte=wt(R0),Mte=Mt(M0),xte=Rt(Uv),zF=function(e){return function(t){return function(n){for(var r=e(0,dr(t))(n),i=r[0],o=r[1],a=[i],u=o,s=1;s<t.length;s++){var c=e(s,t[s])(u),l=c[0],f=c[1];a.push(l),u=f}return[a,u]}}},x0=function(e){var t=zF(e);return function(n){return gt(n)?t(n):np(rn)}},kte=x0,KF=function(e){return x0(function(t,n){return e(n)})},Ate=KF(D),Nte=function(e,t){return e(t)[0]},Fte=function(e,t){return e(t)[1]},Pte=BF;const Wte=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Ite,Apply:Uv,Chain:M0,FromState:wte,Functor:R0,Monad:BF,Pointed:Ste,URI:Ka,ap:UF,apFirst:$te,apS:xte,apSecond:Tte,bind:Mte,bindTo:Rte,chain:E0,chainFirst:Ote,evalState:Nte,evaluate:Cte,execState:Fte,execute:Ete,flap:_te,flatten:bte,get:PF,gets:LF,map:qF,modify:jF,of:np,put:WF,sequenceArray:Ate,state:Pte,traverseArray:KF,traverseArrayWithIndex:kte,traverseReadonlyArrayWithIndex:x0,traverseReadonlyNonEmptyArrayWithIndex:zF},Symbol.toStringTag,{value:"Module"}));function VF(e){return function(){return e.fromState(PF())}}function HF(e){return function(t){return e.fromState(WF(t))}}function GF(e){return V(jF,e.fromState)}function YF(e){return V(LF,e.fromState)}function k0(e){return function(t){return V(t,e.fromState)}}function JF(e,t){var n=k0(e);return function(r){return function(i){return t.chain(i,n(r))}}}const jte=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:JF,fromStateK:k0,get:VF,gets:YF,modify:GF,put:HF},Symbol.toStringTag,{value:"Module"}));function gs(e){return function(t){return V(t,e.fromTask)}}function $l(e,t){return function(n){var r=V(n,e.fromTask);return function(i){return t.chain(i,r)}}}function Tl(e,t){var n=ft(t);return function(r){return n(V(r,e.fromTask))}}const Lte=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:Tl,chainTaskK:$l,fromTaskK:gs},Symbol.toStringTag,{value:"Module"}));function ZF(e){return function(t){return V(t,e.fromThese)}}const Dte=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:ZF},Symbol.toStringTag,{value:"Module"}));function XF(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(i,o){return t.mapWithIndex(o,function(a,u){return n([i,a],u)})})}}}function qte(e,t){var n=Mc(e,t).map,r=XF(e,t);return{map:n,mapWithIndex:function(i,o){return y(i,r(o))}}}const Ute=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:qte,mapWithIndex:XF},Symbol.toStringTag,{value:"Module"})),Bte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Kte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var to=function(e,t){return y(e,rP(t))},Il=function(e,t){return y(e,iP(t))},Bv=function(e,t){return y(e,P0(t))},A0=function(e,t,n){return y(e,oP(t,n))},N0=function(e){return function(t,n){return y(t,aP()(n))}},F0=function(e,t,n){return y(e,uP(t,n))},QF=function(e,t){return y(e,lP())},eP=function(e,t){return y(e,W0(t))},tP=function(e){var t=sP(e);return function(n,r){return y(n,t(r))}},nP=W$,rP=function(e){return function(t){return e(t)}},iP=function(e){return function(t){return t(e)}},Ol=D,P0=function(e){return function(t){return e(t)}},W0=function(e){return function(t){return e(t)}},j0=D,Vte=W0(D),Hte=P0(D),oP=function(e,t){return function(n){return t(e,n)}},aP=function(){return function(e){return function(t){return e(t)}}},uP=function(e,t){return function(n){return t(n,e)}},sP=function(e){return function(t){return function(n){return e.map(t(n),D)}}},L0=function(e){return function(t){return e.map(t,D)}},cP=function(){return D},lP=cP,br="Identity",Gte=D,Yte=D,D0={URI:br,map:to},Jte=Ke(D0),Zte={URI:br,of:Ol},zv={URI:br,map:to,ap:Il},Xte=Ct(zv),Qte=Et(zv),ene={URI:br,map:to,ap:Il,of:Ol},q0={URI:br,map:to,ap:Il,chain:Bv},tne={URI:br,map:to,ap:Il,of:Ol,chain:Bv},nne=ft(q0),rne={URI:br,reduce:A0,foldMap:N0,reduceRight:F0},ine={URI:br,map:to,reduce:A0,foldMap:N0,reduceRight:F0,traverse:tP,sequence:L0},one={URI:br,map:to,alt:QF},ane={URI:br,map:to,extend:eP,extract:j0},une={URI:br,map:to,ap:Il,chain:Bv,chainRec:nP},sne=Ol(Yt),cne=wt(D0),lne=Mt(q0),fne=Rt(zv),dne={URI:br,map:to,ap:Il,of:Ol,chain:Bv,reduce:A0,foldMap:N0,reduceRight:F0,traverse:tP,sequence:L0,alt:QF,extract:j0,extend:eP,chainRec:nP};const pne=Object.freeze(Object.defineProperty({__proto__:null,Alt:one,Applicative:ene,Apply:zv,Chain:q0,ChainRec:une,Comonad:ane,Do:sne,Foldable:rne,Functor:D0,Monad:tne,Pointed:Zte,Traversable:ine,URI:br,alt:lP,altW:cP,ap:iP,apFirst:Xte,apS:fne,apSecond:Qte,bind:lne,bindTo:cne,chain:P0,chainFirst:nne,duplicate:Vte,extend:W0,extract:j0,flap:Jte,flatten:Hte,foldMap:aP,getEq:Yte,getShow:Gte,identity:dne,map:rP,of:Ol,reduce:oP,reduceRight:uP,sequence:L0,traverse:sP},Symbol.toStringTag,{value:"Module"})),hne=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Uo=function(e,t){return function(){return t(e())}},Va=function(e,t){return function(){return e()(t())}},wl=function(e,t){return function(){return t(e())()}},fP=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},no=function(e){return function(t){return Uo(t,e)}},mne=function(e){return function(t){return Va(t,e)}},fi=Yn,U0=function(e){return function(t){return wl(t,e)}},vne=U0(D),di="IO",st={URI:di,map:Uo},gne=Ke(st),ro={URI:di,of:fi},Bo={URI:di,map:Uo,ap:Va},yne=Ct(Bo),bne=Et(Bo),dP={URI:di,map:Uo,ap:Va,of:fi},Kv={URI:di,map:Uo,ap:Va,chain:wl},Zn={URI:di,map:Uo,ap:Va,of:fi,chain:wl},_ne=ft(Kv),B0=D,Sne={URI:di,map:Uo,ap:Va,of:fi,chain:wl,fromIO:B0},$ne={URI:di,map:Uo,ap:Va,chain:wl,chainRec:fP},Tne={URI:di,fromIO:D},Ine=fi(Yt),One=wt(st),wne=Mt(Kv),Cne=Rt(Bo),pP=fi(rn),Vv=function(e){return function(t){return function(){for(var n=[e(0,dr(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},z0=function(e){var t=Vv(e);return function(n){return gt(n)?t(n):pP}},Ene=z0,hP=function(e){return z0(function(t,n){return e(n)})},Rne=hP(D),Mne={URI:di,map:Uo,of:fi,ap:Va,chain:wl,fromIO:B0,chainRec:fP},xne=Jt(Bo),kne=Wr(dP);const Ane=Object.freeze(Object.defineProperty({__proto__:null,ApT:pP,Applicative:dP,Apply:Bo,Chain:Kv,ChainRec:$ne,Do:Ine,FromIO:Tne,Functor:st,Monad:Zn,MonadIO:Sne,Pointed:ro,URI:di,ap:mne,apFirst:yne,apS:Cne,apSecond:bne,bind:wne,bindTo:One,chain:U0,chainFirst:_ne,flap:gne,flatten:vne,fromIO:B0,getMonoid:kne,getSemigroup:xne,io:Mne,map:no,of:fi,sequenceArray:Rne,traverseArray:hP,traverseArrayWithIndex:Ene,traverseReadonlyArrayWithIndex:z0,traverseReadonlyNonEmptyArrayWithIndex:Vv},Symbol.toStringTag,{value:"Module"}));var mP=fl(ro),vP=fs(ro),gP=dl(st),Nne=pl(st),yP=fi,rp=gP,bP=zd(st),Fne=bP,K0=bl(Zn),Pne=K0,_P=K0,Wne=_P,SP=_l(Zn),jne=SP,$P=function(e,t){return function(){return ls(e,t)}},Lne=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $P(function(){return e.apply(void 0,n)},t)}},Dne=Hd(st),TP=ps(Zn),qne=TP,V0=Kd(Zn),Une=V0,Bne=function(e){return V0(NP(e))},zne=Vd(Zn),Kne=Sl(st),Xn=function(e,t){return y(e,Y0(t))},ys=function(e,t){return y(e,J0(t))},Vne=function(e,t){return y(e,Hv(function(n){return y(t,Y0(n))}))},Cl=function(e,t){return y(e,Hv(t))},H0=function(e,t,n){return y(e,OP(t,n))},G0=function(e,t){return y(e,wP(t))},IP=function(e,t){return y(e,Z0(t))},Y0=hl(st),OP=gl(st),wP=yl(st),J0=ml(Bo),Hne=J0,qr=vP,Hv=ds(Zn),Gv=Hv,CP=Gv(D),Gne=CP,Z0=vl(Zn),Yne=Z0,Yv=mP,Lt="IOEither";function EP(e){var t=To(Bo,Da(e));return{URI:Lt,_E:void 0,map:Xn,ap:function(n,r){return y(n,t(r))},of:qr}}function RP(e){var t=Bd(Zn,e);return{URI:Lt,_E:void 0,map:Xn,alt:function(n,r){return y(n,t(r))}}}var MP=function(e){var t=ss(e);return{URI:Lt,_E:void 0,compact:Zi(st,t),separate:No(st,t,qa)}};function Jne(e){var t=sl(e),n=MP(e),r=Fo(st,t),i=Po(st,t),o=Ba(st,t),a=za(st,t);return{URI:Lt,_E:void 0,map:Xn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}var X0={URI:Lt,map:Xn},Zne=Ke(X0),Xne={URI:Lt,of:qr},Qne={URI:Lt,bimap:H0,mapLeft:G0},ip={URI:Lt,map:Xn,ap:ys},xP=Ct(ip),ere=xP,kP=Et(ip),tre=kP,Q0={URI:Lt,map:Xn,ap:ys,of:qr},nre={URI:Lt,map:Xn,ap:Vne,of:qr},zo={URI:Lt,map:Xn,ap:ys,chain:Cl},rre={URI:Lt,map:Xn,ap:ys,of:qr,chain:Cl},AP=ft(zo),ire=AP,ore={URI:Lt,map:Xn,alt:IP},are={URI:Lt,map:Xn,ap:ys,of:qr,chain:Cl,fromIO:rp},ure={URI:Lt,map:Xn,ap:ys,of:qr,chain:Cl,throwError:Yv},Jv={URI:Lt,fromIO:rp},NP=Qi(Jv),sre=Wo(Jv,zo),cre=jo(Jv,zo),Ko={URI:Lt,fromEither:yP},lre=Hi(Ko),fre=Gi(Ko),dre=Ju(Ko,zo),FP=Co(Ko,zo),pre=FP,PP=Eo(Ko,zo),hre=PP,mre=Na(Ko),WP=Zu(Ko,zo),vre=WP,gre=gr(Ko),yre=function(e,t,n){return jP(e,t,n)},jP=function(e,t,n){return y(e,Gv(function(r){return y(t(r),U0(function(i){return y(n(r,i),Gv(function(){return fi(i)}))}))}))},bre=qr(Yt),_re=wt(X0),LP=Mt(zo),Sre=LP,DP=Rt(ip),$re=DP,eT=qr(rn),qP=function(e){return V(Vv(e),no(Ud(Jn)))},tT=function(e){var t=qP(e);return function(n){return gt(n)?t(n):eT}},UP=function(e){return function(t){return function(){var n=e(0,dr(t))();if(Gt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Gt(o))return o;r.push(o.right)}return xa(r)}}},nT=function(e){var t=UP(e);return function(n){return gt(n)?t(n):eT}},Tre=tT,BP=function(e){return tT(function(t,n){return e(n)})},Ire=BP(D),Ore=nT,zP=function(e){return nT(function(t,n){return e(n)})},wre=zP(D),Cre=Q0,Ere={URI:Lt,bimap:H0,mapLeft:G0,map:Xn,of:qr,ap:ys,chain:Cl,alt:IP,fromIO:rp,throwError:Yv},Rre=Jt(ip),Mre=Wr(Q0),xre=function(e){return Jt(Bo)(jd(e))};function kre(e){var t=EP(e),n=RP(e);return{URI:Lt,_E:void 0,map:Xn,ap:t.ap,of:qr,chain:Cl,bimap:H0,mapLeft:G0,alt:n.alt,fromIO:rp,throwError:Yv}}const Are=Object.freeze(Object.defineProperty({__proto__:null,Alt:ore,ApT:eT,Applicative:Cre,ApplicativePar:Q0,ApplicativeSeq:nre,ApplyPar:ip,Bifunctor:Qne,Chain:zo,Do:bre,FromEither:Ko,FromIO:Jv,Functor:X0,Monad:rre,MonadIO:are,MonadThrow:ure,Pointed:Xne,URI:Lt,alt:Z0,altW:Yne,ap:J0,apFirst:xP,apFirstW:ere,apS:DP,apSW:$re,apSecond:kP,apSecondW:tre,apW:Hne,bimap:OP,bind:LP,bindTo:_re,bindW:Sre,bracket:yre,bracketW:jP,chain:Hv,chainEitherK:FP,chainEitherKW:pre,chainFirst:AP,chainFirstEitherK:PP,chainFirstEitherKW:hre,chainFirstIOK:cre,chainFirstW:ire,chainIOK:sre,chainOptionK:dre,chainW:Gv,filterOrElse:WP,filterOrElseW:vre,flap:Zne,flatten:Gne,flattenW:CP,fold:Pne,foldW:Wne,fromEither:yP,fromEitherK:gre,fromIO:rp,fromIOK:NP,fromOption:lre,fromOptionK:fre,fromPredicate:mre,getAltIOValidation:RP,getApplicativeIOValidation:EP,getApplyMonoid:Mre,getApplySemigroup:Rre,getCompactable:MP,getFilterable:Jne,getIOValidation:kre,getOrElse:SP,getOrElseW:jne,getSemigroup:xre,ioEither:Ere,left:mP,leftIO:Nne,map:Y0,mapLeft:wP,match:bP,matchE:K0,matchEW:_P,matchW:Fne,of:qr,orElse:TP,orElseFirst:V0,orElseFirstIOK:Bne,orElseFirstW:Une,orElseW:qne,orLeft:zne,right:vP,rightIO:gP,sequenceArray:Ire,sequenceSeqArray:wre,swap:Kne,throwError:Yv,toUnion:Dne,traverseArray:BP,traverseArrayWithIndex:Tre,traverseReadonlyArrayWithIndex:tT,traverseReadonlyArrayWithIndexSeq:nT,traverseReadonlyNonEmptyArrayWithIndex:qP,traverseReadonlyNonEmptyArrayWithIndexSeq:UP,traverseSeqArray:zP,traverseSeqArrayWithIndex:Ore,tryCatch:$P,tryCatchK:Lne},Symbol.toStringTag,{value:"Module"}));function op(e){return V(_t,e.of)}function ap(e){return Yn(e.of(at))}function Zv(e){return function(t){return e.map(t,_t)}}function Xv(e){return V(is,e.of)}function Qv(e){var t=Xv(e);return function(n){return V(n,t)}}function rT(e){var t=El(e),n=Qv(e);return function(r){return t(n(r))}}function eg(e){return function(t){return V(t,e.of)}}function iT(e){var t=El(e),n=eg(e);return function(r){return t(n(r))}}function oT(e){return function(t){return function(n){return e.of(Ov(t)(n))}}}function aT(e){return V(ol,e.of)}function uT(e){return function(t,n){return function(r){return e.map(r,ko(t,n))}}}function tg(e){return function(t,n){return function(r){return e.chain(r,ko(t,n))}}}function ng(e){return function(t){return function(n){return e.chain(n,ko(t,e.of))}}}function rg(e){return Rc(e,tl)}function ig(e){return To(e,nl)}function El(e){var t=ap(e);return function(n){return function(r){return e.chain(r,ko(function(){return t()},n))}}}function og(e){var t=op(e);return function(n){return function(r){return e.chain(r,ko(n,t))}}}function Nre(e){var t=ig(e),n=rg(e),r=El(e),i=og(e),o=tg(e),a=ng(e),u=ap(e);return{map:function(s,c){return y(s,n(c))},ap:function(s,c){return y(s,t(c))},of:op(e),chain:function(s,c){return y(s,r(c))},alt:function(s,c){return y(s,i(c))},fold:function(s,c,l){return y(s,o(c,l))},getOrElse:function(s,c){return y(s,a(c))},fromM:Zv(e),none:function(){return u()}}}const Fre=Object.freeze(Object.defineProperty({__proto__:null,alt:og,ap:ig,chain:El,chainNullableK:rT,chainOptionK:iT,fromEither:aT,fromF:Zv,fromNullable:Xv,fromNullableK:Qv,fromOptionK:eg,fromPredicate:oT,getOptionM:Nre,getOrElse:ng,map:rg,match:uT,matchE:tg,some:op,zero:ap},Symbol.toStringTag,{value:"Module"}));var KP=op(ro),Pre=oT(ro),Wre=fi,VP=aT(ro),sT=Zv(st),jre=no(ol),HP=uT(st),Lre=HP,cT=tg(Kv),Dre=cT,qre=cT,GP=ng(Zn),Ure=GP,Bre=no(bN),zre=no(Q$),Kre=Xv(ro),Vre=Qv(ro),Hre=rT(Zn),Gre=eg(ro),Yre=iT(Zn),YP=rg(st),JP=ig(Bo),Ha=KP,lT=El(Zn),Jre=lT(D),fT=og(Zn),Zre=fT,ag=ap(ro),Xre=ag(),dT=Zi(st,rs),pT=No(st,rs,tl),ZP=Fo(st,xo),XP=Po(st,xo),QP=Ba(st,xo),eW=za(st,xo),Vo=function(e,t){return y(e,YP(t))},Rl=function(e,t){return y(e,JP(t))},hT=function(e,t){return y(e,lT(t))},tW=function(e,t){return y(e,fT(t))},Qre=function(e,t){return y(e,ZP(t))},eie=function(e,t){return y(e,XP(t))},tie=function(e,t){return y(e,QP(t))},nie=function(e,t){return y(e,eW(t))},Qn="IOOption",mT={URI:Qn,map:Vo},rie=Ke(mT),nW={URI:Qn,of:Ha},ug={URI:Qn,map:Vo,ap:Rl},iie=Ct(ug),oie=Et(ug),aie={URI:Qn,map:Vo,ap:Rl,of:Ha},bs={URI:Qn,map:Vo,ap:Rl,chain:hT},uie=ft(bs),sie={URI:Qn,map:Vo,alt:tW},rW={URI:Qn,zero:ag},cie=Bc(rW,nW),lie={URI:Qn,map:Vo,ap:Rl,of:Ha,alt:tW,zero:ag},fie={URI:Qn,map:Vo,ap:Rl,of:Ha,chain:hT},die={URI:Qn,map:Vo,ap:Rl,of:Ha,chain:hT,fromIO:sT},pie={URI:Qn,compact:dT,separate:pT},hie={URI:Qn,map:Vo,compact:dT,separate:pT,filter:Qre,filterMap:eie,partition:tie,partitionMap:nie},sg={URI:Qn,fromIO:sT},mie=Qi(sg),vie=Wo(sg,bs),gie=jo(sg,bs),cg={URI:Qn,fromEither:VP},yie=gr(cg),bie=Co(cg,bs),_ie=Eo(cg,bs),Sie=Ha(Yt),$ie=wt(mT),Tie=Mt(bs),Iie=Rt(ug),iW=Ha(rn),oW=function(e){return V(Vv(e),no(Fv(Jn)))},Oie=function(e){var t=oW(e);return function(n){return gt(n)?t(n):iW}};const wie=Object.freeze(Object.defineProperty({__proto__:null,Alt:sie,Alternative:lie,ApT:iW,Applicative:aie,Apply:ug,Chain:bs,Compactable:pie,Do:Sie,Filterable:hie,FromEither:cg,FromIO:sg,Functor:mT,Monad:fie,MonadIO:die,Pointed:nW,Zero:rW,alt:fT,altW:Zre,ap:JP,apFirst:iie,apS:Iie,apSecond:oie,bind:Tie,bindTo:$ie,chain:lT,chainEitherK:bie,chainFirst:uie,chainFirstEitherK:_ie,chainFirstIOK:gie,chainIOK:vie,chainNullableK:Hre,chainOptionK:Yre,compact:dT,filter:ZP,filterMap:XP,flap:rie,flatten:Jre,fold:Dre,fromEither:VP,fromEitherK:yie,fromIO:sT,fromIOEither:jre,fromIOK:mie,fromNullable:Kre,fromNullableK:Vre,fromOption:Wre,fromOptionK:Gre,fromPredicate:Pre,getOrElse:GP,getOrElseW:Ure,guard:cie,map:YP,match:HP,matchE:cT,matchEW:qre,matchW:Lre,none:Xre,of:Ha,partition:QP,partitionMap:eW,separate:pT,some:KP,toNullable:zre,toUndefined:Bre,traverseReadonlyArrayWithIndex:Oie,traverseReadonlyNonEmptyArrayWithIndex:oW,zero:ag},Symbol.toStringTag,{value:"Module"}));var aW=function(){function e(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return e.prototype.write=function(t){var n=this;return function(){n.value=t}},e.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},e}();function Cie(e){return function(){return new aW(e)}}const Eie=Object.freeze(Object.defineProperty({__proto__:null,IORef:aW,newIORef:Cie},Symbol.toStringTag,{value:"Module"})),Rie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Mie=function(e){return ls(function(){return JSON.parse(e)},D)},xie=function(e){return ls(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},D)};const kie=Object.freeze(Object.defineProperty({__proto__:null,parse:Mie,stringify:xie},Symbol.toStringTag,{value:"Module"})),Aie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Nie=function(e){return new Map(e)};function Fie(e){return new Map(e)}function uW(e,t){return{show:function(n){var r=[];return n.forEach(function(i,o){r.push("[".concat(e.show(o),", ").concat(t.show(i),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var sW=function(e){return e.size},io=function(e){return e.size===0};function lg(e){var t=_s(e);return function(n,r){if(r===void 0){var i=lg(e);return function(o){return i(n,o)}}return bt(t(n,r))}}function vT(e){return function(t,n){if(n===void 0){var r=vT(e);return function(u){return r(t,u)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var Ml=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Pie=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function cW(e){var t=Ml(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}var lW=function(e){return cW(e)(function(t,n){return[t,n]})};function Wie(e,t){var n=lW(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?pe([i[a],a+1]):be})}}var fW=function(e){var t=Ho(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Wt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},dW=function(e){var t=Ho(e);return function(n){return function(r){var i=t(n,r);if(bt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},jie=function(e){var t=pW(e);return function(n,r){return t(n,function(){return r})}},pW=function(e){var t=Ho(e);return function(n,r){return function(i){var o=t(n,i);if(Wt(o))return be;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return pe(i);var l=new Map(i);return l.set(u,c),pe(l)}}};function Lie(e){var t=_s(e),n=dW(e);return function(r){var i=n(r);return function(o){return y(t(r,o),Ji(function(a){return[a,i(o)]}))}}}function Ho(e){return function(t,n){if(n===void 0){var r=Ho(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return pe([u,s])}return be}}function _s(e){var t=Ho(e);return function(n,r){if(r===void 0){var i=_s(e);return function(o){return i(n,o)}}return y(t(n,r),Ji(function(o){o[0];var a=o[1];return a}))}}function fg(e,t){var n=Ho(e);return function(r,i){if(i===void 0){var o=fg(e,t);return function(d){return o(d,r)}}for(var a=r.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,i);if(Wt(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var dg=new Map;function hW(e,t){var n=fg(e,t);return Pr(function(r,i){return n(r,i)&&n(i,r)})}function Die(e,t){var n=Ho(e);return{concat:function(r,i){if(io(r))return i;if(io(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);bt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:dg}}var qie=function(e,t){return new Map([[e,t]])};function Uie(e,t,n){return function(r){var i=Ho(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return bt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var xl=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},mW=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Gt(c)?n.set(u,c.left):r.set(u,c.right)}return Me(n,r)}};function vW(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Me(n,r)}}var gW=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);bt(s)&&n.set(a,s.value)}return n}};function yW(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Go=function(e,t){return xl(e,function(n,r){return t(r)})},up=function(e,t){return bW(e,function(n,r){return t(r)})},sp=function(e,t){return _W(e,function(n,r){return t(r)})},cp=function(e,t){return SW(e,function(n,r){return t(r)})},lp=function(e,t){return $W(e,function(n,r){return t(r)})},bW=function(e,t){return y(e,yW(t))},_W=function(e,t){return y(e,gW(t))},SW=function(e,t){return y(e,vW(t))},$W=function(e,t){return y(e,mW(t))},kl=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];bt(a)&&t.set(o,a.value)}return t},Bie=function(e){return function(t){return up(t,e)}},zie=function(e){return function(t){return sp(t,e)}},Kie=function(e){return function(t){return Go(t,e)}},Vie=function(e){return function(t){return xl(t,e)}},Hie=function(e){return function(t){return cp(t,e)}},Gie=function(e){return function(t){return lp(t,e)}},Al=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Gt(u)?t.set(a,u.left):n.set(a,u.right)}return Me(t,n)},Ur="ReadonlyMap",TW=function(e,t){var n=TT(e,t);return{concat:function(r,i){return n(i)(r)}}},Yie=function(e,t){return{concat:TW(e,t).concat,empty:dg}},Jie=function(e,t){var n=IT(e,t);return{concat:function(r,i){return n(i)(r)}}},Zie=function(e){return function(){var t=OT(e);return{concat:function(n,r){return t(r)(n)}}}};function Xie(){return{URI:Ur,_E:void 0,map:Go,mapWithIndex:xl,compact:kl,separate:Al,filter:up,filterMap:sp,partition:cp,partitionMap:lp,partitionMapWithIndex:$W,partitionWithIndex:SW,filterMapWithIndex:_W,filterWithIndex:bW}}var IW={URI:Ur,map:Go},Qie=Ke(IW),eoe=function(){return{URI:Ur,_E:void 0,map:Go,mapWithIndex:xl}},gT={URI:Ur,compact:kl,separate:Al},toe={URI:Ur,map:Go,compact:kl,separate:Al,filter:up,filterMap:sp,partition:cp,partitionMap:lp},yT=function(e){var t=hg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},bT=function(e){var t=mg(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},_T=function(e){var t=vg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},pg=function(e){var t=yT(e),n=bT(e),r=_T(e);return{URI:Ur,_E:void 0,reduce:function(i,o,a){return y(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return y(a,o(u))}},reduceRight:function(i,o,a){return y(i,r(o,a))}}},hg=function(e){var t=Ml(e);return function(n,r){return function(i){for(var o=n,a=0,u=t(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},mg=function(e){var t=Ml(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=0,u=t(i);a<u.length;a++){var s=u[a];o=n.concat(o,r(s,i.get(s)))}return o}}}},vg=function(e){var t=Ml(e);return function(n,r){return function(i){for(var o=n,a=t(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},ST=function(e){var t=pg(e),n=hg(e),r=mg(e),i=vg(e);return{URI:Ur,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return y(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return y(u,a(s))}},reduceRightWithIndex:function(o,a,u){return y(o,i(a,u))}}},noe=function(e){var t=$T(e),n=pg(e);return{URI:Ur,_E:void 0,map:Go,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},$T=function(e){var t=ST(e),n=Ml(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],m=u.get(v);c=a.ap(a.map(c,function(_){return function(g){return _.set(v,g)}}),s(v,m))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,Jn)}};return{URI:Ur,_E:void 0,map:Go,mapWithIndex:xl,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}};function roe(e){var t=$T(e);return{URI:Ur,_E:void 0,map:Go,compact:kl,separate:Al,filter:up,filterMap:sp,partition:cp,partitionMap:lp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:xl,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:oi(t,gT),wither:ai(t,gT)}}var TT=function(e,t){var n=_s(e);return function(r){return function(i){if(io(i))return r;if(io(r))return i;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);bt(f)?o.set(c,t.concat(l,f.value)):o.set(c,l)}for(var d=r.entries();!(u=d.next()).done;){var p=u.value,c=p[0],l=p[1],f=n(c)(o);Wt(f)&&o.set(c,l)}return o}}},IT=function(e,t){var n=_s(e);return function(r){return function(i){if(io(i)||io(r))return dg;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);bt(f)&&o.set(c,t.concat(l,f.value))}return o}}},OT=function(e){var t=lg(e);return function(n){return function(r){if(io(r))return n;if(io(n))return r;for(var i=new Map,o=r.entries(),a;!(a=o.next()).done;){var u=a.value,s=u[0],c=u[1];t(s)(n)||i.set(s,c)}for(var l=n.entries();!(a=l.next()).done;){var f=a.value,s=f[0],c=f[1];t(s)(r)||i.set(s,c)}return i}}},ioe=fW,ooe={URI:Ur,map:Go,compact:kl,separate:Al,filter:up,filterMap:sp,partition:cp,partitionMap:lp};const aoe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:gT,Filterable:toe,Functor:IW,URI:Ur,collect:cW,compact:kl,deleteAt:dW,difference:OT,elem:vT,empty:dg,filter:Bie,filterMap:zie,filterMapWithIndex:gW,filterWithIndex:yW,flap:Qie,foldMap:bT,foldMapWithIndex:mg,fromFoldable:Uie,fromMap:Nie,getDifferenceMagma:Zie,getEq:hW,getFilterableWithIndex:Xie,getFoldable:pg,getFoldableWithIndex:ST,getFunctorWithIndex:eoe,getIntersectionSemigroup:Jie,getMonoid:Die,getShow:uW,getTraversable:noe,getTraversableWithIndex:$T,getUnionMonoid:Yie,getUnionSemigroup:TW,getWitherable:roe,insertAt:ioe,intersection:IT,isEmpty:io,isSubmap:fg,keys:Ml,lookup:_s,lookupWithKey:Ho,map:Kie,mapWithIndex:Vie,member:lg,modifyAt:pW,partition:Hie,partitionMap:Gie,partitionMapWithIndex:mW,partitionWithIndex:vW,pop:Lie,readonlyMap:ooe,reduce:yT,reduceRight:_T,reduceRightWithIndex:vg,reduceWithIndex:hg,separate:Al,singleton:qie,size:sW,toMap:Fie,toReadonlyArray:lW,toUnfoldable:Wie,union:TT,updateAt:jie,upsertAt:fW,values:Pie},Symbol.toStringTag,{value:"Module"}));var Nl=globalThis&&globalThis.__assign||function(){return Nl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Nl.apply(this,arguments)},uoe=uW,soe=sW,Yo=io,coe=lg,loe=vT,wT=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},foe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function OW(e){var t=wT(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}function wW(e){return OW(e)(function(t,n){return[t,n]})}function doe(e,t){var n=wW(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?pe([i[a],a+1]):be})}}var CW=function(e){var t=Ss(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Wt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},EW=function(e){var t=Ss(e);return function(n){return function(r){var i=t(n,r);if(bt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},poe=function(e){var t=RW(e);return function(n,r){return t(n,function(){return r})}},RW=function(e){var t=Ss(e);return function(n,r){return function(i){var o=t(n,i);if(Wt(o))return be;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),pe(a)}}};function hoe(e){var t=MW(e),n=EW(e);return function(r){var i=n(r);return function(o){return y(t(r,o),Ji(function(a){return[a,i(o)]}))}}}function Ss(e){return function(t,n){if(n===void 0){var r=Ss(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return pe([u,s])}return be}}var MW=_s,moe=fg,voe=hW;function goe(e,t){var n=Ss(e);return{concat:function(r,i){if(Yo(r))return i;if(Yo(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);bt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var yoe=function(e,t){return new Map([[e,t]])};function boe(e,t,n){return function(r){var i=Ss(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return bt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var fp=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},xW=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Gt(c)?n.set(u,c.left):r.set(u,c.right)}return Me(n,r)}};function kW(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Me(n,r)}}var AW=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);bt(s)&&n.set(a,s.value)}return n}};function NW(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Fl=function(e,t){return fp(e,function(n,r){return t(r)})},gg=function(e,t){return FW(e,function(n,r){return t(r)})},yg=function(e,t){return PW(e,function(n,r){return t(r)})},bg=function(e,t){return WW(e,function(n,r){return t(r)})},_g=function(e,t){return jW(e,function(n,r){return t(r)})},FW=function(e,t){return y(e,NW(t))},PW=function(e,t){return y(e,AW(t))},WW=function(e,t){return y(e,kW(t))},jW=function(e,t){return y(e,xW(t))},dp=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];bt(a)&&t.set(o,a.value)}return t},_oe=function(e){return function(t){return gg(t,e)}},Soe=function(e){return function(t){return yg(t,e)}},$oe=function(e){return function(t){return Fl(t,e)}},Toe=function(e){return function(t){return fp(t,e)}},Ioe=function(e){return function(t){return bg(t,e)}},Ooe=function(e){return function(t){return _g(t,e)}},pp=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Gt(u)?t.set(a,u.left):n.set(a,u.right)}return Me(t,n)},Jo="Map",LW=function(e,t){var n=zW(e,t);return{concat:function(r,i){return n(i)(r)}}},woe=function(e,t){return{concat:LW(e,t).concat,empty:new Map}},Coe=function(e,t){var n=KW(e,t);return{concat:function(r,i){return n(i)(r)}}},Eoe=function(e){return function(){var t=VW(e);return{concat:function(n,r){return t(r)(n)}}}};function Roe(){return{URI:Jo,_E:void 0,map:Fl,mapWithIndex:fp,compact:dp,separate:pp,filter:gg,filterMap:yg,partition:bg,partitionMap:_g,partitionMapWithIndex:jW,partitionWithIndex:WW,filterMapWithIndex:PW,filterWithIndex:FW}}function Moe(e){var t=qW(e);return{URI:Jo,_E:void 0,map:Fl,compact:dp,separate:pp,filter:gg,filterMap:yg,partition:bg,partitionMap:_g,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:fp,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:oi(t,CT),wither:ai(t,CT)}}var xoe=yT,koe=bT,Aoe=_T,Noe=function(e){return Nl(Nl({},pg(e)),{URI:Jo})},Foe=hg,Poe=mg,Woe=vg,DW=function(e){return Nl(Nl({},ST(e)),{URI:Jo})},qW=function(e){var t=DW(e),n=wT(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],m=u.get(v);c=a.ap(a.map(c,function(_){return function(g){return _.set(v,g)}}),s(v,m))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,function(c,l){return l})}};return{URI:Jo,_E:void 0,map:Fl,mapWithIndex:fp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},UW={URI:Jo,map:Fl},joe=Ke(UW),CT={URI:Jo,compact:dp,separate:pp},BW={URI:Jo,map:Fl,compact:dp,separate:pp,filter:gg,filterMap:yg,partition:bg,partitionMap:_g},Sg=function(e){return new Map(e)},zW=function(e,t){var n=TT(e,t);return function(r){return function(i){return Yo(i)?Sg(r):Yo(r)?Sg(i):n(r)(i)}}},KW=function(e,t){var n=IT(e,t);return function(r){return function(i){return Yo(i)||Yo(r)?new Map:n(r)(i)}}},VW=function(e){var t=OT(e);return function(n){return function(r){return Yo(r)?Sg(n):Yo(n)?Sg(r):t(n)(r)}}},Loe=new Map,Doe=CW,qoe=BW;const Uoe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:CT,Filterable:BW,Functor:UW,URI:Jo,collect:OW,compact:dp,deleteAt:EW,difference:VW,elem:loe,empty:Loe,filter:_oe,filterMap:Soe,filterMapWithIndex:AW,filterWithIndex:NW,flap:joe,foldMap:koe,foldMapWithIndex:Poe,fromFoldable:boe,getDifferenceMagma:Eoe,getEq:voe,getFilterableWithIndex:Roe,getFoldable:Noe,getFoldableWithIndex:DW,getIntersectionSemigroup:Coe,getMonoid:goe,getShow:uoe,getTraversableWithIndex:qW,getUnionMonoid:woe,getUnionSemigroup:LW,getWitherable:Moe,insertAt:Doe,intersection:KW,isEmpty:Yo,isSubmap:moe,keys:wT,lookup:MW,lookupWithKey:Ss,map:$oe,mapWithIndex:Toe,map_:qoe,member:coe,modifyAt:RW,partition:Ioe,partitionMap:Ooe,partitionMapWithIndex:xW,partitionWithIndex:kW,pop:hoe,reduce:xoe,reduceRight:Aoe,reduceRightWithIndex:Woe,reduceWithIndex:Foe,separate:pp,singleton:yoe,size:soe,toArray:wW,toUnfoldable:doe,union:zW,updateAt:poe,upsertAt:CW,values:foe},Symbol.toStringTag,{value:"Module"})),Boe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zoe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Koe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Voe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Hoe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var HW=function(e){return{concat:dm(e).concat,empty:e.top}},GW=function(e){return{concat:pm(e).concat,empty:e.bottom}},ET=function(e){return{concat:$_(e).concat,empty:e.empty}},YW=function(e){var t={};for(var n in e)lt.call(e,n)&&(t[n]=e[n].empty);return{concat:T_(e).concat,empty:t}},JW=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:I_.apply(RM,e).concat,empty:e.map(function(n){return n.empty})}},ZW=function(e){return w_(e)(e.empty)},Goe={concat:TM.concat,empty:void 0},Yoe=JW,Joe=YW,Zoe=ET,Xoe=GW,Qoe=HW,eae=ZW,XW={concat:IM.concat,empty:!0},QW={concat:OM.concat,empty:!1},tae=JR,nae=function(){return ET(fF())},rae={concat:wM.concat,empty:""},iae={concat:CM.concat,empty:0},oae={concat:EM.concat,empty:1};const aae=Object.freeze(Object.defineProperty({__proto__:null,concatAll:ZW,fold:eae,getDualMonoid:Zoe,getEndomorphismMonoid:nae,getFunctionMonoid:tae,getJoinMonoid:Xoe,getMeetMonoid:Qoe,getStructMonoid:Joe,getTupleMonoid:Yoe,max:GW,min:HW,monoidAll:XW,monoidAny:QW,monoidProduct:oae,monoidString:rae,monoidSum:iae,monoidVoid:Goe,reverse:ET,struct:YW,tuple:JW},Symbol.toStringTag,{value:"Module"})),uae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ej=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},sae=ej,tj=function(e){return e===-1?1:e===1?-1:0},nj={equals:function(e,t){return e===t}},RT={concat:function(e,t){return e!==0?e:t}},rj={concat:RT.concat,empty:0},cae=function(e){return e<=-1?-1:e>=1?1:0},lae=tj,fae=RT,dae=nj,pae=rj;const hae=Object.freeze(Object.defineProperty({__proto__:null,Eq:nj,Monoid:rj,Semigroup:RT,eqOrdering:dae,invert:lae,match:sae,matchW:ej,monoidOrdering:pae,reverse:tj,semigroupOrdering:fae,sign:cae},Symbol.toStringTag,{value:"Module"}));var mae=function(e){return typeof e.map=="function"},vae=function(e){return typeof e.contramap=="function"},gae=function(e){return typeof e.mapWithIndex=="function"},yae=function(e){return typeof e.ap=="function"},bae=function(e){return typeof e.chain=="function"},_ae=function(e){return typeof e.bimap=="function"},Sae=function(e){return typeof e.extend=="function"},$ae=function(e){return typeof e.reduce=="function"},Tae=function(e){return typeof e.reduceWithIndex=="function"},Iae=function(e){return typeof e.alt=="function"},Oae=function(e){return typeof e.compact=="function"},wae=function(e){return typeof e.filter=="function"},Cae=function(e){return typeof e.filterWithIndex=="function"},Eae=function(e){return typeof e.promap=="function"},Rae=function(e){return typeof e.compose=="function"},Mae=function(e){return typeof e.throwError=="function"};function xae(e){var t={};if(mae(e)){var n=function(E){return function(O){return e.map(O,E)}};t.map=n}if(vae(e)){var r=function(E){return function(O){return e.contramap(O,E)}};t.contramap=r}if(gae(e)){var i=function(E){return function(O){return e.mapWithIndex(O,E)}};t.mapWithIndex=i}if(yae(e)){var o=function(E){return function(O){return e.ap(O,E)}},a=function(E){return function(O){return e.ap(e.map(O,function(F){return function(){return F}}),E)}};t.ap=o,t.apFirst=a,t.apSecond=function(E){return function(O){return e.ap(e.map(O,function(){return function(F){return F}}),E)}}}if(bae(e)){var u=function(E){return function(O){return e.chain(O,E)}},s=function(E){return function(O){return e.chain(O,function(F){return e.map(E(F),function(){return F})})}},c=function(E){return e.chain(E,D)};t.chain=u,t.chainFirst=s,t.flatten=c}if(_ae(e)){var l=function(E,O){return function(F){return e.bimap(F,E,O)}},f=function(E){return function(O){return e.mapLeft(O,E)}};t.bimap=l,t.mapLeft=f}if(Sae(e)){var d=function(E){return function(O){return e.extend(O,E)}},p=function(E){return e.extend(E,D)};t.extend=d,t.duplicate=p}if($ae(e)){var h=function(E,O){return function(F){return e.reduce(F,E,O)}},v=function(E){var O=e.foldMap(E);return function(F){return function(j){return O(j,F)}}},m=function(E,O){return function(F){return e.reduceRight(F,E,O)}};t.reduce=h,t.foldMap=v,t.reduceRight=m}if(Tae(e)){var _=function(E,O){return function(F){return e.reduceWithIndex(F,E,O)}},g=function(E){var O=e.foldMapWithIndex(E);return function(F){return function(j){return O(j,F)}}},S=function(E,O){return function(F){return e.reduceRightWithIndex(F,E,O)}};t.reduceWithIndex=_,t.foldMapWithIndex=g,t.reduceRightWithIndex=S}if(Iae(e)){var b=function(E){return function(O){return e.alt(O,E)}};t.alt=b}if(Oae(e)&&(t.compact=e.compact,t.separate=e.separate),wae(e)){var $=function(E){return function(O){return e.filter(O,E)}},T=function(E){return function(O){return e.filterMap(O,E)}},M=function(E){return function(O){return e.partition(O,E)}},R=function(E){return function(O){return e.partitionMap(O,E)}};t.filter=$,t.filterMap=T,t.partition=M,t.partitionMap=R}if(Cae(e)){var q=function(E){return function(O){return e.filterWithIndex(O,E)}},Y=function(E){return function(O){return e.filterMapWithIndex(O,E)}},N=function(E){return function(O){return e.partitionWithIndex(O,E)}},Z=function(E){return function(O){return e.partitionMapWithIndex(O,E)}};t.filterWithIndex=q,t.filterMapWithIndex=Y,t.partitionWithIndex=N,t.partitionMapWithIndex=Z}if(Eae(e)){var ie=function(E,O){return function(F){return e.promap(F,E,O)}};t.promap=ie}if(Rae(e)){var J=function(E){return function(O){return e.compose(O,E)}};t.compose=J}if(Mae(e)){var ye=function(E){return function(O){return O._tag==="None"?e.throwError(E()):e.of(O.value)}},we=function(E){return E._tag==="Left"?e.throwError(E.left):e.of(E.right)},x=function(E,O){return function(F){return E(F)?e.of(F):e.throwError(O(F))}},k=function(E,O){return function(F){return e.chain(F,function(j){return E(j)?e.of(j):e.throwError(O(j))})}};t.fromOption=ye,t.fromEither=we,t.fromPredicate=x,t.filterOrElse=k}return t}var de=y;const kae=Object.freeze(Object.defineProperty({__proto__:null,pipe:de,pipeable:xae},Symbol.toStringTag,{value:"Module"})),Aae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Nae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var $g=function(){return Math.random()};function ij(e,t){return y($g,no(function(n){return Math.floor((t-e+1)*n+e)}))}function Fae(e,t){return y($g,no(function(n){return(t-e)*n+e}))}var Pae=y($g,no(function(e){return e<.5})),Wae=function(e){return y(ij(0,e.length-1),no(function(t){return e[t]}))};const jae=Object.freeze(Object.defineProperty({__proto__:null,random:$g,randomBool:Pae,randomElem:Wae,randomInt:ij,randomRange:Fae},Symbol.toStringTag,{value:"Module"}));var MT=fl(O0),oj=fs(O0),aj=dl(sn),Lae=pl(sn),uj=eo,sj=aj,cj=zd(sn),Dae=cj,xT=bl(qo),qae=xT,lj=xT,Uae=lj,fj=_l(qo),Bae=fj,zae=Hd(sn),Kae=Gd,dj=Yd,Vae=dj,pj=ps(qo),Hae=pj,hj=Kd(qo),Gae=hj,Yae=Vd(qo),Jae=Sl(sn),Br=function(e,t){return y(e,vj(t))},kT=function(e,t,n){return y(e,gj(t,n))},AT=function(e,t){return y(e,yj(t))},Pl=function(e,t){return y(e,NT(t))},hp=function(e,t){return y(e,FT(t))},mj=function(e,t){return y(e,PT(t))},vj=hl(sn),gj=gl(sn),yj=yl(sn),NT=ml(Do),Zae=NT,oo=oj,FT=ds(qo),bj=FT,_j=bj(D),Xae=_j,PT=vl(qo),Qae=PT,WT=MT,Zt="ReaderEither",Sj=function(e){var t=ss(e);return{URI:Zt,_E:void 0,compact:Zi(sn,t),separate:No(sn,t,qa)}};function eue(e){var t=sl(e),n=Sj(e),r=Fo(sn,t),i=Po(sn,t),o=Ba(sn,t),a=za(sn,t);return{URI:Zt,_E:void 0,map:Br,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}function $j(e){var t=To(Do,Da(e));return{URI:Zt,_E:void 0,map:Br,ap:function(n,r){return y(n,t(r))},of:oo}}function Tj(e){var t=Bd(qo,e);return{URI:Zt,_E:void 0,map:Br,alt:function(n,r){return y(n,t(r))}}}var jT={URI:Zt,map:Br},tue=Ke(jT),nue={URI:Zt,of:oo},mp={URI:Zt,map:Br,ap:Pl},Ij=Ct(mp),rue=Ij,Oj=Et(mp),iue=Oj,wj={URI:Zt,map:Br,ap:Pl,of:oo},Zo={URI:Zt,map:Br,ap:Pl,chain:hp},oue={URI:Zt,map:Br,ap:Pl,of:oo,chain:hp},Cj=ft(Zo),aue=Cj,uue={URI:Zt,bimap:kT,mapLeft:AT},sue={URI:Zt,map:Br,alt:mj},Wl={URI:Zt,fromReader:sj},cue=Zd(Wl),lue=Xd(Wl),fue=vs(Wl),Ej=Qd(Wl,Zo),due=Ej,Rj=ep(Wl,Zo),pue=Rj,hue={URI:Zt,map:Br,ap:Pl,of:oo,chain:hp,throwError:WT},Xo={URI:Zt,fromEither:uj},mue=Hi(Xo),vue=Gi(Xo),gue=Ju(Xo,Zo),Mj=Co(Xo,Zo),yue=Mj,xj=Eo(Xo,Zo),bue=xj,_ue=Na(Xo),kj=Zu(Xo,Zo),Sue=kj,$ue=gr(Xo),Tue=oo(Yt),Iue=wt(jT),Aj=Mt(Zo),Oue=Aj,Nj=Rt(mp),wue=Nj,Fj=oo(rn),Pj=function(e){return V(ms(e),hs(Ud(Jn)))},LT=function(e){var t=Pj(e);return function(n){return gt(n)?t(n):Fj}},Cue=LT,Wj=function(e){return LT(function(t,n){return e(n)})},Eue=Wj(D),Rue={URI:Zt,bimap:kT,mapLeft:AT,map:Br,of:oo,ap:Pl,chain:hp,alt:mj,throwError:MT},Mue=Jt(mp),xue=Wr(wj),kue=function(e){return Jt(Do)(jd(e))};function Aue(e){var t=$j(e),n=Tj(e);return{URI:Zt,_E:void 0,map:Br,ap:t.ap,of:oo,chain:hp,bimap:kT,mapLeft:AT,alt:n.alt,throwError:WT}}const Nue=Object.freeze(Object.defineProperty({__proto__:null,Alt:sue,ApT:Fj,Applicative:wj,Apply:mp,Bifunctor:uue,Chain:Zo,Do:Tue,FromEither:Xo,FromReader:Wl,Functor:jT,Monad:oue,MonadThrow:hue,Pointed:nue,URI:Zt,alt:PT,altW:Qae,ap:NT,apFirst:Ij,apFirstW:rue,apS:Nj,apSW:wue,apSecond:Oj,apSecondW:iue,apW:Zae,ask:cue,asks:lue,asksReaderEither:Vae,asksReaderEitherW:dj,bimap:gj,bind:Aj,bindTo:Iue,bindW:Oue,chain:FT,chainEitherK:Mj,chainEitherKW:yue,chainFirst:Cj,chainFirstEitherK:xj,chainFirstEitherKW:bue,chainFirstReaderK:Rj,chainFirstReaderKW:pue,chainFirstW:aue,chainOptionK:gue,chainReaderK:Ej,chainReaderKW:due,chainW:bj,filterOrElse:kj,filterOrElseW:Sue,flap:tue,flatten:Xae,flattenW:_j,fold:qae,foldW:Uae,fromEither:uj,fromEitherK:$ue,fromOption:mue,fromOptionK:vue,fromPredicate:_ue,fromReader:sj,fromReaderK:fue,getAltReaderValidation:Tj,getApplicativeReaderValidation:$j,getApplyMonoid:xue,getApplySemigroup:Mue,getCompactable:Sj,getFilterable:eue,getOrElse:fj,getOrElseW:Bae,getReaderValidation:Aue,getSemigroup:kue,left:MT,leftReader:Lae,local:Kae,map:vj,mapLeft:yj,match:cj,matchE:xT,matchEW:lj,matchW:Dae,of:oo,orElse:pj,orElseFirst:hj,orElseFirstW:Gae,orElseW:Hae,orLeft:Yae,readerEither:Rue,right:oj,rightReader:aj,sequenceArray:Eue,swap:Jae,throwError:WT,toUnion:zae,traverseArray:Wj,traverseArrayWithIndex:Cue,traverseReadonlyArrayWithIndex:LT,traverseReadonlyNonEmptyArrayWithIndex:Pj},Symbol.toStringTag,{value:"Module"}));function DT(e){return function(t){return function(){return e.of(t)}}}function qT(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function UT(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function BT(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function zT(e){return function(t){return V(t,e.of)}}function Fue(e){return function(t){return V(t,e)}}function Pue(e){var t=UT(e),n=qT(e),r=BT(e);return{map:function(i,o){return y(i,n(o))},ap:function(i,o){return y(i,t(o))},of:DT(e),chain:function(i,o){return y(i,r(o))},ask:function(){return e.of},asks:function(i){return V(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:zT(e),fromM:function(i){return function(){return i}}}}const Wue=Object.freeze(Object.defineProperty({__proto__:null,ap:UT,chain:BT,fromNaturalTransformation:Fue,fromReader:zT,getReaderM:Pue,map:qT,of:DT},Symbol.toStringTag,{value:"Module"}));var Fn=function(e){return function(){return Promise.resolve().then(e)}};function jue(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var pi=function(e,t){return y(e,Ga(t))},$s=function(e,t){return y(e,jj(t))},KT=function(e,t){return y(e,vp(function(n){return y(t,Ga(n))}))},jl=function(e,t){return y(e,vp(t))},Ga=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},jj=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},In=function(e){return function(){return Promise.resolve(e)}},vp=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},Lue=vp(D),Pn="Task";function Due(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:Dj}}var De={URI:Pn,map:pi},que=Ke(De),cn={URI:Pn,of:In},Ts={URI:Pn,map:pi,ap:$s},Uue=Ct(Ts),Bue=Et(Ts),gp={URI:Pn,map:pi,ap:$s,of:In},Tg={URI:Pn,map:pi,ap:KT},Lj={URI:Pn,map:pi,ap:KT,of:In},Ll={URI:Pn,map:pi,ap:$s,chain:jl},Xt={URI:Pn,map:pi,of:In,ap:$s,chain:jl},zue={URI:Pn,map:pi,of:In,ap:$s,chain:jl,fromIO:Fn},yp=D,Kue={URI:Pn,map:pi,of:In,ap:$s,chain:jl,fromIO:Fn,fromTask:yp},Vue=ft(Ll),Ig={URI:Pn,fromIO:Fn},Hue=Qi(Ig),Gue=Wo(Ig,Ll),Yue=jo(Ig,Ll),Jue={URI:Pn,fromIO:Fn,fromTask:yp},Dj=function(){return new Promise(function(e){})},Zue=In(Yt),Xue=wt(De),Que=Mt(Ll),ese=Rt(Ts),VT=In(rn),Dl=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},HT=function(e){var t=Dl(e);return function(n){return gt(n)?t(n):VT}},GT=function(e){return function(t){return function(){return xc(t).reduce(function(n,r,i){return n.then(function(o){return Promise.resolve().then(e(i+1,r)).then(function(a){return o.push(a),o})})},Promise.resolve().then(e(0,dr(t))).then(Yf))}}},YT=function(e){var t=GT(e);return function(n){return gt(n)?t(n):VT}},tse=HT,qj=function(e){return HT(function(t,n){return e(n)})},nse=qj(D),rse=YT,Uj=function(e){return YT(function(t,n){return e(n)})},ise=Uj(D),ose={URI:Pn,map:pi,of:In,ap:$s,chain:jl,fromIO:Fn,fromTask:yp},ase={URI:Pn,map:pi,of:In,ap:KT,chain:jl,fromIO:Fn,fromTask:yp},use=Jt(Tg),sse=Wr(Lj);const cse=Object.freeze(Object.defineProperty({__proto__:null,ApT:VT,ApplicativePar:gp,ApplicativeSeq:Lj,ApplyPar:Ts,ApplySeq:Tg,Chain:Ll,Do:Zue,FromIO:Ig,FromTask:Jue,Functor:De,Monad:Xt,MonadIO:zue,MonadTask:Kue,Pointed:cn,URI:Pn,ap:jj,apFirst:Uue,apS:ese,apSecond:Bue,bind:Que,bindTo:Xue,chain:vp,chainFirst:Vue,chainFirstIOK:Yue,chainIOK:Gue,delay:jue,flap:que,flatten:Lue,fromIO:Fn,fromIOK:Hue,fromTask:yp,getMonoid:sse,getRaceMonoid:Due,getSemigroup:use,map:Ga,never:Dj,of:In,sequenceArray:nse,sequenceSeqArray:ise,task:ose,taskSeq:ase,traverseArray:qj,traverseArrayWithIndex:tse,traverseReadonlyArrayWithIndex:HT,traverseReadonlyArrayWithIndexSeq:YT,traverseReadonlyNonEmptyArrayWithIndex:Dl,traverseReadonlyNonEmptyArrayWithIndexSeq:GT,traverseSeqArray:Uj,traverseSeqArrayWithIndex:rse},Symbol.toStringTag,{value:"Module"}));var Bj=zT(cn),ql=eo,Is=V(Fn,ql),lse=Gd,zj=Yd,fse=zj,hi=function(e,t){return y(e,ZT(t))},Os=function(e,t){return y(e,XT(t))},JT=function(e,t){return y(e,Og(function(n){return y(t,ZT(n))}))},Ul=function(e,t){return y(e,Og(t))},ZT=qT(De),XT=UT(Ts),dse=XT,zr=DT(cn),Og=BT(Xt),Kj=Og,Vj=Kj(D),pse=Vj,On="ReaderTask",ln={URI:On,map:hi},hse=Ke(ln),bp={URI:On,of:zr},_p={URI:On,map:hi,ap:Os},mse=Ct(_p),vse=Et(_p),gse={URI:On,map:hi,ap:Os,of:zr},QT={URI:On,map:hi,ap:JT},Hj={URI:On,map:hi,ap:JT,of:zr},ao={URI:On,map:hi,ap:Os,chain:Ul},Qo={URI:On,map:hi,of:zr,ap:Os,chain:Ul},yse={URI:On,map:hi,of:zr,ap:Os,chain:Ul,fromIO:Is},bse={URI:On,map:hi,of:zr,ap:Os,chain:Ul,fromIO:Is,fromTask:ql},Gj=ft(ao),_se=Gj,wg={URI:On,fromIO:Is},Sse=Qi(wg),$se=Wo(wg,ao),Tse=jo(wg,ao),Bl={URI:On,fromReader:Bj},Ise=Zd(Bl),Ose=Xd(Bl),wse=vs(Bl),Yj=Qd(Bl,ao),Cse=Yj,Jj=ep(Bl,ao),Ese=Jj,Cg={URI:On,fromIO:Is,fromTask:ql},Rse=gs(Cg),Mse=$l(Cg,ao),xse=Tl(Cg,ao),kse=zr(Yt),Ase=wt(ln),Zj=Mt(ao),Nse=Zj,Xj=Rt(_p),Fse=Xj,eI=zr(rn),Qj=function(e){return V(ms(e),hs(Dl(Jn)))},tI=function(e){var t=Qj(e);return function(n){return gt(n)?t(n):eI}},eL=function(e){return V(ms(e),hs(GT(Jn)))},nI=function(e){var t=eL(e);return function(n){return gt(n)?t(n):eI}},Pse=tI,tL=function(e){return tI(function(t,n){return e(n)})},Wse=tL(D),jse=nI,nL=function(e){return nI(function(t,n){return e(n)})},Lse=nL(D),Dse={URI:On,map:hi,of:zr,ap:Os,chain:Ul,fromIO:Is,fromTask:ql},qse={URI:On,map:hi,of:zr,ap:JT,chain:Ul,fromIO:Is,fromTask:ql},Use=Jt(QT),Bse=Wr(Hj);function zse(e,t){return e(t)()}const Kse=Object.freeze(Object.defineProperty({__proto__:null,ApT:eI,ApplicativePar:gse,ApplicativeSeq:Hj,ApplyPar:_p,ApplySeq:QT,Chain:ao,Do:kse,FromIO:wg,FromReader:Bl,FromTask:Cg,Functor:ln,Monad:Qo,MonadIO:yse,MonadTask:bse,Pointed:bp,URI:On,ap:XT,apFirst:mse,apS:Xj,apSW:Fse,apSecond:vse,apW:dse,ask:Ise,asks:Ose,asksReaderTask:fse,asksReaderTaskW:zj,bind:Zj,bindTo:Ase,bindW:Nse,chain:Og,chainFirst:Gj,chainFirstIOK:Tse,chainFirstReaderK:Jj,chainFirstReaderKW:Ese,chainFirstTaskK:xse,chainFirstW:_se,chainIOK:$se,chainReaderK:Yj,chainReaderKW:Cse,chainTaskK:Mse,chainW:Kj,flap:hse,flatten:pse,flattenW:Vj,fromIO:Is,fromIOK:Sse,fromReader:Bj,fromReaderK:wse,fromTask:ql,fromTaskK:Rse,getMonoid:Bse,getSemigroup:Use,local:lse,map:ZT,of:zr,readerTask:Dse,readerTaskSeq:qse,run:zse,sequenceArray:Wse,sequenceSeqArray:Lse,traverseArray:tL,traverseArrayWithIndex:Pse,traverseReadonlyArrayWithIndex:tI,traverseReadonlyArrayWithIndexSeq:nI,traverseReadonlyNonEmptyArrayWithIndex:Qj,traverseReadonlyNonEmptyArrayWithIndexSeq:eL,traverseSeqArray:nL,traverseSeqArrayWithIndex:jse},Symbol.toStringTag,{value:"Module"}));var Vse=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},Hse=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},rI=fl(cn),iI=fs(cn),Eg=dl(De),oI=pl(De),aI=V(Fn,Eg),rL=V(Fn,oI),Ya=aI,zl=Eg,uI=In,sI=Fn,iL=function(e){return Ga(VN(e))},oL=zd(De),Gse=oL,cI=bl(Xt),Yse=cI,aL=cI,Jse=aL,uL=_l(Xt),Zse=uL,sL=function(e,t){return function(){return Vse(void 0,void 0,void 0,function(){var n;return Hse(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(xa)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,$o(t(n))];case 3:return[2]}})})}},Xse=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return sL(function(){return e.apply(void 0,n)},t)}},Qse=Hd(De),ece=jv(cn),tce=Lv(cn),nce=v0(Xt),cL=ps(Xt),rce=cL,Rg=Kd(Xt),ice=Rg,oce=function(e){return Rg(CL(e))},ace=function(e){return Rg(EL(e))},uce=Vd(Xt),sce=Sl(De),lL=function(e){var t=iL(e);return function(n){return V(n,t)}},fL=function(e){return function(t){return function(n){return y(n,Sp(lL(e)(t)))}}},cce=fL,dL=function(e){return V(e,sI)},pL=function(e){return $p(dL(e))},lce=pL,fn=function(e,t){return y(e,dI(t))},Ja=function(e,t){return y(e,pI(t))},lI=function(e,t){return y(e,Sp(function(n){return y(t,dI(n))}))},Za=function(e,t){return y(e,Sp(t))},Mg=function(e,t,n){return y(e,hL(t,n))},xg=function(e,t){return y(e,mL(t))},fI=function(e,t){return y(e,hI(t))},dI=hl(De),hL=gl(De),mL=yl(De),pI=ml(Ts),fce=pI,Sp=ds(Xt),$p=Sp,vL=$p(D),dce=vL,hI=vl(Xt),pce=hI,er=iI,Tp=rI,yt="TaskEither";function mI(e,t){var n=To(e,Da(t));return{URI:yt,_E:void 0,map:fn,ap:function(r,i){return y(r,n(i))},of:er}}function gL(e){var t=Bd(Xt,e);return{URI:yt,_E:void 0,map:fn,alt:function(n,r){return y(n,t(r))}}}var yL=function(e){var t=ss(e);return{URI:yt,_E:void 0,compact:Zi(De,t),separate:No(De,t,qa)}};function hce(e){var t=sl(e),n=yL(e),r=Fo(De,t),i=Po(De,t),o=Ba(De,t),a=za(De,t);return{URI:yt,_E:void 0,map:fn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}var vI={URI:yt,map:fn},mce=Ke(vI),vce={URI:yt,of:er},kg={URI:yt,map:fn,ap:Ja},bL=Ct(kg),gce=bL,_L=Et(kg),yce=_L,bce={URI:yt,map:fn,ap:Ja,of:er},SL={URI:yt,map:fn,ap:lI},$L={URI:yt,map:fn,ap:lI,of:er},mi={URI:yt,map:fn,ap:Ja,chain:Za},_ce={URI:yt,map:fn,ap:Ja,chain:Za,of:er},Sce={URI:yt,map:fn,ap:Ja,chain:Za,of:er,fromIO:Ya},$ce={URI:yt,map:fn,ap:Ja,chain:Za,of:er,fromIO:Ya,fromTask:zl},Tce={URI:yt,map:fn,ap:Ja,chain:Za,of:er,throwError:Tp},TL=ft(mi),Ice=TL,Oce={URI:yt,bimap:Mg,mapLeft:xg},wce={URI:yt,map:fn,alt:fI},ea={URI:yt,fromEither:uI},Cce=Hi(ea),Ece=Gi(ea),Rce=Ju(ea,mi),IL=Co(ea,mi),Mce=IL,OL=Eo(ea,mi),xce=OL,kce=Na(ea),wL=Zu(ea,mi),Ace=wL,Nce=gr(ea),Ag={URI:yt,fromIO:Ya},CL=Qi(Ag),Fce=Wo(Ag,mi),Pce=jo(Ag,mi),Ng={URI:yt,fromIO:Ya,fromTask:zl},EL=gs(Ng),Wce=$l(Ng,mi),jce=Tl(Ng,mi);function Lce(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){var r=function(i,o){return i!=null?n($o(i)):n(xa(o))};e.apply(null,t.concat(r))})}}}var Dce=function(e,t,n){return gI(e,t,n)},gI=function(e,t,n){return y(e,$p(function(r){return y(t(r),vp(function(i){return y(n(r,i),$p(function(){return In(i)}))}))}))},qce=er(Yt),Uce=wt(vI),RL=Mt(mi),Bce=RL,ML=Rt(kg),zce=ML,yI=er(rn),bI=function(e){return V(Dl(e),Ga(Ud(Jn)))},_I=function(e){var t=bI(e);return function(n){return gt(n)?t(n):yI}},SI=function(e){return function(t){return function(){return xc(t).reduce(function(n,r,i){return n.then(function(o){return Gt(o)?n:e(i+1,r)().then(function(a){return Gt(a)?a:(o.right.push(a.right),o)})})},e(0,dr(t))().then(cs(Yf)))}}},$I=function(e){var t=SI(e);return function(n){return gt(n)?t(n):yI}},Kce=_I,xL=function(e){return _I(function(t,n){return e(n)})},Vce=xL(D),Hce=$I,kL=function(e){return $I(function(t,n){return e(n)})},Gce=kL(D),Yce={URI:yt,bimap:Mg,mapLeft:xg,map:fn,of:er,ap:Ja,chain:Za,alt:fI,fromIO:Ya,fromTask:zl,throwError:Tp},Jce={URI:yt,bimap:Mg,mapLeft:xg,map:fn,of:er,ap:lI,chain:Za,alt:fI,fromIO:Ya,fromTask:zl,throwError:Tp},Zce=Jt(SL),Xce=Wr($L),Qce=function(e){return Jt(Tg)(jd(e))};function ele(e){var t=mI(gp,e),n=gL(e);return{URI:yt,_E:void 0,map:fn,ap:t.ap,of:er,chain:Za,bimap:Mg,mapLeft:xg,alt:n.alt,fromIO:Ya,fromTask:zl,throwError:Tp}}const tle=Object.freeze(Object.defineProperty({__proto__:null,Alt:wce,ApT:yI,ApplicativePar:bce,ApplicativeSeq:$L,ApplyPar:kg,ApplySeq:SL,Bifunctor:Oce,Chain:mi,Do:qce,FromEither:ea,FromIO:Ag,FromTask:Ng,Functor:vI,Monad:_ce,MonadIO:Sce,MonadTask:$ce,MonadThrow:Tce,Pointed:vce,URI:yt,alt:hI,altW:pce,ap:pI,apFirst:bL,apFirstW:gce,apS:ML,apSW:zce,apSecond:_L,apSecondW:yce,apW:fce,bimap:hL,bind:RL,bindTo:Uce,bindW:Bce,bracket:Dce,bracketW:gI,chain:Sp,chainEitherK:IL,chainEitherKW:Mce,chainFirst:TL,chainFirstEitherK:OL,chainFirstEitherKW:xce,chainFirstIOK:Pce,chainFirstTaskK:jce,chainFirstW:Ice,chainIOEitherK:lce,chainIOEitherKW:pL,chainIOK:Fce,chainNullableK:nce,chainOptionK:Rce,chainTaskK:Wce,chainTaskOptionK:cce,chainTaskOptionKW:fL,chainW:$p,filterOrElse:wL,filterOrElseW:Ace,flap:mce,flatten:dce,flattenW:vL,fold:Yse,foldW:Jse,fromEither:uI,fromEitherK:Nce,fromIO:Ya,fromIOEither:sI,fromIOEitherK:dL,fromIOK:CL,fromNullable:ece,fromNullableK:tce,fromOption:Cce,fromOptionK:Ece,fromPredicate:kce,fromTask:zl,fromTaskK:EL,fromTaskOption:iL,fromTaskOptionK:lL,getAltTaskValidation:gL,getApplicativeTaskValidation:mI,getApplyMonoid:Xce,getApplySemigroup:Zce,getCompactable:yL,getFilterable:hce,getOrElse:uL,getOrElseW:Zse,getSemigroup:Qce,getTaskValidation:ele,left:rI,leftIO:rL,leftTask:oI,map:dI,mapLeft:mL,match:oL,matchE:cI,matchEW:aL,matchW:Gse,of:er,orElse:cL,orElseFirst:Rg,orElseFirstIOK:oce,orElseFirstTaskK:ace,orElseFirstW:ice,orElseW:rce,orLeft:uce,right:iI,rightIO:aI,rightTask:Eg,sequenceArray:Vce,sequenceSeqArray:Gce,swap:sce,taskEither:Yce,taskEitherSeq:Jce,taskify:Lce,throwError:Tp,toUnion:Qse,traverseArray:xL,traverseArrayWithIndex:Kce,traverseReadonlyArrayWithIndex:_I,traverseReadonlyArrayWithIndexSeq:$I,traverseReadonlyNonEmptyArrayWithIndex:bI,traverseReadonlyNonEmptyArrayWithIndexSeq:SI,traverseSeqArray:kL,traverseSeqArrayWithIndex:Hce,tryCatch:sL,tryCatchK:Xse},Symbol.toStringTag,{value:"Module"}));var Xa=eo,Fg=fl(bp),TI=fs(bp),II=V(Eg,Xa),AL=V(oI,Xa),OI=function(e){return V(e,iI)},NL=function(e){return V(e,rI)},FL=dl(ln),nle=pl(ln),wI=V(aI,Xa),PL=V(rL,Xa),WL=zr,jL=OI,Qa=wI,Kl=II,CI=V(sI,Xa),EI=function(e){return V(e,uI)},LL=zd(ln),rle=LL,RI=bl(ao),ile=RI,DL=RI,ole=DL,qL=_l(Qo),ale=qL,ule=Hd(ln),sle=jv(bp),cle=Lv(bp),lle=v0(Qo),fle=Gd,UL=Yd,dle=UL,BL=ps(Qo),ple=BL,zL=Kd(Qo),hle=zL,mle=Vd(Qo),vle=Sl(ln),KL=function(e){return V(e,CI)},VL=function(e){return Vl(KL(e))},gle=VL,MI=function(e){return V(e,Xa)},HL=function(e){return Vl(MI(e))},yle=HL,GL=function(e){return qg(MI(e))},ble=GL,xI=function(e){return V(e,EI)},YL=function(e){return Vl(xI(e))},_le=YL,JL=function(e){return qg(xI(e))},Sle=JL,dn=function(e,t){return y(e,Ip(t))},eu=function(e,t){return y(e,PI(t))},kI=function(e,t){return y(e,jg(function(n){return y(t,Ip(n))}))},tu=function(e,t){return y(e,jg(t))},AI=function(e,t){return y(e,Lg(t))},Pg=function(e,t,n){return y(e,NI(t,n))},Wg=function(e,t){return y(e,FI(t))},Ip=hl(ln),NI=gl(ln),FI=yl(ln),PI=ml(_p),$le=PI,tr=TI,jg=ds(Qo),Vl=jg,ZL=Vl(D),Tle=ZL,Lg=vl(Qo),XL=Lg,Op=Fg,ht="ReaderTaskEither",QL=function(e){var t=ss(e);return{URI:ht,_E:void 0,compact:Zi(ln,t),separate:No(ln,t,qa)}};function Ile(e){var t=sl(e),n=QL(e),r=Fo(ln,t),i=Po(ln,t),o=Ba(ln,t),a=za(ln,t);return{URI:ht,_E:void 0,map:dn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}function eD(e,t){var n=To(Do,mI(e,t));return{URI:ht,_E:void 0,map:dn,ap:function(r,i){return y(r,n(i))},of:tr}}function tD(e){var t=Bd(Qo,e);return{URI:ht,_E:void 0,map:dn,alt:function(n,r){return y(n,t(r))}}}var ws={URI:ht,map:dn},Ole=Ke(ws),WI={URI:ht,of:tr},Dg={URI:ht,map:dn,ap:eu},nD=Ct(Dg),wle=nD,rD=Et(Dg),Cle=rD,Ele={URI:ht,map:dn,ap:eu,of:tr},iD={URI:ht,map:dn,ap:kI},oD={URI:ht,map:dn,ap:kI,of:tr},Wn={URI:ht,map:dn,ap:eu,chain:tu},Rle={URI:ht,map:dn,ap:eu,chain:tu,of:tr},Mle={URI:ht,map:dn,ap:eu,chain:tu,of:tr,fromIO:Qa},xle={URI:ht,map:dn,ap:eu,chain:tu,of:tr,fromIO:Qa,fromTask:Kl},kle={URI:ht,map:dn,ap:eu,chain:tu,of:tr,throwError:Op},aD=ft(Wn),qg=aD,Ale={URI:ht,bimap:Pg,mapLeft:Wg},Nle={URI:ht,map:dn,alt:AI},Hl={URI:ht,fromReader:jL},Fle=Zd(Hl),Ple=Xd(Hl),Wle=vs(Hl),uD=Qd(Hl,Wn),jle=uD,sD=ep(Hl,Wn),Lle=sD,jI=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return FL(e.apply(void 0,t))}},cD=function(e){return Vl(jI(e))},Dle=cD,lD=function(e){return qg(jI(e))},qle=lD,ta={URI:ht,fromEither:WL},Ule=Hi(ta),Ble=Gi(ta),zle=Ju(ta,Wn),fD=Co(ta,Wn),Kle=fD,dD=Eo(ta,Wn),Vle=dD,Hle=Na(ta),pD=Zu(ta,Wn),Gle=pD,Yle=gr(ta),Ug={URI:ht,fromIO:Qa},Jle=Qi(Ug),Zle=Wo(Ug,Wn),Xle=jo(Ug,Wn),Bg={URI:ht,fromIO:Qa,fromTask:Kl},Qle=gs(Bg),efe=$l(Bg,Wn),tfe=Tl(Bg,Wn);function nfe(e,t,n){return hD(e,t,n)}function hD(e,t,n){return function(r){return gI(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var rfe=tr(Yt),ife=wt(ws),mD=Mt(Wn),ofe=mD,vD=Rt(Dg),afe=vD,LI=tr(rn),gD=function(e){return V(ms(e),hs(bI(Jn)))},DI=function(e){var t=gD(e);return function(n){return gt(n)?t(n):LI}},yD=function(e){return V(ms(e),hs(SI(Jn)))},qI=function(e){var t=yD(e);return function(n){return gt(n)?t(n):LI}},ufe=DI,bD=function(e){return DI(function(t,n){return e(n)})},sfe=bD(D),cfe=qI,_D=function(e){return qI(function(t,n){return e(n)})},lfe=_D(D),ffe={URI:ht,map:dn,of:tr,ap:eu,chain:tu,alt:AI,bimap:Pg,mapLeft:Wg,fromIO:Qa,fromTask:Kl,throwError:Op},dfe={URI:ht,map:dn,of:tr,ap:kI,chain:tu,alt:AI,bimap:Pg,mapLeft:Wg,fromIO:Qa,fromTask:Kl,throwError:Op},pfe=Jt(iD),hfe=Wr(oD),mfe=function(e){return Jt(QT)(jd(e))};function vfe(e){var t=eD(gp,e),n=tD(e);return{URI:ht,_E:void 0,map:dn,of:tr,chain:tu,bimap:Pg,mapLeft:Wg,ap:t.ap,alt:n.alt,fromIO:Qa,fromTask:Kl,throwError:Op}}function gfe(e,t){return e(t)()}const yfe=Object.freeze(Object.defineProperty({__proto__:null,Alt:Nle,ApT:LI,ApplicativePar:Ele,ApplicativeSeq:oD,ApplyPar:Dg,ApplySeq:iD,Bifunctor:Ale,Chain:Wn,Do:rfe,FromEither:ta,FromIO:Ug,FromReader:Hl,FromTask:Bg,Functor:ws,Monad:Rle,MonadIO:Mle,MonadTask:xle,MonadThrow:kle,Pointed:WI,URI:ht,alt:Lg,altW:XL,ap:PI,apFirst:nD,apFirstW:wle,apS:vD,apSW:afe,apSecond:rD,apSecondW:Cle,apW:$le,ask:Fle,asks:Ple,asksReaderTaskEither:dle,asksReaderTaskEitherW:UL,bimap:NI,bind:mD,bindTo:ife,bindW:ofe,bracket:nfe,bracketW:hD,chain:jg,chainEitherK:fD,chainEitherKW:Kle,chainFirst:aD,chainFirstEitherK:dD,chainFirstEitherKW:Vle,chainFirstIOK:Xle,chainFirstReaderEitherK:Sle,chainFirstReaderEitherKW:JL,chainFirstReaderK:sD,chainFirstReaderKW:Lle,chainFirstReaderTaskK:qle,chainFirstReaderTaskKW:lD,chainFirstTaskEitherK:ble,chainFirstTaskEitherKW:GL,chainFirstTaskK:tfe,chainFirstW:qg,chainIOEitherK:gle,chainIOEitherKW:VL,chainIOK:Zle,chainNullableK:lle,chainOptionK:zle,chainReaderEitherK:_le,chainReaderEitherKW:YL,chainReaderK:uD,chainReaderKW:jle,chainReaderTaskK:Dle,chainReaderTaskKW:cD,chainTaskEitherK:yle,chainTaskEitherKW:HL,chainTaskK:efe,chainW:Vl,filterOrElse:pD,filterOrElseW:Gle,flap:Ole,flatten:Tle,flattenW:ZL,fold:ile,foldW:ole,fromEither:WL,fromEitherK:Yle,fromIO:Qa,fromIOEither:CI,fromIOEitherK:KL,fromIOK:Jle,fromNullable:sle,fromNullableK:cle,fromOption:Ule,fromOptionK:Ble,fromPredicate:Hle,fromReader:jL,fromReaderEither:EI,fromReaderEitherK:xI,fromReaderK:Wle,fromReaderTaskK:jI,fromTask:Kl,fromTaskEither:Xa,fromTaskEitherK:MI,fromTaskK:Qle,getAltReaderTaskValidation:tD,getApplicativeReaderTaskValidation:eD,getApplyMonoid:hfe,getApplySemigroup:pfe,getCompactable:QL,getFilterable:Ile,getOrElse:qL,getOrElseW:ale,getReaderTaskValidation:vfe,getSemigroup:mfe,left:Fg,leftIO:PL,leftReader:NL,leftReaderTask:nle,leftTask:AL,local:fle,map:Ip,mapLeft:FI,match:LL,matchE:RI,matchEW:DL,matchW:rle,of:tr,orElse:BL,orElseFirst:zL,orElseFirstW:hle,orElseW:ple,orLeft:mle,readerTaskEither:ffe,readerTaskEitherSeq:dfe,right:TI,rightIO:wI,rightReader:OI,rightReaderTask:FL,rightTask:II,run:gfe,sequenceArray:sfe,sequenceSeqArray:lfe,swap:vle,throwError:Op,toUnion:ule,traverseArray:bD,traverseArrayWithIndex:ufe,traverseReadonlyArrayWithIndex:DI,traverseReadonlyArrayWithIndexSeq:qI,traverseReadonlyNonEmptyArrayWithIndex:gD,traverseReadonlyNonEmptyArrayWithIndexSeq:yD,traverseSeqArray:_D,traverseSeqArrayWithIndex:cfe},Symbol.toStringTag,{value:"Module"}));var bfe=function(e){return new Set(e)},_fe=function(e){return new Set([e])},SD=function(e){return function(t){for(var n=t.length,r=new Set,i=pn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function Sfe(e){return new Set(e)}function $fe(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function Tfe(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function UI(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function Ife(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Me(o,i)}}function BI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=BI(e);return function(a){return i(n,a)}}if(wp(n))return r;if(wp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function zI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=zI(e);return function(a){return i(a,n)}}if(wp(n)||wp(r))return VI;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function Ofe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=pn(e),c=pn(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Me(a,u)}}}function KI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=KI(e);return function(o){return i(o,n)}}return UI(function(o){return!t(o,r)})(n)}}function $D(e){var t=zg(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function TD(e,t){var n=zg(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var ID=function(e){var t=zg(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function OD(e){var t=pn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var wD=function(e){return function(t){return function(n){return UI(function(r){return!e.equals(t,r)})(n)}}},wfe=function(e){var t=pn(e),n=wD(e),r=OD(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},Cfe=function(e){return CD(e)(D)};function Efe(e,t){return function(n){var r=pn(e),i=pn(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Me(o,a)}}function CD(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var VI=new Set,wp=function(e){return e.size===0},Rfe=function(e){return e.size},HI=function(e){return function(t){for(var n=t.values(),r,i=!1;!i&&!(r=n.next()).done;)i=e(r.value);return i}};function GI(e){return Md(HI(Md(e)))}function Cp(e){var t=pn(e);return function(n,r){if(r===void 0){var i=Cp(e);return function(o){return i(o,n)}}return GI(function(o){return t(o,r)})(n)}}function pn(e){return function(t,n){if(n===void 0){var r=pn(e);return function(u){return r(t,u)}}for(var i=n.values(),o,a=!1;!a&&!(o=i.next()).done;)a=e.equals(t,o.value);return a}}var zg=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Mfe="ReadonlySet";function ED(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function RD(e){var t=Cp(e);return Pr(function(n,r){return t(n,r)&&t(r,n)})}var MD=function(e){return{concat:BI(e)}},xfe=function(e){return{concat:MD(e).concat,empty:VI}},kfe=function(e){return{concat:zI(e)}},Afe=function(e){return{concat:KI(e)}},Nfe=SD;const Ffe=Object.freeze(Object.defineProperty({__proto__:null,URI:Mfe,chain:Tfe,compact:Cfe,difference:KI,elem:pn,empty:VI,every:GI,filter:UI,filterMap:CD,foldMap:TD,fromArray:Nfe,fromReadonlyArray:SD,fromSet:bfe,getDifferenceMagma:Afe,getEq:RD,getIntersectionSemigroup:kfe,getShow:ED,getUnionMonoid:xfe,getUnionSemigroup:MD,insert:OD,intersection:zI,isEmpty:wp,isSubset:Cp,map:$fe,partition:Ife,partitionMap:Ofe,reduce:$D,reduceRight:ID,remove:wD,separate:Efe,singleton:_fe,size:Rfe,some:HI,toReadonlyArray:zg,toSet:Sfe,toggle:wfe,union:BI},Symbol.toStringTag,{value:"Module"}));function Qt(e){return e[0]}function wn(e){return e[1]}var Pfe=function(e){return[wn(e),Qt(e)]};function YI(e){return{URI:_r,_E:void 0,map:Ep,ap:function(t,n){return[Qt(t)(Qt(n)),e.concat(wn(t),wn(n))]}}}var xD=function(e){return function(t){return[t,e.empty]}};function Wfe(e){var t=YI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,of:xD(e)}}function JI(e){var t=YI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(Qt(n)),o=i[0],a=i[1];return[o,e.concat(wn(n),a)]}}}function jfe(e){var t=JI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:xD(e)}}function Lfe(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=Qt(o);u._tag==="Left";)a=e.concat(a,wn(o)),o=i(u.left),u=Qt(o);return[u.right,e.concat(a,wn(o))]},n=JI(e);return{URI:_r,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var kD=function(e,t){return y(e,jD(t))},Ep=function(e,t){return y(e,e1(t))},AD=function(e,t,n){return y(e,WD(t,n))},ND=function(e,t){return y(e,t1(t))},FD=function(e,t){return y(e,n1(t))},ZI=function(e,t,n){return y(e,r1(t,n))},XI=function(e){var t=i1();return function(n,r){return y(n,t(r))}},QI=function(e,t,n){return y(e,o1(t,n))},PD=function(e){var t=LD(e);return function(n,r){return y(n,t(r))}},WD=function(e,t){return function(n){return[t(Qt(n)),e(wn(n))]}},e1=function(e){return function(t){return[e(Qt(t)),wn(t)]}},t1=function(e){return function(t){return[Qt(t),e(wn(t))]}},jD=function(e){return function(t){return[Qt(t),wn(e)]}},n1=function(e){return function(t){return[e(t),wn(t)]}},Kg=Qt,Dfe=n1(D),r1=function(e,t){return function(n){return t(e,Qt(n))}},i1=function(){return function(e){return function(t){return e(Qt(t))}}},o1=function(e,t){return function(n){return t(Qt(n),e)}},LD=function(e){return function(t){return function(n){return e.map(t(Qt(n)),function(r){return[r,wn(n)]})}}},a1=function(e){return function(t){return e.map(Qt(t),function(n){return[n,wn(t)]})}},_r="ReadonlyTuple",DD={URI:_r,map:Ep},qfe=Ke(DD),Ufe={URI:_r,bimap:AD,mapLeft:ND},Bfe={URI:_r,compose:kD},zfe={URI:_r,map:Ep,extend:FD,extract:Kg},Kfe={URI:_r,reduce:ZI,foldMap:XI,reduceRight:QI},Vfe={URI:_r,map:Ep,reduce:ZI,foldMap:XI,reduceRight:QI,traverse:PD,sequence:a1},Hfe=e1,Gfe=t1,Yfe={URI:_r,compose:kD,map:Ep,bimap:AD,mapLeft:ND,extract:Kg,extend:FD,reduce:ZI,foldMap:XI,reduceRight:QI,traverse:PD,sequence:a1};const Jfe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Ufe,Comonad:zfe,Foldable:Kfe,Functor:DD,Semigroupoid:Bfe,Traversable:Vfe,URI:_r,bimap:WD,compose:jD,duplicate:Dfe,extend:n1,extract:Kg,flap:qfe,foldMap:i1,fst:Qt,getApplicative:Wfe,getApply:YI,getChain:JI,getChainRec:Lfe,getMonad:jfe,map:Hfe,mapFst:e1,mapLeft:Gfe,mapSnd:t1,readonlyTuple:Yfe,reduce:r1,reduceRight:o1,sequence:a1,snd:wn,swap:Pfe,traverse:LD},Symbol.toStringTag,{value:"Module"}));var Gl=globalThis&&globalThis.__assign||function(){return Gl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Gl.apply(this,arguments)},Zfe=ax,Cs=ui,u1=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Xfe=u1(K);function s1(e){if(typeof e=="function")return s1(K)(e);var t=u1(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var c1=s1(K)(function(e,t){return[e,t]});function Qfe(e){return function(t){var n=c1(t),r=n.length;return e.unfold(0,function(i){return i<r?pe([n[i],i+1]):be})}}var qD=Q_,UD=Io;function BD(e){return function(t){if(!lt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var ede=function(e,t){return zD(e,function(){return t})},zD=function(e,t){return function(n){if(!UD(e,n))return be;var r=Object.assign({},n);return r[e]=t(n[e]),pe(r)}};function tde(e){var t=BD(e);return function(n){var r=KD(e,n);return Wt(r)?be:pe([r.value,t(n)])}}var nde=km,KD=Du,rde=Am,ide=eS;function ode(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Fc(e[0]):Fc(K).apply(void 0,e)}function ade(e){return"compare"in e?Pc(e):Pc(K)(e)}function ude(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Wc(e[0]):Wc(K).apply(void 0,e)}var sde=ux;function cde(e){return sx(e)}function l1(e){return Nm(e)}function Rp(e){return jc(e)}var lde=function(e){var t=l1(e);return function(n){return function(r){return e.map(y(r,t(n)),nu)}}},fde=function(e){var t=l1(e);return function(n){return function(r){return e.map(y(r,t(n)),ru)}}},dde=Fm;function pde(e){return Pm(e)}var hde=Wm;function mde(e){return jm(e)}function VD(e,t){return cx(e,t)}var vde=c1,gde=function(e){return VD(hm(),AA)(e)};function yde(e,t){return tS(e,t)}var bde=lx,_de=fx,Sde=nS,HD=function(e){var t=rS(e);return function(n){return function(r){return Cs(r)?Gl({},n):Cs(n)?Gl({},r):t(n)(r)}}},GD=function(e){return function(t){return function(n){return Cs(n)||Cs(t)?{}:iS(e)(t)(n)}}},YD=function(e){return function(t){return Cs(t)?Gl({},e):Cs(e)?Gl({},t):oS(e)(t)}},vi=pr,Mp=qu,gi=hr,yi=mr,bi=vr,xp=Uu,kp=Bu,Ap=zu,Np=Ku,Fp=Vu,Pp=Hu,Wp=Gu,JD=Lm,ZD=Dm,XD=qm,QD=Um,Yl=Vi,eq=ud,f1=function(e){return function(t){var n=u1(e);return function(r,i){var o=n(r);if(o.length===0)return t.of({});for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){return d[f]=p,d}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},$de=aS,Tde=uS,Ide=Bm,Ode=sS;function wde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?cd(e[0]):cd(K).apply(void 0,e)}function Cde(e){return"compare"in e?ld(e):ld(K)(e)}function Ede(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?fd(e[0]):fd(K).apply(void 0,e)}var nu=Oo,ru=wo,hn="Record";function Rde(e){return"compare"in e?zm(e):zm(K)(e)}var Mde=dx,xde=px,tq={URI:hn,map:vi},kde=Ke(tq),Ade={URI:hn,map:vi,mapWithIndex:Mp},Nde=function(e){return{URI:hn,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e)}},Fde=function(e){return{URI:hn,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),reduceWithIndex:Fp(e),foldMapWithIndex:Pp(e),reduceRightWithIndex:Wp(e)}},jp={URI:hn,compact:nu,separate:ru},Pde={URI:hn,map:vi,compact:nu,separate:ru,filter:xp,filterMap:kp,partition:Ap,partitionMap:Np},Wde={URI:hn,map:vi,mapWithIndex:Mp,compact:nu,separate:ru,filter:xp,filterMap:kp,partition:Ap,partitionMap:Np,filterMapWithIndex:XD,filterWithIndex:QD,partitionMapWithIndex:JD,partitionWithIndex:ZD},nq=function(e){return{URI:hn,map:vi,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),traverse:Yl(e),sequence:eq(e)}},jde=function(e){return{URI:hn,map:vi,mapWithIndex:Mp,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),reduceWithIndex:Fp(e),foldMapWithIndex:Pp(e),reduceRightWithIndex:Wp(e),traverse:Yl(e),sequence:eq(e),traverseWithIndex:f1(e)}},Lde=function(e){var t=nq(e);return{URI:hn,map:vi,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),traverse:t.traverse,sequence:t.sequence,compact:nu,separate:ru,filter:xp,filterMap:kp,partition:Ap,partitionMap:Np,wither:ai(t,jp),wilt:oi(t,jp)}},rq=function(e){var t=HD(e);return{concat:function(n,r){return t(r)(n)}}},Dde=function(e){return{concat:rq(e).concat,empty:{}}},qde=function(e){var t=GD(e);return{concat:function(n,r){return t(r)(n)}}},Ude=function(){return{concat:function(e,t){return YD(t)(e)}}},Bde={URI:hn,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K)},zde={URI:hn,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),reduceWithIndex:Fp(K),foldMapWithIndex:Pp(K),reduceRightWithIndex:Wp(K)},d1={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Yl(K),sequence:Rp},Kde={URI:hn,map:vi,mapWithIndex:Mp,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),reduceWithIndex:Fp(K),foldMapWithIndex:Pp(K),reduceRightWithIndex:Wp(K),traverse:Yl(K),sequence:Rp,traverseWithIndex:f1(K)},iq=ai(d1,jp),oq=oi(d1,jp),Vde={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Yl(K),sequence:Rp,compact:nu,separate:ru,filter:xp,filterMap:kp,partition:Ap,partitionMap:Np,wither:iq,wilt:oq},Hde={},Gde=qD,Yde=bx,Jde={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Yl(K),sequence:Rp,compact:nu,separate:ru,filter:xp,filterMap:kp,partition:Ap,partitionMap:Np,mapWithIndex:Mp,reduceWithIndex:Fp(K),foldMapWithIndex:Pp(K),reduceRightWithIndex:Wp(K),filterMapWithIndex:XD,filterWithIndex:QD,partitionMapWithIndex:JD,partitionWithIndex:ZD,traverseWithIndex:f1(K),wither:iq,wilt:oq};const Zde=Object.freeze(Object.defineProperty({__proto__:null,Compactable:jp,Filterable:Pde,FilterableWithIndex:Wde,Foldable:Bde,FoldableWithIndex:zde,Functor:tq,FunctorWithIndex:Ade,Traversable:d1,TraversableWithIndex:Kde,URI:hn,Witherable:Vde,collect:s1,compact:nu,deleteAt:BD,difference:YD,elem:Sde,empty:Hde,every:bde,filter:$de,filterMap:Tde,filterMapWithIndex:hde,filterWithIndex:mde,flap:kde,foldMap:Cde,foldMapWithIndex:ade,fromEntries:gde,fromFoldable:VD,fromFoldableMap:yde,getDifferenceMagma:Ude,getEq:Mde,getFoldable:Nde,getFoldableWithIndex:Fde,getIntersectionSemigroup:qde,getMonoid:xde,getShow:Rde,getTraversable:nq,getTraversableWithIndex:jde,getUnionMonoid:Dde,getUnionSemigroup:rq,getWitherable:Lde,has:UD,hasOwnProperty:Yde,insertAt:Gde,intersection:GD,isEmpty:Cs,isSubrecord:nde,keys:Xfe,lookup:KD,map:ide,mapWithIndex:rde,modifyAt:zD,partition:Ide,partitionMap:Ode,partitionMapWithIndex:dde,partitionWithIndex:pde,pop:tde,record:Jde,reduce:wde,reduceRight:Ede,reduceRightWithIndex:ude,reduceWithIndex:ode,separate:ru,sequence:Rp,singleton:sde,size:Zfe,some:_de,toArray:c1,toEntries:vde,toUnfoldable:Qfe,traverse:l1,traverseWithIndex:cde,union:HD,updateAt:ede,upsertAt:qD,wilt:fde,wither:lde},Symbol.toStringTag,{value:"Module"}));var Xde=function(e){return function(t){return bt(e(t))}},Qde=function(e){return function(t){return p_(e(t))}},epe=function(){return function(e){return!0}},tpe=function(e){return function(t){return!e(t)}},npe=function(e){return function(t){return function(n){return t(n)||e(n)}}},rpe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ipe=function(){return function(e){return!1}},ope=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const ape=Object.freeze(Object.defineProperty({__proto__:null,and:rpe,compose:ope,fromEitherK:Qde,fromOptionK:Xde,id:epe,not:tpe,or:npe,zero:ipe},Symbol.toStringTag,{value:"Module"}));var aq=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(n,r){return e.map(function(i,o){return i.add(n[o],r[o])})},zero:e.map(function(n){return n.zero}),mul:function(n,r){return e.map(function(i,o){return i.mul(n[o],r[o])})},one:e.map(function(n){return n.one}),sub:function(n,r){return e.map(function(i,o){return i.sub(n[o],r[o])})}}},upe=function(e){return function(t){return e.sub(e.zero,t)}},spe=aq,cpe=ZR;const lpe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:cpe,getTupleRing:spe,negate:upe,tuple:aq},Symbol.toStringTag,{value:"Module"})),fpe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dpe=l_;const ppe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:dpe},Symbol.toStringTag,{value:"Module"}));var hpe=ED,mpe=RD;function vpe(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function gpe(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function p1(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function ype(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Me(o,i)}}function h1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=h1(e);return function(a){return i(n,a)}}if(Lp(n))return r;if(Lp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function m1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=m1(e);return function(a){return i(a,n)}}if(Lp(n)||Lp(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function bpe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=nr(e),c=nr(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Me(a,u)}}}function v1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=v1(e);return function(o){return i(o,n)}}return p1(function(o){return!t(o,r)})(n)}}var uq=function(e){return{concat:h1(e)}},_pe=function(e){return{concat:uq(e).concat,empty:new Set}},Spe=function(e){return{concat:m1(e)}},$pe=function(e){return{concat:v1(e)}},Tpe=$D,Ipe=TD,Ope=ID,wpe=function(e){return new Set([e])};function sq(e){var t=nr(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var cq=function(e){return function(t){return function(n){return p1(function(r){return!e.equals(t,r)})(n)}}},Cpe=function(e){var t=nr(e),n=cq(e),r=sq(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},lq=function(e){return function(t){for(var n=t.length,r=new Set,i=nr(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},Epe=function(e){return fq(e)(D)};function Rpe(e,t){return function(n){var r=nr(e),i=nr(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Me(o,a)}}function fq(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var Mpe=new Set,Lp=function(e){return e.size===0},xpe=function(e){return e.size},kpe=HI,dq=GI,Ape=Cp,nr=pn,pq=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Npe=Cp;const Fpe=Object.freeze(Object.defineProperty({__proto__:null,chain:gpe,compact:Epe,difference:v1,elem:nr,empty:Mpe,every:dq,filter:p1,filterMap:fq,foldMap:Ipe,fromArray:lq,getDifferenceMagma:$pe,getEq:mpe,getIntersectionSemigroup:Spe,getShow:hpe,getUnionMonoid:_pe,getUnionSemigroup:uq,insert:sq,intersection:m1,isEmpty:Lp,isSubset:Ape,map:vpe,partition:ype,partitionMap:bpe,reduce:Tpe,reduceRight:Ope,remove:cq,separate:Rpe,singleton:wpe,size:xpe,some:kpe,subset:Npe,toArray:pq,toggle:Cpe,union:h1},Symbol.toStringTag,{value:"Module"}));var hq=function(e){return{show:function(t){var n="{";for(var r in e)lt.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},mq=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(n){return"[".concat(n.map(function(r,i){return e[i].show(r)}).join(", "),"]")}}},Ppe=mq,Wpe=hq,jpe={show:function(e){return JSON.stringify(e)}},Lpe={show:function(e){return JSON.stringify(e)}},Dpe={show:function(e){return JSON.stringify(e)}};const qpe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:Wpe,getTupleShow:Ppe,showBoolean:jpe,showNumber:Dpe,showString:Lpe,struct:hq,tuple:mq},Symbol.toStringTag,{value:"Module"}));function g1(e){return function(t){return function(n){return e.of([t,n])}}}function y1(e){return function(t){return function(n){return function(r){return e.map(n(r),function(i){var o=i[0],a=i[1];return[t(o),a]})}}}}function b1(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return e.map(t(a),function(u){var s=u[0],c=u[1];return[o(s),c]})})}}}}function _1(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return t(o)(a)})}}}}function S1(e){return function(t){return function(n){return e.of(t(n))}}}function $1(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function T1(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function I1(e){return function(t){return function(n){return e.map(n(t),wn)}}}function Upe(e){var t=b1(e),n=y1(e),r=_1(e),i=T1(e),o=I1(e);return{map:function(a,u){return y(a,n(u))},ap:function(a,u){return y(a,t(u))},of:g1(e),chain:function(a,u){return y(a,r(u))},get:function(){return function(a){return e.of([a,a])}},put:function(a){return function(){return e.of([void 0,a])}},modify:function(a){return function(u){return e.of([void 0,a(u)])}},gets:function(a){return function(u){return e.of([a(u),u])}},fromState:S1(e),fromM:$1(e),evalState:function(a,u){return y(a,i(u))},execState:function(a,u){return y(a,o(u))}}}const Bpe=Object.freeze(Object.defineProperty({__proto__:null,ap:b1,chain:_1,evaluate:T1,execute:I1,fromF:$1,fromState:S1,getStateM:Upe,map:y1,of:g1},Symbol.toStringTag,{value:"Module"}));var O1=function(e){return function(){return Fg(e)}},w1=g1(WI);function vq(e){return _i(II(e))}function zpe(e){return _i(AL(e))}function gq(e){return _i(OI(e))}function Kpe(e){return _i(NL(e))}function yq(e){return _i(wI(e))}function Vpe(e){return _i(PL(e))}var Hpe=function(e){return V(e,TI)},Gpe=function(e){return function(t){return Fg(e(t)[0])}},bq=Ua(function(e){return O1(e)},w1),_q=gq,Es=yq,Dp=vq,Sq=S1(WI),$q=function(e){return _i(Xa(e))},Tq=function(e){return _i(CI(e))},Ype=function(e){return _i(EI(e))},_i=$1(ws),Jpe=function(e){return function(t){return V(t,Gd(e))}},Iq=function(e){return function(t){return function(n){return e(n)(t)(n)}}},Zpe=Iq,Oq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tq(e.apply(void 0,t))}},wq=function(e){return function(t){return y(t,qp(Oq(e)))}},Xpe=wq,Cq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return $q(e.apply(void 0,t))}},Eq=function(e){return function(t){return y(t,qp(Cq(e)))}},Qpe=Eq,Rq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return _i(e.apply(void 0,t))}},Mq=function(e){return function(t){return y(t,qp(Rq(e)))}},ehe=Mq,Si=function(e,t){return y(e,xq(t))},na=function(e,t){return y(e,E1(t))},Rs=function(e,t){return y(e,R1(t))},C1=function(e,t){return function(n){return y(e(n),Lg(function(){return t()(n)}))}},Vg=function(e,t,n){return function(r){return y(e(r),NI(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},Hg=function(e,t){return function(n){return y(e(n),FI(t))}},xq=y1(ws),the=function(e,t){return function(n){return Vg(n,e,t)}},nhe=function(e){return function(t){return Hg(t,e)}},E1=b1(Wn),rhe=E1,uo=w1,R1=_1(Wn),qp=R1,kq=qp(D),ihe=kq,Aq=function(e){return function(t){return function(n){return y(t(n),XL(function(){return e()(n)}))}}},ohe=Aq,Gg=O1,zt="StateReaderTaskEither",M1={URI:zt,map:Si},ahe=Ke(M1),uhe={URI:zt,of:uo},Yg={URI:zt,map:Si,ap:na},Nq=Ct(Yg),she=Nq,Fq=Et(Yg),che=Fq,lhe={URI:zt,map:Si,ap:na,of:uo},rr={URI:zt,map:Si,ap:na,chain:Rs},Ms={URI:zt,fromState:Sq},fhe=VF(Ms),dhe=HF(Ms),phe=GF(Ms),hhe=YF(Ms),mhe=k0(Ms),vhe=JF(Ms,rr),ghe={URI:zt,map:Si,ap:na,of:uo,chain:Rs},yhe={URI:zt,map:Si,ap:na,of:uo,chain:Rs,fromIO:Es},bhe={URI:zt,map:Si,ap:na,of:uo,chain:Rs,fromIO:Es,fromTask:Dp},_he={URI:zt,map:Si,ap:na,of:uo,chain:Rs,throwError:Gg},Pq=ft(rr),She=Pq,$he={URI:zt,bimap:Vg,mapLeft:Hg},The={URI:zt,map:Si,alt:C1},Jl={URI:zt,fromReader:_q},Ihe=Zd(Jl),Ohe=Xd(Jl),whe=vs(Jl),Wq=Qd(Jl,rr),Che=Wq,jq=ep(Jl,rr),Ehe=jq,ra={URI:zt,fromEither:bq},Rhe=Hi(ra),Mhe=Gi(ra),xhe=Ju(ra,rr),Lq=Co(ra,rr),khe=Lq,Dq=Eo(ra,rr),Ahe=Dq,Nhe=Na(ra),qq=Zu(ra,rr),Fhe=qq,Phe=gr(ra),Jg={URI:zt,fromIO:Es},Whe=Qi(Jg),jhe=Wo(Jg,rr),Lhe=jo(Jg,rr),Zg={URI:zt,fromIO:Es,fromTask:Dp},Dhe=gs(Zg),qhe=$l(Zg,rr),Uhe=Tl(Zg,rr),Bhe=T1(ws),zhe=I1(ws),Khe=wt(M1),Uq=Mt(rr),Vhe=Uq,Bq=Rt(Yg),Hhe=Bq,zq=function(e){return function(t){return function(n){return function(r){return function(){return xc(t).reduce(function(i,o,a){return i.then(function(u){return Gt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Gt(s))return s;var c=s.right,l=c[0],f=c[1];return u.right[0].push(l),u.right[1]=f,u})})},e(0,dr(t))(n)(r)().then(cs(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},x1=function(e){var t=zq(e);return function(n){return gt(n)?t(n):uo(rn)}},Ghe=x1,Kq=function(e){return x1(function(t,n){return e(n)})},Yhe=Kq(D),Jhe={URI:zt,map:Si,of:uo,ap:na,chain:Rs,bimap:Vg,mapLeft:Hg,alt:C1,fromIO:Es,fromTask:Dp,throwError:Gg},Zhe={URI:zt,map:Si,of:uo,ap:na,chain:Rs,bimap:Vg,mapLeft:Hg,alt:C1,fromIO:Es,fromTask:Dp,throwError:Gg},Xhe=function(e,t){return y(e(t),Ip(function(n){var r=n[0];return r}))},Qhe=function(e,t){return y(e(t),Ip(function(n){n[0];var r=n[1];return r}))};function eme(e,t,n){return e(t)(n)()}const tme=Object.freeze(Object.defineProperty({__proto__:null,Alt:The,Applicative:lhe,Apply:Yg,Bifunctor:$he,Chain:rr,FromEither:ra,FromIO:Jg,FromReader:Jl,FromState:Ms,FromTask:Zg,Functor:M1,Monad:ghe,MonadIO:yhe,MonadTask:bhe,MonadThrow:_he,Pointed:uhe,URI:zt,alt:ohe,altW:Aq,ap:E1,apFirst:Nq,apFirstW:she,apS:Bq,apSW:Hhe,apSecond:Fq,apSecondW:che,apW:rhe,ask:Ihe,asks:Ohe,asksStateReaderTaskEither:Zpe,asksStateReaderTaskEitherW:Iq,bimap:the,bind:Uq,bindTo:Khe,bindW:Vhe,chain:R1,chainEitherK:Lq,chainEitherKW:khe,chainFirst:Pq,chainFirstEitherK:Dq,chainFirstEitherKW:Ahe,chainFirstIOK:Lhe,chainFirstReaderK:jq,chainFirstReaderKW:Ehe,chainFirstTaskK:Uhe,chainFirstW:She,chainIOEitherK:Xpe,chainIOEitherKW:wq,chainIOK:jhe,chainOptionK:xhe,chainReaderK:Wq,chainReaderKW:Che,chainReaderTaskEitherK:ehe,chainReaderTaskEitherKW:Mq,chainStateK:vhe,chainTaskEitherK:Qpe,chainTaskEitherKW:Eq,chainTaskK:qhe,chainW:qp,evalState:Xhe,evaluate:Bhe,execState:Qhe,execute:zhe,filterOrElse:qq,filterOrElseW:Fhe,flap:ahe,flatten:ihe,flattenW:kq,fromEither:bq,fromEitherK:Phe,fromIO:Es,fromIOEither:Tq,fromIOEitherK:Oq,fromIOK:Whe,fromOption:Rhe,fromOptionK:Mhe,fromPredicate:Nhe,fromReader:_q,fromReaderEither:Ype,fromReaderK:whe,fromReaderTaskEither:_i,fromReaderTaskEitherK:Rq,fromState:Sq,fromStateK:mhe,fromTask:Dp,fromTaskEither:$q,fromTaskEitherK:Cq,fromTaskK:Dhe,get:fhe,gets:hhe,left:O1,leftIO:Vpe,leftReader:Kpe,leftState:Gpe,leftTask:zpe,local:Jpe,map:xq,mapLeft:nhe,modify:phe,of:uo,put:dhe,right:w1,rightIO:yq,rightReader:gq,rightState:Hpe,rightTask:vq,run:eme,sequenceArray:Yhe,stateReaderTaskEither:Jhe,stateReaderTaskEitherSeq:Zhe,throwError:Gg,traverseArray:Kq,traverseArrayWithIndex:Ghe,traverseReadonlyArrayWithIndex:x1,traverseReadonlyNonEmptyArrayWithIndex:zq},Symbol.toStringTag,{value:"Module"}));function nme(e){return function(t){return{peek:t.peek,pos:e}}}function rme(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function ime(e){return function(t){return t.peek(e(t.pos))}}function ome(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var Vq=function(e,t){return y(e,Gq(t))},ame=function(e,t){return y(e,k1(t))},k1=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},Hq=function(e){return e.peek(e.pos)},ume=k1(D),Gq=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},A1="Store",Yq={URI:A1,map:Vq},sme=Ke(Yq),Jq={URI:A1,map:Vq,extend:ame,extract:Hq},cme=Jq;const lme=Object.freeze(Object.defineProperty({__proto__:null,Comonad:Jq,Functor:Yq,URI:A1,duplicate:ume,experiment:ome,extend:k1,extract:Hq,flap:sme,map:Gq,peeks:ime,seek:nme,seeks:rme,store:cme},Symbol.toStringTag,{value:"Module"}));function N1(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function Zq(e,t){var n=N1(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),D,function(o){return[o,o]}))}}function fme(e){return N1(e,e)}function dme(e){return Zq(e,e)}const pme=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Zq,fanout:dme,split:N1,splitStrong:fme},Symbol.toStringTag,{value:"Module"}));var hme=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},mme=function(e){return function(t){var n={};for(var r in t)lt.call(t,r)&&(n[r]=e[r](t[r]));return n}};const vme=Object.freeze(Object.defineProperty({__proto__:null,evolve:mme,getAssignSemigroup:hme},Symbol.toStringTag,{value:"Module"}));var gme=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},yme=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Xq=op(cn),bme=oT(cn),_me=In,Qq=aT(cn),Up=function(e){return Xg(Fn(e))},Xg=Zv(De),Sme=Ga(ol),eU=uT(De),$me=eU,F1=tg(Ll),Tme=F1,tU=F1,Ime=tU,nU=ng(Xt),Ome=nU,wme=Xv(cn),rU=function(e){return function(){return gme(void 0,void 0,void 0,function(){return yme(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(pe)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,be];case 3:return[2]}})})}},Cme=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rU(function(){return e.apply(void 0,t)})}},Eme=Qv(cn),Rme=rT(Xt),Mme=eg(cn),xme=iT(Xt),P1=rg(De),iU=ig(Ts),so=Xq,Qg=El(Xt),kme=Qg(D),W1=og(Xt),Ame=W1,ey=ap(cn),Nme=ey(),j1=Zi(De,rs),L1=No(De,rs,tl),oU=Fo(De,xo),aU=Po(De,xo),uU=Ba(De,xo),sU=za(De,xo),Kr=function(e,t){return y(e,P1(t))},xs=function(e,t){return y(e,iU(t))},ty=function(e,t){return y(e,Qg(t))},cU=function(e,t){return y(e,W1(t))},Fme=function(e,t){return y(e,oU(t))},Pme=function(e,t){return y(e,aU(t))},Wme=function(e,t){return y(e,uU(t))},jme=function(e,t){return y(e,sU(t))},en="TaskOption",D1={URI:en,map:Kr},Lme=Ke(D1),lU={URI:en,of:so},ny={URI:en,map:Kr,ap:xs},Dme=Ct(ny),qme=Et(ny),Ume={URI:en,map:Kr,ap:xs,of:so},fU=function(e,t){return y(e,Qg(function(n){return y(t,P1(n))}))},Bme={URI:en,map:Kr,ap:fU},zme={URI:en,map:Kr,ap:fU,of:so},ia={URI:en,map:Kr,ap:xs,chain:ty},Kme=ft(ia),Vme={URI:en,map:Kr,alt:cU},dU={URI:en,zero:ey},Hme=Bc(dU,lU),Gme={URI:en,map:Kr,ap:xs,of:so,alt:cU,zero:ey},Yme={URI:en,map:Kr,ap:xs,of:so,chain:ty},Jme={URI:en,map:Kr,ap:xs,of:so,chain:ty,fromIO:Up},Zme={URI:en,map:Kr,ap:xs,of:so,chain:ty,fromIO:Up,fromTask:Xg},Xme={URI:en,compact:j1,separate:L1},Qme={URI:en,map:Kr,compact:j1,separate:L1,filter:Fme,filterMap:Pme,partition:Wme,partitionMap:jme},ry={URI:en,fromIO:Up},eve=Qi(ry),tve=Wo(ry,ia),nve=jo(ry,ia),iy={URI:en,fromEither:Qq},rve=gr(iy),ive=Co(iy,ia),ove=Eo(iy,ia),oy={URI:en,fromIO:Up,fromTask:Xg},ave=gs(oy),uve=$l(oy,ia),sve=Tl(oy,ia),cve=so(Yt),lve=wt(D1),fve=Mt(ia),dve=Rt(ny),q1=so(rn),pU=function(e){return V(Dl(e),Ga(Fv(Jn)))},U1=function(e){var t=pU(e);return function(n){return gt(n)?t(n):q1}},hU=function(e){return function(t){return function(){return xc(t).reduce(function(n,r,i){return n.then(function(o){return Wt(o)?n:e(i+1,r)().then(function(a){return Wt(a)?a:(o.value.push(a.value),o)})})},e(0,dr(t))().then(Ji(Yf)))}}},B1=function(e){var t=hU(e);return function(n){return gt(n)?t(n):q1}},pve=U1,mU=function(e){return U1(function(t,n){return e(n)})},hve=mU(D),mve=B1,vU=function(e){return B1(function(t,n){return e(n)})},vve=vU(D);const gve=Object.freeze(Object.defineProperty({__proto__:null,Alt:Vme,Alternative:Gme,ApT:q1,ApplicativePar:Ume,ApplicativeSeq:zme,ApplyPar:ny,ApplySeq:Bme,Chain:ia,Compactable:Xme,Do:cve,Filterable:Qme,FromEither:iy,FromIO:ry,FromTask:oy,Functor:D1,Monad:Yme,MonadIO:Jme,MonadTask:Zme,Pointed:lU,Zero:dU,alt:W1,altW:Ame,ap:iU,apFirst:Dme,apS:dve,apSecond:qme,bind:fve,bindTo:lve,chain:Qg,chainEitherK:ive,chainFirst:Kme,chainFirstEitherK:ove,chainFirstIOK:nve,chainFirstTaskK:sve,chainIOK:tve,chainNullableK:Rme,chainOptionK:xme,chainTaskK:uve,compact:j1,filter:oU,filterMap:aU,flap:Lme,flatten:kme,fold:Tme,foldW:Ime,fromEither:Qq,fromEitherK:rve,fromIO:Up,fromIOK:eve,fromNullable:wme,fromNullableK:Eme,fromOption:_me,fromOptionK:Mme,fromPredicate:bme,fromTask:Xg,fromTaskEither:Sme,fromTaskK:ave,getOrElse:nU,getOrElseW:Ome,guard:Hme,map:P1,match:eU,matchE:F1,matchEW:tU,matchW:$me,none:Nme,of:so,partition:uU,partitionMap:sU,separate:L1,sequenceArray:hve,sequenceSeqArray:vve,some:Xq,traverseArray:mU,traverseArrayWithIndex:pve,traverseReadonlyArrayWithIndex:U1,traverseReadonlyArrayWithIndexSeq:B1,traverseReadonlyNonEmptyArrayWithIndex:pU,traverseReadonlyNonEmptyArrayWithIndexSeq:hU,traverseSeqArray:vU,traverseSeqArrayWithIndex:mve,tryCatch:rU,tryCatchK:Cme,zero:ey},Symbol.toStringTag,{value:"Module"}));var Ze=function(e){return e._tag==="Left"},kt=function(e){return e._tag==="Right"};function ks(e){return e._tag==="Both"}function mn(e){return{_tag:"Left",left:e}}function ir(e){return{_tag:"Right",right:e}}function nt(e,t){return{_tag:"Both",left:e,right:t}}var z1=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},yve=z1,iu=z1,bve=iu,gU=iu(ir,mn,function(e,t){return nt(t,e)});function _ve(e,t){return{show:iu(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function Sve(e,t){return Pr(function(n,r){return Ze(n)?Ze(r)&&e.equals(n.left,r.left):kt(n)?kt(r)&&t.equals(n.right,r.right):ks(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function yU(e,t){return{concat:function(n,r){return Ze(n)?Ze(r)?mn(e.concat(n.left,r.left)):kt(r)?nt(n.left,r.right):nt(e.concat(n.left,r.left),r.right):kt(n)?Ze(r)?nt(r.left,n.right):kt(r)?ir(t.concat(n.right,r.right)):nt(r.left,t.concat(n.right,r.right)):Ze(r)?nt(e.concat(n.left,r.left),n.right):kt(r)?nt(n.left,t.concat(n.right,r.right)):nt(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var ay=function(e){return{URI:Sr,_E:void 0,map:As,ap:function(t,n){return Ze(t)?Ze(n)?mn(e.concat(t.left,n.left)):kt(n)?mn(t.left):mn(e.concat(t.left,n.left)):kt(t)?Ze(n)?mn(n.left):kt(n)?ir(t.right(n.right)):nt(n.left,t.right(n.right)):Ze(n)?mn(e.concat(t.left,n.left)):kt(n)?nt(t.left,t.right(n.right)):nt(e.concat(t.left,n.left),t.right(n.right))}}};function $ve(e){var t=ay(e);return{URI:Sr,_E:void 0,map:As,ap:t.ap,of:Bp}}function bU(e){var t=ay(e),n=function(r,i){if(Ze(r))return r;if(kt(r))return i(r.right);var o=i(r.right);return Ze(o)?mn(e.concat(r.left,o.left)):kt(o)?nt(r.left,o.right):nt(e.concat(r.left,o.left),o.right)};return{URI:Sr,_E:void 0,map:As,ap:t.ap,chain:n}}function Tve(e){var t=bU(e);return{URI:Sr,_E:void 0,map:As,of:Bp,ap:t.ap,chain:t.chain,throwError:mn}}function Ive(e){return Ze(e)?pe(e.left):kt(e)?be:pe(e.left)}function Ove(e){return Ze(e)?be:(kt(e),pe(e.right))}function wve(e){return function(t){return Wt(t)?mn(e):nt(e,t.value)}}function Cve(e){return function(t){return Wt(t)?ir(e):nt(t.value,e)}}function Eve(e){return Ze(e)?pe(e.left):be}function Rve(e){return kt(e)?pe(e.right):be}var Mve=function(e,t){return Wt(e)?Wt(t)?be:pe(ir(t.value)):Wt(t)?pe(mn(e.value)):pe(nt(e.value,t.value))},As=function(e,t){return y(e,J1(t))},_U=function(e,t,n){return y(e,G1(t,n))},SU=function(e,t){return y(e,Y1(t))},K1=function(e,t,n){return y(e,TU(t,n))},V1=function(e){var t=IU(e);return function(n,r){return y(n,t(r))}},H1=function(e,t,n){return y(e,OU(t,n))},$U=function(e){var t=wU(e);return function(n,r){return y(n,t(r))}},G1=function(e,t){return function(n){return Ze(n)?mn(e(n.left)):kt(n)?ir(t(n.right)):nt(e(n.left),t(n.right))}},Y1=function(e){return function(t){return Ze(t)?mn(e(t.left)):ks(t)?nt(e(t.left),t.right):t}},J1=function(e){return function(t){return Ze(t)?t:kt(t)?ir(e(t.right)):nt(t.left,e(t.right))}},TU=function(e,t){return function(n){return Ze(n)?e:t(e,n.right)}},IU=function(e){return function(t){return function(n){return Ze(n)?e.empty:t(n.right)}}},OU=function(e,t){return function(n){return Ze(n)?e:t(n.right,e)}},wU=function(e){return function(t){return function(n){return Ze(n)?e.of(n):kt(n)?e.map(t(n.right),ir):e.map(t(n.right),function(r){return nt(n.left,r)})}}},Z1=function(e){return function(t){return Ze(t)?e.of(t):kt(t)?e.map(t.right,ir):e.map(t.right,function(n){return nt(t.left,n)})}},Bp=ir,Sr="These",X1={URI:Sr,map:As},xve=Ke(X1),kve={URI:Sr,of:Bp},Ave={URI:Sr,bimap:_U,mapLeft:SU},Nve={URI:Sr,fromThese:D},Fve={URI:Sr,reduce:K1,foldMap:V1,reduceRight:H1},Pve={URI:Sr,map:As,reduce:K1,foldMap:V1,reduceRight:H1,traverse:$U,sequence:Z1},Q1={URI:Sr,fromEither:D},Wve=Hi(Q1),jve=Gi(Q1),Lve=function(e){return function(t){return function(n){return Ze(n)?!1:e.equals(t,n.right)}}},Dve=function(e){return function(t){return Ze(t)?!1:e(t.right)}},eO=function(e,t){return function(n){return Ze(n)?[n.left,t()]:kt(n)?[e(),n.right]:[n.left,n.right]}},qve=function(e,t){return eO(function(){return e},function(){return t})},CU=Bp(rn),tO=function(e){return function(t){return function(n){var r=be,i=t(0,dr(n));if(Ze(i))return i;ks(i)&&(r=pe(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ze(u))return u;ks(u)&&(r=Wt(r)?pe(u.left):pe(e.concat(r.value,u.left))),o.push(u.right)}return Wt(r)?ir(o):nt(r.value,o)}}},Uve=function(e){return function(t){var n=tO(e)(t);return function(r){return gt(r)?n(r):CU}}},Bve={URI:Sr,map:As,bimap:_U,mapLeft:SU,reduce:K1,foldMap:V1,reduceRight:H1,traverse:$U,sequence:Z1};const zve=Object.freeze(Object.defineProperty({__proto__:null,ApT:CU,Bifunctor:Ave,Foldable:Fve,FromEither:Q1,FromThese:Nve,Functor:X1,Pointed:kve,Traversable:Pve,URI:Sr,bimap:G1,both:nt,elem:Lve,exists:Dve,flap:xve,fold:bve,foldMap:IU,foldW:yve,fromOption:Wve,fromOptionK:jve,fromOptions:Mve,getApplicative:$ve,getApply:ay,getChain:bU,getEq:Sve,getLeft:Ive,getLeftOnly:Eve,getMonad:Tve,getRight:Ove,getRightOnly:Rve,getSemigroup:yU,getShow:_ve,isBoth:ks,isLeft:Ze,isRight:kt,left:mn,leftOrBoth:wve,map:J1,mapLeft:Y1,match:iu,matchW:z1,of:Bp,reduce:TU,reduceRight:OU,right:ir,rightOrBoth:Cve,sequence:Z1,swap:gU,these:Bve,toTuple:qve,toTuple2:eO,traverse:wU,traverseReadonlyArrayWithIndex:Uve,traverseReadonlyNonEmptyArrayWithIndex:tO},Symbol.toStringTag,{value:"Module"}));function uy(e){return V(ir,e.of)}function sy(e){return V(mn,e.of)}function nO(e){return V(nt,e.of)}function rO(e){return function(t){return e.map(t,ir)}}function iO(e){return function(t){return e.map(t,mn)}}function oO(e){return Rc(e,X1)}function aO(e,t){return To(e,ay(t))}function uO(e,t){var n=sy(e);return function(r){return function(i){return e.chain(i,iu(n,r,function(o,a){return e.map(r(a),iu(function(u){return mn(t.concat(o,u))},function(u){return nt(o,u)},function(u,s){return nt(t.concat(o,u),s)}))}))}}}function sO(e){return function(t,n){return function(r){return e.map(r,G1(t,n))}}}function cO(e){return function(t){return function(n){return e.map(n,Y1(t))}}}function EU(e){return function(t,n,r){return function(i){return e.map(i,iu(t,n,r))}}}function lO(e){return function(t,n,r){return function(i){return e.chain(i,iu(t,n,r))}}}function fO(e){return function(t){return e.map(t,gU)}}function dO(e){return function(t,n){return function(r){return e.map(r,eO(t,n))}}}function Kve(e){var t=oO(e),n=sO(e),r=cO(e),i=lO(e),o=dO(e),a=uy(e),u=function(s,c){return y(s,t(c))};return{map:u,bimap:function(s,c,l){return y(s,n(c,l))},mapLeft:function(s,c){return y(s,r(c))},fold:function(s,c,l,f){return y(s,i(c,l,f))},swap:fO(e),rightM:rO(e),leftM:iO(e),left:sy(e),right:uy(e),both:nO(e),toTuple:function(s,c,l){return y(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=aO(e,s),l=uO(e,s);return{_E:void 0,map:u,of:a,ap:function(f,d){return y(f,c(d))},chain:function(f,d){return y(f,l(d))}}}}}const Vve=Object.freeze(Object.defineProperty({__proto__:null,ap:aO,bimap:sO,both:nO,chain:uO,getTheseM:Kve,left:sy,leftF:iO,map:oO,mapLeft:cO,match:EU,matchE:lO,right:uy,rightF:rO,swap:fO,toTuple2:dO},Symbol.toStringTag,{value:"Module"}));var Hve=sy(cn),RU=uy(cn),Gve=nO(cn),pO=rO(De),MU=iO(De),xU=V(Fn,pO),Yve=V(Fn,MU),kU=In,AU=In,cy=xU,Jve=Fn,hO=pO,NU=EU(De),Zve=NU,FU=lO(Xt),PU=FU,WU=PU,Xve=WU,Qve=fO(De),Ns=function(e,t){return y(e,jU(t))},mO=function(e,t,n){return y(e,LU(t,n))},vO=function(e,t){return y(e,DU(t))},jU=oO(De),LU=sO(De),DU=cO(De),zp=RU,jn="TaskThese",gO=function(e,t){var n=aO(e,t);return{URI:jn,_E:void 0,map:Ns,ap:function(r,i){return y(r,n(i))}}};function qU(e,t){var n=gO(e,t).ap;return{URI:jn,_E:void 0,map:Ns,ap:n,of:zp}}function UU(e){var t=gO(gp,e),n=uO(Xt,e);return{URI:jn,_E:void 0,map:Ns,ap:t.ap,chain:function(r,i){return y(r,n(i))}}}function ege(e){var t=qU(gp,e),n=UU(e);return{URI:jn,_E:void 0,map:Ns,ap:t.ap,of:zp,chain:n.chain,fromIO:cy,fromTask:hO}}var BU={URI:jn,map:Ns},tge=Ke(BU),nge={URI:jn,of:zp},rge={URI:jn,bimap:mO,mapLeft:vO},ly={URI:jn,fromEither:kU},ige=Hi(ly),oge=Gi(ly),age=Na(ly),zU={URI:jn,fromThese:AU},uge=ZF(zU),KU={URI:jn,fromIO:cy},sge=Qi(KU),VU={URI:jn,fromIO:cy,fromTask:hO},cge=gs(VU),HU=dO(De),yO=zp(rn),GU=function(e){var t=tO(e);return function(n){return V(Dl(n),Ga(t(Jn)))}},lge=function(e){return function(t){var n=GU(e)(t);return function(r){return gt(r)?n(r):yO}}},YU=function(e){return function(t){return function(n){return function(){return xc(n).reduce(function(r,i,o){return r.then(function(a){return Ze(a)?r:t(o+1,i)().then(function(u){if(Ze(u))return u;if(ks(u)){var s=a.right;return s.push(u.right),ks(a)?nt(e.concat(a.left,u.left),s):nt(u.left,s)}return a.right.push(u.right),a})})},t(0,dr(n))().then(J1(Yf)))}}}},fge=function(e){return function(t){var n=YU(e)(t);return function(r){return gt(r)?n(r):yO}}},dge={URI:jn,map:Ns},pge={URI:jn,bimap:mO,mapLeft:vO},hge=function(e,t){return HU(function(){return e},function(){return t})},mge={URI:jn,map:Ns,bimap:mO,mapLeft:vO},vge=function(e,t){return Jt(Tg)(yU(e,t))};const gge=Object.freeze(Object.defineProperty({__proto__:null,ApT:yO,Bifunctor:rge,FromEither:ly,FromIO:KU,FromTask:VU,FromThese:zU,Functor:BU,Pointed:nge,URI:jn,bifunctorTaskThese:pge,bimap:LU,both:Gve,flap:tge,fold:PU,foldW:Xve,fromEither:kU,fromIO:cy,fromIOEither:Jve,fromIOK:sge,fromOption:ige,fromOptionK:oge,fromPredicate:age,fromTask:hO,fromTaskK:cge,fromThese:AU,fromTheseK:uge,functorTaskThese:dge,getApplicative:qU,getApply:gO,getChain:UU,getMonad:ege,getSemigroup:vge,left:Hve,leftIO:Yve,leftTask:MU,map:jU,mapLeft:DU,match:NU,matchE:FU,matchEW:WU,matchW:Zve,of:zp,right:RU,rightIO:xU,rightTask:pO,swap:Qve,taskThese:mge,toTuple:hge,toTuple2:HU,traverseReadonlyArrayWithIndex:lge,traverseReadonlyArrayWithIndexSeq:fge,traverseReadonlyNonEmptyArrayWithIndex:GU,traverseReadonlyNonEmptyArrayWithIndexSeq:YU},Symbol.toStringTag,{value:"Module"}));function yge(e,t){return function(n){return n(t(n(e.empty)))}}function bge(e){return function(t){return[e(t),t]}}function _ge(e){return function(t){return function(n){return[t(n),e(n)]}}}function Sge(e){return function(t){return function(n){return t(e(n))}}}function $ge(e){function t(r,i){return function(o){return i(function(a){return r(e.concat(o,a))})}}function n(r){return r(e.empty)}return{URI:bO,_E:void 0,map:JU,extend:t,extract:n}}var JU=function(e,t){return y(e,ZU(t))},ZU=function(e){return function(t){return function(n){return e(t(n))}}},bO="Traced",_O={URI:bO,map:JU},Tge=Ke(_O),Ige=_O;const Oge=Object.freeze(Object.defineProperty({__proto__:null,Functor:_O,URI:bO,censor:Sge,flap:Tge,getComonad:$ge,listen:bge,listens:_ge,map:ZU,traced:Ige,tracks:yge},Symbol.toStringTag,{value:"Module"}));function XU(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function QU(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function wge(e,t){var n=Mc(e,t).map,r=g0(e,t),i=XU(e,t),o=QU(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var u=i(a);return function(s,c){return y(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return y(s,u)}}}}const Cge=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:wge,sequence:QU,traverse:XU},Symbol.toStringTag,{value:"Module"})),Ege=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function eB(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function Rge(e){var t=function(n){return Wa(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Mge(e){var t,n=Pr(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=RA(n),n}var tB=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"└":"├")+"─ "+i.value,n+=tB(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function nB(e){return tB(`
28
- `,e)}function xge(e){return e.value+nB(e.forest)}function rB(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:iB(i,t)}}function iB(e,t){return e.map(function(n){return rB(n,t)})}function oB(e){var t=aB(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(u){return{value:o,forest:u}})})}}function aB(e){var t=Tv(e);return function(n,r){return y(n,t(function(i){return oB(e)(i,r)}))}}function kge(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var ou=function(e,t){return y(e,dy(t))},Zl=function(e,t){return y(e,Kp(function(n){return y(t,dy(n))}))},SO=function(e,t){return y(e,Kp(t))},$O=function(e,t,n){return y(e,py(t,n))},TO=function(e){var t=cB(e);return function(n,r){return y(n,t(r))}},IO=function(e,t,n){return y(e,OO(t,n))},uB=function(e,t){return y(e,fy(t))},sB=function(e){var t=CO(e);return function(n,r){return y(n,t(r))}},Age=function(e){return function(t){return Zl(t,e)}},Kp=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=M$().concat;return{value:r,forest:o(i,t.forest.map(Kp(e)))}}},fy=function(e){return function(t){return{value:e(t),forest:t.forest.map(fy(e))}}},Nge=fy(D),Fge=Kp(D),dy=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(dy(e))}}},py=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=y(n.forest[o],py(r,t));return r}},cB=function(e){return function(t){return py(e.empty,function(n,r){return e.concat(n,t(r))})}},OO=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=y(n.forest[o],OO(r,t));return t(n.value,r)}},wO=function(e){return e.value},CO=function(e){var t=Tv(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),y(i.forest,t(n(r))))}};return n},EO=function(e){return CO(e)(D)},Xl=function(e){return eB(e)},$i="Tree",RO={URI:$i,map:ou},Pge=Ke(RO),Wge={URI:$i,of:Xl},hy={URI:$i,map:ou,ap:Zl},jge=Ct(hy),Lge=Et(hy),Dge={URI:$i,map:ou,ap:Zl,of:Xl},MO={URI:$i,map:ou,ap:Zl,chain:SO},qge={URI:$i,map:ou,ap:Zl,of:Xl,chain:SO},Uge=ft(MO),Bge={URI:$i,reduce:$O,foldMap:TO,reduceRight:IO},zge={URI:$i,map:ou,reduce:$O,foldMap:TO,reduceRight:IO,traverse:sB,sequence:EO},Kge={URI:$i,map:ou,extend:uB,extract:wO},Vge=Xl(Yt),Hge=wt(RO),Gge=Mt(MO),Yge=Rt(hy);function Jge(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var lB=function(e){return function(t){return e(t.value)||t.forest.some(lB(e))}},Zge={URI:$i,map:ou,of:Xl,ap:Zl,chain:SO,reduce:$O,foldMap:TO,reduceRight:IO,traverse:sB,sequence:EO,extract:wO,extend:uB};const Xge=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Dge,Apply:hy,Chain:MO,Comonad:Kge,Do:Vge,Foldable:Bge,Functor:RO,Monad:qge,Pointed:Wge,Traversable:zge,URI:$i,ap:Age,apFirst:jge,apS:Yge,apSecond:Lge,bind:Gge,bindTo:Hge,chain:Kp,chainFirst:Uge,drawForest:nB,drawTree:xge,duplicate:Nge,elem:Jge,exists:lB,extend:fy,extract:wO,flap:Pge,flatten:Fge,fold:kge,foldMap:cB,getEq:Mge,getShow:Rge,make:eB,map:dy,of:Xl,reduce:py,reduceRight:OO,sequence:EO,traverse:CO,tree:Zge,unfoldForest:iB,unfoldForestM:aB,unfoldTree:rB,unfoldTreeM:oB},Symbol.toStringTag,{value:"Module"}));var $r=Qt,or=wn,Qge=function(e){return[or(e),$r(e)]};function xO(e){return{URI:Tr,_E:void 0,map:Vp,ap:function(t,n){return[$r(t)($r(n)),e.concat(or(t),or(n))]}}}var fB=function(e){return function(t){return[t,e.empty]}};function eye(e){var t=xO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,of:fB(e)}}function kO(e){var t=xO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r($r(n)),o=i[0],a=i[1];return[o,e.concat(or(n),a)]}}}function tye(e){var t=kO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:fB(e)}}function nye(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=$r(o);u._tag==="Left";)a=e.concat(a,or(o)),o=i(u.left),u=$r(o);return[u.right,e.concat(a,or(o))]},n=kO(e);return{URI:Tr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var dB=function(e,t){return y(e,yB(t))},Vp=function(e,t){return y(e,PO(t))},pB=function(e,t,n){return y(e,gB(t,n))},hB=function(e,t){return y(e,WO(t))},mB=function(e,t){return y(e,jO(t))},AO=function(e,t,n){return y(e,_B(t,n))},NO=function(e){var t=bB();return function(n,r){return y(n,t(r))}},FO=function(e,t,n){return y(e,SB(t,n))};function vB(e){var t=$B(e);return function(n,r){return y(n,t(r))}}var gB=function(e,t){return function(n){return[t($r(n)),e(or(n))]}},PO=function(e){return function(t){return[e($r(t)),or(t)]}},WO=function(e){return function(t){return[$r(t),e(or(t))]}},yB=function(e){return function(t){return[$r(t),or(e)]}},jO=function(e){return function(t){return[e(t),or(t)]}},rye=jO(D),LO=Kg,bB=i1,_B=r1,SB=o1,$B=function(e){return function(t){return function(n){return e.map(t($r(n)),function(r){return[r,or(n)]})}}},DO=function(e){return function(t){return e.map($r(t),function(n){return[n,or(t)]})}},Tr="Tuple",TB={URI:Tr,map:Vp},iye=Ke(TB),oye={URI:Tr,bimap:pB,mapLeft:hB},aye={URI:Tr,compose:dB},uye={URI:Tr,map:Vp,extend:mB,extract:LO},sye={URI:Tr,reduce:AO,foldMap:NO,reduceRight:FO},cye={URI:Tr,map:Vp,reduce:AO,foldMap:NO,reduceRight:FO,traverse:vB,sequence:DO},lye=PO,fye=WO,dye={URI:Tr,compose:dB,map:Vp,bimap:pB,mapLeft:hB,extract:LO,extend:mB,reduce:AO,foldMap:NO,reduceRight:FO,traverse:vB,sequence:DO};const pye=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:oye,Comonad:uye,Foldable:sye,Functor:TB,Semigroupoid:aye,Traversable:cye,URI:Tr,bimap:gB,compose:yB,duplicate:rye,extend:jO,extract:LO,flap:iye,foldMap:bB,fst:$r,getApplicative:eye,getApply:xO,getChain:kO,getChainRec:nye,getMonad:tye,map:lye,mapFst:PO,mapLeft:fye,mapSnd:WO,reduce:_B,reduceRight:SB,sequence:DO,snd:or,swap:Qge,traverse:$B,tuple:dye},Symbol.toStringTag,{value:"Module"})),hye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function mye(e,t){var n=Sx(t,Da(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Gt(o)?t.of($o(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return p_(o)?t.of(o):t.map(i(),function(a){return Gt(a)?$o(e.concat(o.left,a.left)):a})})}}}const vye=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:mye},Symbol.toStringTag,{value:"Module"}));var IB=S_(void 0),gye={concat:IB.concat,empty:void 0};const yye=Object.freeze(Object.defineProperty({__proto__:null,Monoid:gye,Semigroup:IB},Symbol.toStringTag,{value:"Module"}));var bye=function(e){return function(){return[void 0,e]}},_ye=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},Sye=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},$ye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},Tye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},Hp=function(e,t){return y(e,OB(t))},OB=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Fs="Writer",wB=function(e){return{URI:Fs,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},qO=function(e){return{URI:Fs,_E:void 0,map:Hp,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),u=a[0],s=a[1];return[i(u),e.concat(o,s)]}}}},CB=function(e){var t=qO(e),n=wB(e);return{URI:Fs,_E:void 0,map:Hp,ap:t.ap,of:n.of}};function EB(e){var t=qO(e);return{URI:Fs,_E:void 0,map:Hp,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,e.concat(a,c)]}}}}function Iye(e){var t=CB(e),n=EB(e);return{URI:Fs,_E:void 0,map:Hp,ap:t.ap,of:t.of,chain:n.chain}}var UO={URI:Fs,map:Hp},Oye=Ke(UO),wye=function(e){return e()[0]},Cye=function(e){return e()[1]},Eye=function(e){return e()[0]},Rye=function(e){return e()[1]},Mye=UO;const xye=Object.freeze(Object.defineProperty({__proto__:null,Functor:UO,URI:Fs,censor:Tye,evalWriter:Eye,evaluate:wye,execWriter:Rye,execute:Cye,flap:Oye,getApplicative:CB,getApply:qO,getChain:EB,getMonad:Iye,getPointed:wB,listen:_ye,listens:$ye,map:OB,pass:Sye,tell:bye,writer:Mye},Symbol.toStringTag,{value:"Module"}));function kye(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],u=r[1];return[o,a(u)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(),function(s){var c=s[0],l=s[1];return[a(c),n.concat(u,l)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(a)(),function(s){var c=s[0],l=s[1];return[c,n.concat(u,l)]})})}}}}}}const mt=wc(Object.freeze(Object.defineProperty({__proto__:null,alt:FY,alternative:WY,applicative:jY,apply:IG,array:G8,bifunctor:Y8,boolean:rX,booleanAlgebra:sX,bounded:dX,boundedDistributiveLattice:mX,boundedJoinSemilattice:vX,boundedLattice:gX,boundedMeetSemilattice:yX,category:bX,chain:OG,chainRec:_X,choice:TX,comonad:IX,compactable:mQ,console:_Q,const:FQ,contravariant:PQ,date:zQ,distributiveLattice:pX,either:cF,eitherT:kee,endomorphism:Nee,eq:fG,extend:Fee,field:jee,filterable:Dee,filterableWithIndex:qee,foldable:Hee,foldableWithIndex:Yee,fromEither:LY,fromIO:Jee,fromReader:yte,fromState:jte,fromTask:Lte,fromThese:Dte,function:nM,functor:dG,functorWithIndex:Ute,group:Bte,heytingAlgebra:zte,hkt:Kte,identity:pne,invariant:hne,io:Ane,ioEither:Are,ioOption:wie,ioRef:Eie,joinSemilattice:Rie,json:kie,lattice:Aie,magma:BG,map:Uoe,meetSemilattice:Boe,monad:zoe,monadIO:Koe,monadTask:Voe,monadThrow:Hoe,monoid:aae,naturalTransformation:uae,nonEmptyArray:xJ,number:jJ,option:pQ,optionT:Fre,ord:LG,ordering:hae,pipeable:kae,pointed:Aae,predicate:RX,profunctor:Nae,random:jae,reader:gte,readerEither:Nue,readerT:Wue,readerTask:Kse,readerTaskEither:yfe,readonlyArray:lZ,readonlyMap:aoe,readonlyNonEmptyArray:q9,readonlyRecord:AY,readonlySet:Ffe,readonlyTuple:Jfe,record:Zde,refinement:ape,ring:lpe,semigroup:RM,semigroupoid:fpe,semiring:ppe,separated:bG,set:Fpe,show:qpe,state:Wte,stateReaderTaskEither:tme,stateT:Bpe,store:lme,string:iY,strong:pme,struct:vme,task:cse,taskEither:tle,taskOption:gve,taskThese:gge,these:zve,theseT:Vve,traced:Oge,traversable:Cge,traversableWithIndex:Ege,tree:Xge,tuple:pye,unfoldable:hye,validationT:vye,void:yye,witherable:oY,writer:xye,writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:kye},Symbol.toStringTag,{value:"Module"})),zero:LJ},Symbol.toStringTag,{value:"Module"})));var BO={},Ps={},vn={},zO={},RB;function Qe(){return RB||(RB=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function($){return function(){return{meet:function(T,M){return function(R){return $.meet(T(R),M(R))}},join:function(T,M){return function(R){return $.join(T(R),M(R))}},zero:function(){return $.zero},one:function(){return $.one},implies:function(T,M){return function(R){return $.implies(T(R),M(R))}},not:function(T){return function(M){return $.not(T(M))}}}}};e.getBooleanAlgebra=t;var n=function($){return function(){return{concat:function(T,M){return function(R){return $.concat(T(R),M(R))}}}}};e.getSemigroup=n;var r=function($){var T=(0,e.getSemigroup)($);return function(){return{concat:T().concat,empty:function(){return $.empty}}}};e.getMonoid=r;var i=function($){return{add:function(T,M){return function(R){return $.add(T(R),M(R))}},zero:function(){return $.zero},mul:function(T,M){return function(R){return $.mul(T(R),M(R))}},one:function(){return $.one}}};e.getSemiring=i;var o=function($){var T=(0,e.getSemiring)($);return{add:T.add,mul:T.mul,one:T.one,zero:T.zero,sub:function(M,R){return function(q){return $.sub(M(q),R(q))}}}};e.getRing=o;var a=function($){return function(T){return T($)}};e.apply=a;function u($){return $}e.identity=u,e.unsafeCoerce=u;function s($){return function(){return $}}e.constant=s,e.constTrue=s(!0),e.constFalse=s(!1),e.constNull=s(null),e.constUndefined=s(void 0),e.constVoid=e.constUndefined;function c($){return function(T,M){return $(M,T)}}e.flip=c;function l($,T,M,R,q,Y,N,Z,ie){switch(arguments.length){case 1:return $;case 2:return function(){return T($.apply(this,arguments))};case 3:return function(){return M(T($.apply(this,arguments)))};case 4:return function(){return R(M(T($.apply(this,arguments))))};case 5:return function(){return q(R(M(T($.apply(this,arguments)))))};case 6:return function(){return Y(q(R(M(T($.apply(this,arguments))))))};case 7:return function(){return N(Y(q(R(M(T($.apply(this,arguments)))))))};case 8:return function(){return Z(N(Y(q(R(M(T($.apply(this,arguments))))))))};case 9:return function(){return ie(Z(N(Y(q(R(M(T($.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var $=[],T=0;T<arguments.length;T++)$[T]=arguments[T];return $}e.tuple=f;function d($){return $+1}e.increment=d;function p($){return $-1}e.decrement=p;function h($){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v($){return function(T){return $.apply(void 0,T)}}e.tupled=v;function m($){return function(){for(var T=[],M=0;M<arguments.length;M++)T[M]=arguments[M];return $(T)}}e.untupled=m;function _($,T,M,R,q,Y,N,Z,ie){switch(arguments.length){case 1:return $;case 2:return T($);case 3:return M(T($));case 4:return R(M(T($)));case 5:return q(R(M(T($))));case 6:return Y(q(R(M(T($)))));case 7:return N(Y(q(R(M(T($))))));case 8:return Z(N(Y(q(R(M(T($)))))));case 9:return ie(Z(N(Y(q(R(M(T($))))))));default:{for(var J=arguments[0],ye=1;ye<arguments.length;ye++)J=arguments[ye](J);return J}}}e.pipe=_,e.hole=h;var g=function($,T){return T};e.SK=g;function S($){return function(T){return!$(T)}}e.not=S;var b=function(){return{concat:function($,T){return l($,T)},empty:u}};e.getEndomorphismMonoid=b}(zO)),zO}var qe={},MB;function my(){if(MB)return qe;MB=1;var e=he&&he.__spreadArray||function(p,h,v){if(v||arguments.length===2)for(var m=0,_=h.length,g;m<_;m++)(g||!(m in h))&&(g||(g=Array.prototype.slice.call(h,0,m)),g[m]=h[m]);return p.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(qe,"__esModule",{value:!0}),qe.fromReadonlyNonEmptyArray=qe.has=qe.emptyRecord=qe.emptyReadonlyArray=qe.tail=qe.head=qe.isNonEmpty=qe.singleton=qe.right=qe.left=qe.isRight=qe.isLeft=qe.some=qe.none=qe.isSome=qe.isNone=void 0;var t=function(p){return p._tag==="None"};qe.isNone=t;var n=function(p){return p._tag==="Some"};qe.isSome=n,qe.none={_tag:"None"};var r=function(p){return{_tag:"Some",value:p}};qe.some=r;var i=function(p){return p._tag==="Left"};qe.isLeft=i;var o=function(p){return p._tag==="Right"};qe.isRight=o;var a=function(p){return{_tag:"Left",left:p}};qe.left=a;var u=function(p){return{_tag:"Right",right:p}};qe.right=u;var s=function(p){return[p]};qe.singleton=s;var c=function(p){return p.length>0};qe.isNonEmpty=c;var l=function(p){return p[0]};qe.head=l;var f=function(p){return p.slice(1)};qe.tail=f,qe.emptyReadonlyArray=[],qe.emptyRecord={},qe.has=Object.prototype.hasOwnProperty;var d=function(p){return e([p[0]],p.slice(1),!0)};return qe.fromReadonlyNonEmptyArray=d,qe}var xB;function kB(){if(xB)return vn;xB=1;var e=he&&he.__createBinding||(Object.create?function(m,_,g,S){S===void 0&&(S=g);var b=Object.getOwnPropertyDescriptor(_,g);(!b||("get"in b?!_.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return _[g]}}),Object.defineProperty(m,S,b)}:function(m,_,g,S){S===void 0&&(S=g),m[S]=_[g]}),t=he&&he.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),n=he&&he.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var g in m)g!=="default"&&Object.prototype.hasOwnProperty.call(m,g)&&e(_,m,g);return t(_,m),_};Object.defineProperty(vn,"__esModule",{value:!0}),vn.sequenceS=vn.sequenceT=vn.getApplySemigroup=vn.apS=vn.apSecond=vn.apFirst=vn.ap=void 0;var r=Qe(),i=n(my());function o(m,_){return function(g){return function(S){return m.ap(m.map(S,function(b){return function($){return _.ap(b,$)}}),g)}}}vn.ap=o;function a(m){return function(_){return function(g){return m.ap(m.map(g,function(S){return function(){return S}}),_)}}}vn.apFirst=a;function u(m){return function(_){return function(g){return m.ap(m.map(g,function(){return function(S){return S}}),_)}}}vn.apSecond=u;function s(m){return function(_,g){return function(S){return m.ap(m.map(S,function(b){return function($){var T;return Object.assign({},b,(T={},T[_]=$,T))}}),g)}}}vn.apS=s;function c(m){return function(_){return{concat:function(g,S){return m.ap(m.map(g,function(b){return function($){return _.concat(b,$)}}),S)}}}}vn.getApplySemigroup=c;function l(m,_,g){return function(S){for(var b=Array(g.length+1),$=0;$<g.length;$++)b[$]=g[$];return b[g.length]=S,_===0?m.apply(null,b):l(m,_-1,b)}}var f={1:function(m){return[m]},2:function(m){return function(_){return[m,_]}},3:function(m){return function(_){return function(g){return[m,_,g]}}},4:function(m){return function(_){return function(g){return function(S){return[m,_,g,S]}}}},5:function(m){return function(_){return function(g){return function(S){return function(b){return[m,_,g,S,b]}}}}}};function d(m){return i.has.call(f,m)||(f[m]=l(r.tuple,m-1,[])),f[m]}function p(m){return function(){for(var _=[],g=0;g<arguments.length;g++)_[g]=arguments[g];for(var S=_.length,b=d(S),$=m.map(_[0],b),T=1;T<S;T++)$=m.ap($,_[T]);return $}}vn.sequenceT=p;function h(m){var _=m.length;switch(_){case 1:return function(g){var S;return S={},S[m[0]]=g,S};case 2:return function(g){return function(S){var b;return b={},b[m[0]]=g,b[m[1]]=S,b}};case 3:return function(g){return function(S){return function(b){var $;return $={},$[m[0]]=g,$[m[1]]=S,$[m[2]]=b,$}}};case 4:return function(g){return function(S){return function(b){return function($){var T;return T={},T[m[0]]=g,T[m[1]]=S,T[m[2]]=b,T[m[3]]=$,T}}}};case 5:return function(g){return function(S){return function(b){return function($){return function(T){var M;return M={},M[m[0]]=g,M[m[1]]=S,M[m[2]]=b,M[m[3]]=$,M[m[4]]=T,M}}}}};default:return l(function(){for(var g=[],S=0;S<arguments.length;S++)g[S]=arguments[S];for(var b={},$=0;$<_;$++)b[m[$]]=g[$];return b},_-1,[])}}function v(m){return function(_){for(var g=Object.keys(_),S=g.length,b=h(g),$=m.map(_[g[0]],b),T=1;T<S;T++)$=m.ap($,_[g[T]]);return $}}return vn.sequenceS=v,vn}var Ti={},AB;function KO(){if(AB)return Ti;AB=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.getFunctorComposition=Ti.bindTo=Ti.flap=Ti.map=void 0;var e=Qe();function t(o,a){return function(u){return function(s){return o.map(s,function(c){return a.map(c,u)})}}}Ti.map=t;function n(o){return function(a){return function(u){return o.map(u,function(s){return s(a)})}}}Ti.flap=n;function r(o){return function(a){return function(u){return o.map(u,function(s){var c;return c={},c[a]=s,c})}}}Ti.bindTo=r;function i(o,a){var u=t(o,a);return{map:function(s,c){return(0,e.pipe)(s,u(c))}}}return Ti.getFunctorComposition=i,Ti}var NB;function Aye(){if(NB)return Ps;NB=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.getApplicativeComposition=Ps.getApplicativeMonoid=void 0;var e=kB(),t=Qe(),n=KO();function r(o){var a=(0,e.getApplySemigroup)(o);return function(u){return{concat:a(u).concat,empty:o.of(u.empty)}}}Ps.getApplicativeMonoid=r;function i(o,a){var u=(0,n.getFunctorComposition)(o,a).map,s=(0,e.ap)(o,a);return{map:u,of:function(c){return o.of(a.of(c))},ap:function(c,l){return(0,t.pipe)(c,s(l))}}}return Ps.getApplicativeComposition=i,Ps}var Ws={},FB;function PB(){if(FB)return Ws;FB=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.bind=Ws.chainFirst=void 0;function e(n){return function(r){return function(i){return n.chain(i,function(o){return n.map(r(o),function(){return o})})}}}Ws.chainFirst=e;function t(n){return function(r,i){return function(o){return n.chain(o,function(a){return n.map(i(a),function(u){var s;return Object.assign({},a,(s={},s[r]=u,s))})})}}}return Ws.bind=t,Ws}var Gp={},WB;function Nye(){if(WB)return Gp;WB=1,Object.defineProperty(Gp,"__esModule",{value:!0}),Gp.tailRec=void 0;var e=function(t,n){for(var r=n(t);r._tag==="Left";)r=n(r.left);return r.right};return Gp.tailRec=e,Gp}var Kt={},jB;function Fye(){if(jB)return Kt;jB=1;var e=he&&he.__createBinding||(Object.create?function(h,v,m,_){_===void 0&&(_=m);var g=Object.getOwnPropertyDescriptor(v,m);(!g||("get"in g?!v.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return v[m]}}),Object.defineProperty(h,_,g)}:function(h,v,m,_){_===void 0&&(_=m),h[_]=v[m]}),t=he&&he.__setModuleDefault||(Object.create?function(h,v){Object.defineProperty(h,"default",{enumerable:!0,value:v})}:function(h,v){h.default=v}),n=he&&he.__importStar||function(h){if(h&&h.__esModule)return h;var v={};if(h!=null)for(var m in h)m!=="default"&&Object.prototype.hasOwnProperty.call(h,m)&&e(v,h,m);return t(v,h),v};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.filterOrElse=Kt.chainFirstEitherK=Kt.chainEitherK=Kt.fromEitherK=Kt.chainOptionK=Kt.fromOptionK=Kt.fromPredicate=Kt.fromOption=void 0;var r=PB(),i=Qe(),o=n(my());function a(h){return function(v){return function(m){return h.fromEither(o.isNone(m)?o.left(v()):o.right(m.value))}}}Kt.fromOption=a;function u(h){return function(v,m){return function(_){return h.fromEither(v(_)?o.right(_):o.left(m(_)))}}}Kt.fromPredicate=u;function s(h){var v=a(h);return function(m){var _=v(m);return function(g){return(0,i.flow)(g,_)}}}Kt.fromOptionK=s;function c(h,v){var m=s(h);return function(_){var g=m(_);return function(S){return function(b){return v.chain(b,g(S))}}}}Kt.chainOptionK=c;function l(h){return function(v){return(0,i.flow)(v,h.fromEither)}}Kt.fromEitherK=l;function f(h,v){var m=l(h);return function(_){return function(g){return v.chain(g,m(_))}}}Kt.chainEitherK=f;function d(h,v){return(0,i.flow)(l(h),(0,r.chainFirst)(v))}Kt.chainFirstEitherK=d;function p(h,v){return function(m,_){return function(g){return v.chain(g,function(S){return h.fromEither(m(S)?o.right(S):o.left(_(S)))})}}}return Kt.filterOrElse=p,Kt}var VO={},LB;function Pye(){return LB||(LB=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Qe(),n=KO(),r=function(d,p){return{left:d,right:p}};e.separated=r;var i=function(d,p){return(0,t.pipe)(d,(0,e.map)(p))},o=function(d,p){return(0,t.pipe)(d,(0,e.mapLeft)(p))},a=function(d,p,h){return(0,t.pipe)(d,(0,e.bimap)(p,h))},u=function(d){return function(p){return(0,e.separated)((0,e.left)(p),d((0,e.right)(p)))}};e.map=u;var s=function(d){return function(p){return(0,e.separated)(d((0,e.left)(p)),(0,e.right)(p))}};e.mapLeft=s;var c=function(d,p){return function(h){return(0,e.separated)(d((0,e.left)(h)),p((0,e.right)(h)))}};e.bimap=c,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var l=function(d){return d.left};e.left=l;var f=function(d){return d.right};e.right=f}(VO)),VO}var oa={},DB;function Wye(){if(DB)return oa;DB=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c);var f=Object.getOwnPropertyDescriptor(s,c);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[c]}}),Object.defineProperty(u,l,f)}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)c!=="default"&&Object.prototype.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(oa,"__esModule",{value:!0}),oa.filterE=oa.witherDefault=oa.wiltDefault=void 0;var r=n(my());function i(u,s){return function(c){var l=u.traverse(c);return function(f,d){return c.map(l(f,d),s.separate)}}}oa.wiltDefault=i;function o(u,s){return function(c){var l=u.traverse(c);return function(f,d){return c.map(l(f,d),s.compact)}}}oa.witherDefault=o;function a(u){return function(s){var c=u.wither(s);return function(l){return function(f){return c(f,function(d){return s.map(l(d),function(p){return p?r.some(d):r.none})})}}}}return oa.filterE=a,oa}var qB;function Ln(){return qB||(qB=1,function(e){var t=he&&he.__createBinding||(Object.create?function(P,A,L,Pe){Pe===void 0&&(Pe=L);var W=Object.getOwnPropertyDescriptor(A,L);(!W||("get"in W?!A.__esModule:W.writable||W.configurable))&&(W={enumerable:!0,get:function(){return A[L]}}),Object.defineProperty(P,Pe,W)}:function(P,A,L,Pe){Pe===void 0&&(Pe=L),P[Pe]=A[L]}),n=he&&he.__setModuleDefault||(Object.create?function(P,A){Object.defineProperty(P,"default",{enumerable:!0,value:A})}:function(P,A){P.default=A}),r=he&&he.__importStar||function(P){if(P&&P.__esModule)return P;var A={};if(P!=null)for(var L in P)L!=="default"&&Object.prototype.hasOwnProperty.call(P,L)&&t(A,P,L);return n(A,P),A};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=Aye(),o=kB(),a=PB(),u=Nye(),s=Fye(),c=Qe(),l=KO(),f=r(my()),d=Pye(),p=Wye();e.left=f.left,e.right=f.right;var h=function(P,A){return(0,c.pipe)(P,(0,e.map)(A))},v=function(P,A){return(0,c.pipe)(P,(0,e.ap)(A))},m=function(P,A){return(0,c.pipe)(P,(0,e.chain)(A))},_=function(P,A,L){return(0,c.pipe)(P,(0,e.reduce)(A,L))},g=function(P){return function(A,L){var Pe=(0,e.foldMap)(P);return(0,c.pipe)(A,Pe(L))}},S=function(P,A,L){return(0,c.pipe)(P,(0,e.reduceRight)(A,L))},b=function(P){var A=(0,e.traverse)(P);return function(L,Pe){return(0,c.pipe)(L,A(Pe))}},$=function(P,A,L){return(0,c.pipe)(P,(0,e.bimap)(A,L))},T=function(P,A){return(0,c.pipe)(P,(0,e.mapLeft)(A))},M=function(P,A){return(0,c.pipe)(P,(0,e.alt)(A))},R=function(P,A){return(0,c.pipe)(P,(0,e.extend)(A))},q=function(P,A){return(0,u.tailRec)(A(P),function(L){return(0,e.isLeft)(L)?(0,e.right)((0,e.left)(L.left)):(0,e.isLeft)(L.right)?(0,e.left)(A(L.right.left)):(0,e.right)((0,e.right)(L.right.right))})};e.URI="Either";var Y=function(P,A){return{show:function(L){return(0,e.isLeft)(L)?"left(".concat(P.show(L.left),")"):"right(".concat(A.show(L.right),")")}}};e.getShow=Y;var N=function(P,A){return{equals:function(L,Pe){return L===Pe||((0,e.isLeft)(L)?(0,e.isLeft)(Pe)&&P.equals(L.left,Pe.left):(0,e.isRight)(Pe)&&A.equals(L.right,Pe.right))}}};e.getEq=N;var Z=function(P){return{concat:function(A,L){return(0,e.isLeft)(L)?A:(0,e.isLeft)(A)?L:(0,e.right)(P.concat(A.right,L.right))}}};e.getSemigroup=Z;var ie=function(P){var A=(0,e.left)(P.empty);return{URI:e.URI,_E:void 0,compact:function(L){return(0,e.isLeft)(L)?L:L.right._tag==="None"?A:(0,e.right)(L.right.value)},separate:function(L){return(0,e.isLeft)(L)?(0,d.separated)(L,L):(0,e.isLeft)(L.right)?(0,d.separated)((0,e.right)(L.right.left),A):(0,d.separated)(A,(0,e.right)(L.right.right))}}};e.getCompactable=ie;var J=function(P){var A=(0,e.left)(P.empty),L=(0,e.getCompactable)(P),Pe=L.compact,W=L.separate,ae=function(ve,Ce){return(0,e.isLeft)(ve)||Ce(ve.right)?ve:A},ge=function(ve,Ce){return(0,e.isLeft)(ve)?(0,d.separated)(ve,ve):Ce(ve.right)?(0,d.separated)(A,(0,e.right)(ve.right)):(0,d.separated)((0,e.right)(ve.right),A)};return{URI:e.URI,_E:void 0,map:h,compact:Pe,separate:W,filter:ae,filterMap:function(ve,Ce){if((0,e.isLeft)(ve))return ve;var ct=Ce(ve.right);return ct._tag==="None"?A:(0,e.right)(ct.value)},partition:ge,partitionMap:function(ve,Ce){if((0,e.isLeft)(ve))return(0,d.separated)(ve,ve);var ct=Ce(ve.right);return(0,e.isLeft)(ct)?(0,d.separated)((0,e.right)(ct.left),A):(0,d.separated)(A,(0,e.right)(ct.right))}}};e.getFilterable=J;var ye=function(P){var A=(0,e.getFilterable)(P),L=(0,e.getCompactable)(P);return{URI:e.URI,_E:void 0,map:h,compact:A.compact,separate:A.separate,filter:A.filter,filterMap:A.filterMap,partition:A.partition,partitionMap:A.partitionMap,traverse:b,sequence:e.sequence,reduce:_,foldMap:g,reduceRight:S,wither:(0,p.witherDefault)(e.Traversable,L),wilt:(0,p.wiltDefault)(e.Traversable,L)}};e.getWitherable=ye;var we=function(P){return{URI:e.URI,_E:void 0,map:h,ap:function(A,L){return(0,e.isLeft)(A)?(0,e.isLeft)(L)?(0,e.left)(P.concat(A.left,L.left)):A:(0,e.isLeft)(L)?L:(0,e.right)(A.right(L.right))},of:e.of}};e.getApplicativeValidation=we;var x=function(P){return{URI:e.URI,_E:void 0,map:h,alt:function(A,L){if((0,e.isRight)(A))return A;var Pe=L();return(0,e.isLeft)(Pe)?(0,e.left)(P.concat(A.left,Pe.left)):Pe}}};e.getAltValidation=x;var k=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.right)(P(A.right))}};e.map=k,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var E=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.isLeft)(P)?P:(0,e.right)(A.right(P.right))}};e.apW=E,e.ap=e.apW,e.Apply={URI:e.URI,map:h,ap:v},e.Applicative={URI:e.URI,map:h,ap:v,of:e.of};var O=function(P){return function(A){return(0,e.isLeft)(A)?A:P(A.right)}};e.chainW=O,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:m},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:m};var F=function(P,A){return function(L){return(0,e.isLeft)(L)?P:A(P,L.right)}};e.reduce=F;var j=function(P){return function(A){return function(L){return(0,e.isLeft)(L)?P.empty:A(L.right)}}};e.foldMap=j;var X=function(P,A){return function(L){return(0,e.isLeft)(L)?P:A(L.right,P)}};e.reduceRight=X,e.Foldable={URI:e.URI,reduce:_,foldMap:g,reduceRight:S};var te=function(P){return function(A){return function(L){return(0,e.isLeft)(L)?P.of((0,e.left)(L.left)):P.map(A(L.right),e.right)}}};e.traverse=te;var xe=function(P){return function(A){return(0,e.isLeft)(A)?P.of((0,e.left)(A.left)):P.map(A.right,e.right)}};e.sequence=xe,e.Traversable={URI:e.URI,map:h,reduce:_,foldMap:g,reduceRight:S,traverse:b,sequence:e.sequence};var ce=function(P,A){return function(L){return(0,e.isLeft)(L)?(0,e.left)(P(L.left)):(0,e.right)(A(L.right))}};e.bimap=ce;var Ne=function(P){return function(A){return(0,e.isLeft)(A)?(0,e.left)(P(A.left)):A}};e.mapLeft=Ne,e.Bifunctor={URI:e.URI,bimap:$,mapLeft:T};var ze=function(P){return function(A){return(0,e.isLeft)(A)?P():A}};e.altW=ze,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:M};var He=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.right)(P(A))}};e.extend=He,e.Extend={URI:e.URI,map:h,extend:R},e.ChainRec={URI:e.URI,map:h,ap:v,chain:m,chainRec:q},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:m,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:c.identity},e.fromPredicate=(0,s.fromPredicate)(e.FromEither),e.fromOption=(0,s.fromOption)(e.FromEither),e.isLeft=f.isLeft,e.isRight=f.isRight;var it=function(P,A){return function(L){return(0,e.isLeft)(L)?P(L.left):A(L.right)}};e.matchW=it,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Ft=function(P){return function(A){return(0,e.isLeft)(A)?P(A.left):A.right}};e.getOrElseW=Ft,e.getOrElse=e.getOrElseW,e.flap=(0,l.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(c.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(c.identity),e.fromOptionK=(0,s.fromOptionK)(e.FromEither),e.chainOptionK=(0,s.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,s.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var qt=function(P){return(0,e.isLeft)(P)?(0,e.right)(P.left):(0,e.left)(P.right)};e.swap=qt;var Ht=function(P){return function(A){return(0,e.isLeft)(A)?P(A.left):A}};e.orElseW=Ht,e.orElse=e.orElseW;var xn=function(P){return function(A){return A==null?(0,e.left)(P):(0,e.right)(A)}};e.fromNullable=xn;var Nr=function(P,A){try{return(0,e.right)(P())}catch(L){return(0,e.left)(A(L))}};e.tryCatch=Nr;var fr=function(P,A){return function(){for(var L=[],Pe=0;Pe<arguments.length;Pe++)L[Pe]=arguments[Pe];return(0,e.tryCatch)(function(){return P.apply(void 0,L)},A)}};e.tryCatchK=fr;var Q=function(P){var A=(0,e.fromNullable)(P);return function(L){return(0,c.flow)(L,A)}};e.fromNullableK=Q;var re=function(P){var A=(0,e.fromNullableK)(P);return function(L){return(0,e.chain)(A(L))}};e.chainNullableK=re,e.toUnion=(0,e.foldW)(c.identity,c.identity);function ke(P){return P instanceof Error?P:new Error(String(P))}e.toError=ke;function Ot(P){return function(A,L){if(L===void 0){var Pe=Ot(P);return function(W){return Pe(A,W)}}return(0,e.isLeft)(L)?!1:P.equals(A,L.right)}}e.elem=Ot;var ei=function(P){return function(A){return(0,e.isLeft)(A)?!1:P(A.right)}};e.exists=ei,e.Do=(0,e.of)(f.emptyRecord),e.bindTo=(0,l.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(f.emptyReadonlyArray);var Ui=function(P){return function(A){var L=P(0,f.head(A));if((0,e.isLeft)(L))return L;for(var Pe=[L.right],W=1;W<A.length;W++){var ae=P(W,A[W]);if((0,e.isLeft)(ae))return ae;Pe.push(ae.right)}return(0,e.right)(Pe)}};e.traverseReadonlyNonEmptyArrayWithIndex=Ui;var Bi=function(P){var A=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(P);return function(L){return f.isNonEmpty(L)?A(L):e.ApT}};e.traverseReadonlyArrayWithIndex=Bi,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var wa=function(P){return(0,e.traverseReadonlyArrayWithIndex)(function(A,L){return P(L)})};e.traverseArray=wa,e.sequenceArray=(0,e.traverseArray)(c.identity);function Ca(P,A){return(0,e.tryCatch)(function(){return JSON.parse(P)},A)}e.parseJSON=Ca;var Ea=function(P,A){return(0,e.tryCatch)(function(){var L=JSON.stringify(P);if(typeof L!="string")throw new Error("Converting unsupported structure to JSON");return L},A)};e.stringifyJSON=Ea,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:m,reduce:_,foldMap:g,reduceRight:S,traverse:b,sequence:e.sequence,bimap:$,mapLeft:T,alt:M,extend:R,chainRec:q,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var ti=function(P,A){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(P))(A)};e.getValidationSemigroup=ti;var ju=function(P,A){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(P))(A)};e.getValidationMonoid=ju;function Df(P){var A=(0,e.getApplicativeValidation)(P).ap,L=(0,e.getAltValidation)(P).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:m,bimap:$,mapLeft:T,reduce:_,foldMap:g,reduceRight:S,extend:R,traverse:b,sequence:e.sequence,chainRec:q,throwError:e.throwError,ap:A,alt:L}}e.getValidation=Df}(BO)),BO}var et=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ql=globalThis&&globalThis.__assign||function(){return Ql=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ql.apply(this,arguments)},jye=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},co=Tt,tt=function(e,t,n){return co([{value:e,context:t,message:n}])},Ee=Ye,Te=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return le(a)?a:t.validate(a.right,o)},this.encode===Ue&&t.encode===Ue?Ue:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),Ue=function(e){return e};function UB(e){return e.displayName||e.name||"<function".concat(e.length,">")}function Lye(e,t){return{key:e,type:t}}function Ii(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function aa(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var js=Object.prototype.hasOwnProperty;function HO(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Yp(e){for(var t=0;t<e.length;t++)if(e[t].encode!==Ue)return!1;return!0}function BB(e){return"{ ".concat(HO(e)," }")}function zB(e){return"Partial<".concat(e,">")}function Dye(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new nw(r,function(o){return Dn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c={},l=[],f=!1,d=0;d<i;d++){var p=e[d],h=s[p],v=n.validate(h,Ii(a,p,n,h));if(le(v))aa(l,v.left);else{var m=v.right;f=f||m!==h,c[p]=m}}return l.length>0?co(l):Ee(f||Object.keys(s).length!==i?c:s)},n.encode===Ue?Ue:function(o){for(var a={},u=0;u<i;u++){var s=e[u];a[s]=n.encode(o[s])}return a},t,n)}function GO(e){var t;if(YB(e)){var n=e.value;if(Oi.is(n))return t={},t[n]=null,t}else{if(Vye(e))return e.keys;if(ZB(e)){var r=e.types.map(function(i){return GO(i)});return r.some(vy.is)?void 0:Object.assign.apply(Object,jye([{}],r,!1))}}}function qye(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new nw(n,function(r){return Dn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):GB(t)&&Array.isArray(r)},function(r,i){if(Dn.is(r)){for(var o={},a=[],u=Object.keys(r),s=u.length,c=!1,l=0;l<s;l++){var f=u[l],d=r[f],p=e.validate(f,Ii(i,f,e,f));if(le(p))aa(a,p.left);else{var h=p.right;c=c||h!==f,f=h;var v=t.validate(d,Ii(i,f,t,d));if(le(v))aa(a,v.left);else{var m=v.right;c=c||m!==d,o[f]=m}}}return a.length>0?co(a):Ee(c?o:r)}return GB(t)&&Array.isArray(r)?Ee(r):tt(r,i)},e.encode===Ue&&t.encode===Ue?Ue:function(r){for(var i={},o=Object.keys(r),a=o.length,u=0;u<a;u++){var s=o[u];i[String(e.encode(s))]=t.encode(r[s])}return i},e,t)}function KB(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function YO(e,t){for(var n=!0,r=!0,i=!Dn.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),Dn.is(u)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var s={},c=0,l=t;c<l.length;c++){var u=l[c];for(var f in u)(!js.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function JO(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return JO(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,JO(n))},{})}}function VB(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];js.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function Uye(e){return JB(e)?"{| ".concat(HO(e.props)," |}"):Hye(e)?zB("{| ".concat(HO(e.props)," |}")):"Exact<".concat(e.name,">")}function Bye(e){return e.length>0}var ar={};function HB(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function zye(e,t){if(e===ar)return t;if(t===ar)return e;var n=Object.assign({},e);for(var r in t)if(js.call(e,r)){var i=HB(e[r],t[r]);if(Bye(i))n[r]=i;else{n=ar;break}}else n[r]=t[r];return n}function Kye(e,t){if(e===ar||t===ar)return ar;var n=ar;for(var r in e)if(js.call(t,r)){var i=HB(e[r],t[r]);i.length===0&&(n===ar&&(n={}),n[r]=e[r].concat(t[r]))}return n}function GB(e){return e._tag==="AnyType"}function YB(e){return e._tag==="LiteralType"}function Vye(e){return e._tag==="KeyofType"}function JB(e){return e._tag==="InterfaceType"}function Hye(e){return e._tag==="PartialType"}function Gye(e){return e._tag==="StrictType"}function Yye(e){return e._tag==="ExactType"}function Jye(e){return e._tag==="RefinementType"}function Zye(e){return e._tag==="IntersectionType"}function ZB(e){return e._tag==="UnionType"}function Xye(e){return e._tag==="RecursiveType"}var ZO=[];function au(e){if(ZO.indexOf(e)!==-1)return ar;if(JB(e)||Gye(e)){var t=ar;for(var n in e.props){var r=e.props[n];YB(r)&&(t===ar&&(t={}),t[n]=[r.value])}return t}else{if(Yye(e)||Jye(e))return au(e.type);if(Zye(e))return e.types.reduce(function(o,a){return zye(o,au(a))},ar);if(ZB(e))return e.types.slice(1).reduce(function(o,a){return Kye(o,au(a))},au(e.types[0]));if(Xye(e)){ZO.push(e);var i=au(e.type);return ZO.pop(),i}}return ar}function XB(e){var t=au(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),f=[t[c]],d=1;d<r;d++){var p=e[d],h=au(p),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(m){return l.indexOf(m)!==-1}))return"continue-keys";l.push.apply(l,v),f.push(v)}return{value:[c,f]}};e:for(var o=0,a=n;o<a.length;o++){var u=a[o],s=i(u);if(typeof s=="object")return s.value;switch(s){case"continue-keys":continue e}}}var QB=function(e){et(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="NullType",n}return t}(Te),XO=new QB,e2=function(e){et(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="UndefinedType",n}return t}(Te),vy=new e2,t2=function(e){et(t,e);function t(){var n=e.call(this,"void",vy.is,vy.validate,Ue)||this;return n._tag="VoidType",n}return t}(Te),n2=new t2,r2=function(e){et(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ee,Ue)||this;return n._tag="UnknownType",n}return t}(Te),Qye=new r2,i2=function(e){et(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="StringType",n}return t}(Te),Oi=new i2,o2=function(e){et(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="NumberType",n}return t}(Te),Ls=new o2,a2=function(e){et(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="BigIntType",n}return t}(Te),ebe=new a2,u2=function(e){et(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="BooleanType",n}return t}(Te),gy=new u2,s2=function(e){et(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="AnyArrayType",n}return t}(Te),ef=new s2,c2=function(e){et(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="AnyDictionaryType",n}return t}(Te),Dn=new c2,l2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return t}(Te);function Jp(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new l2(t,n,function(r,i){return n(r)?Ee(e):tt(r,i)},Ue,e)}var f2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return t}(Te);function tbe(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return Oi.is(r)&&js.call(e,r)};return new f2(t,n,function(r,i){return n(r)?Ee(r):tt(r,i)},Ue,e)}var d2=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return t}(Te);function yy(e,t,n){return ow(e,t,n)}var by=yy(Ls,function(e){return Number.isInteger(e)},"Int"),QO=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return t}(Te);Object.defineProperty(QO.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function ew(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new QO(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var p2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return t}(Te);function _y(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new p2(t,function(n){return ef.is(n)&&n.every(e.is)},function(n,r){var i=ef.validate(n,r);if(le(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=e.validate(l,Ii(r,String(c),e,l));if(le(f))aa(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?co(s):Ee(u)},e.encode===Ue?Ue:function(n){return n.map(e.encode)},e)}var h2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return t}(Te);function tw(e,t){t===void 0&&(t=BB(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new h2(t,function(o){if(Dn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!js.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=r[f],v=h.validate(p,Ii(a,d,h,p));if(le(v))aa(l,v.left);else{var m=v.right;(m!==p||m===void 0&&!js.call(c,d))&&(c===s&&(c=Ql({},s)),c[d]=m)}}return l.length>0?co(l):Ee(c)},Yp(r)?Ue:function(o){for(var a=Ql({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==Ue&&(a[s]=c(o[s]))}return a},e)}var m2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return t}(Te);function nbe(e,t){t===void 0&&(t=zB(BB(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new m2(t,function(o){if(Dn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s!==void 0&&!e[u].is(s))return!1}return!0}return!1},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=e[d],v=h.validate(p,Ii(a,d,h,p));if(le(v))p!==void 0&&aa(l,v.left);else{var m=v.right;m!==p&&(c===s&&(c=Ql({},s)),c[d]=m)}}return l.length>0?co(l):Ee(c)},Yp(r)?Ue:function(o){for(var a=Ql({},o),u=0;u<i;u++){var s=n[u],c=o[s];c!==void 0&&(a[s]=r[u].encode(c))}return a},e)}var nw=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return t}(Te);function rw(e,t,n){var r=GO(e);return r?Dye(Object.keys(r),e,t,n):qye(e,t,n)}var iw=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return t}(Te);function Zp(e,t){t===void 0&&(t=KB(e));var n=XB(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(u){for(var s=0;s<o;s++)if(i[s].indexOf(u)!==-1)return s};return new Sy(t,function(u){if(Dn.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=Dn.validate(u,s);if(le(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return tt(u,s);var d=e[f];return d.validate(l,Ii(s,String(f),d,l))},Yp(e)?Ue:function(u){var s=a(u[r]);if(s===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[s].encode(u)},e,r)}else return new iw(t,function(u){return e.some(function(s){return s.is(u)})},function(u,s){for(var c=[],l=0;l<e.length;l++){var f=e[l],d=f.validate(u,Ii(s,String(l),f,u));if(le(d))aa(c,d.left);else return Ee(d.right)}return co(c)},Yp(e)?Ue:function(u){for(var s=0,c=e;s<c.length;s++){var l=c[s];if(l.is(u))return l.encode(u)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var v2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return t}(Te);function rbe(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new v2(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ee:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,Ii(i,String(u),s,r));le(c)?aa(a,c.left):o.push(c.right)}return a.length>0?co(a):Ee(YO(r,o))},e.length===0?Ue:function(r){return YO(r,e.map(function(i){return i.encode(r)}))},e)}var g2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return t}(Te);function ibe(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new g2(t,function(r){return ef.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=ef.validate(r,i);if(le(o))return o;for(var a=o.right,u=a.length>n?a.slice(0,n):a,s=[],c=0;c<n;c++){var l=a[c],f=e[c],d=f.validate(l,Ii(i,String(c),f,l));if(le(d))aa(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?co(s):Ee(u)},Yp(e)?Ue:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var y2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return t}(Te);function obe(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new y2(t,e.is,e.validate,e.encode,e)}var b2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return t}(Te);function _2(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=_y(e);return new b2(t,n.is,n.validate,n.encode,e)}var Xp=function(e,t){return $2(tw(e),t)},S2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return t}(Te);function $2(e,t){t===void 0&&(t=Uye(e));var n=JO(e);return new S2(t,e.is,function(r,i){var o=Dn.validate(r,i);if(le(o))return o;var a=e.validate(r,i);return le(a)?a:Ye(VB(a.right,n))},function(r){return e.encode(VB(r,n))},e)}var T2=function(e){et(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="FunctionType",n}return t}(Te),abe=new T2,Sy=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o,a)||this;return s.tag=u,s}return t}(iw),ube=function(e,t,n){n===void 0&&(n=KB(t));var r=Zp(t,n);return r instanceof Sy?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new Sy(n,r.is,r.validate,r.encode,t,e))},sbe=function(e,t){return{value:e,context:t}},I2=function(e){return[{key:"",type:e}]},O2=function(e){et(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return tt(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(Te),cbe=new O2,w2=function(e){et(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ee,Ue)||this;return n._tag="AnyType",n}return t}(Te),lbe=new w2,fbe=Dn,C2=function(e){et(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="ObjectType",n}return t}(Te),dbe=new C2;function ow(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(UB(t),")")),new d2(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(le(o))return o;var a=o.right;return t(a)?Ee(a):tt(a,i)},e.encode,e,t)}var pbe=ow(Ls,Number.isInteger,"Integer"),hbe=rw,mbe=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return t}(Te);function vbe(e){return e}function gbe(e){return function(){return e}}const ee=wc(Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:s2,AnyDictionaryType:c2,AnyType:w2,Array:ef,ArrayType:p2,BigIntType:a2,BooleanType:u2,Dictionary:fbe,DictionaryType:nw,ExactType:S2,Function:abe,FunctionType:T2,Int:by,Integer:pbe,InterfaceType:h2,IntersectionType:v2,KeyofType:f2,LiteralType:l2,NeverType:O2,NullType:QB,NumberType:o2,ObjectType:C2,PartialType:m2,ReadonlyArrayType:b2,ReadonlyType:y2,RecursiveType:QO,RefinementType:d2,StrictType:mbe,StringType:i2,TaggedUnionType:Sy,TupleType:g2,Type:Te,UndefinedType:e2,UnionType:iw,UnknownArray:ef,UnknownRecord:Dn,UnknownType:r2,VoidType:t2,alias:gbe,any:lbe,appendContext:Ii,array:_y,bigint:ebe,boolean:gy,brand:yy,clean:vbe,dictionary:hbe,emptyTags:ar,exact:$2,failure:tt,failures:co,getContextEntry:Lye,getDefaultContext:I2,getDomainKeys:GO,getFunctionName:UB,getIndex:XB,getTags:au,getValidationError:sbe,identity:Ue,interface:tw,intersection:rbe,keyof:tbe,literal:Jp,mergeAll:YO,never:cbe,null:XO,nullType:XO,number:Ls,object:dbe,partial:nbe,readonly:obe,readonlyArray:_2,record:rw,recursion:ew,refinement:ow,strict:Xp,string:Oi,success:Ee,taggedUnion:ube,tuple:ibe,type:tw,undefined:vy,union:Zp,unknown:Qye,void:n2,voidType:n2},Symbol.toStringTag,{value:"Module"})));var aw={},Qp={},At={};const wi=wc(nM);function E2(e,t,n){return n===void 0&&(n=e.name),new Te(n,e.is,e.validate,function(r){return t(e.encode(r))})}const ybe=wc(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:E2},Symbol.toStringTag,{value:"Module"})));var R2;function uu(){if(R2)return At;R2=1,Object.defineProperty(At,"__esModule",{value:!0}),At.addType=At.isEmpty=At.objectToMap=At.grouped=At.formatDate=At.formatDateTime=At.filterDouble=At.refineType=At.nullable=void 0;const e=H,t=mt,n=wi,r=e.__importStar(ee),i=ybe;function o(h){return r.union([h,r.null,r.undefined])}At.nullable=o;function a(h,v,m){return new r.Type(v,h.is,(_,g)=>(0,n.pipe)(h.validate(_,g),t.either.chain(S=>m(S)?r.success(S):r.failure(_,g))),h.encode)}At.refineType=a;function u(h){if(h==="")return null;const v=Number(h);return Number.isNaN(v)?null:v}At.filterDouble=u;function s(h){return h.toISOString().replace(/\.\d{3}Z$/,"+0000")}At.formatDateTime=s;function c(h){return h.toISOString().replace(/T.*/,"")}At.formatDate=c;function l(h,v){return h.reduce((m,_,g)=>(g%v===0?m.push([_]):m[Math.floor(g/v)].push(_),m),new Array)}At.grouped=l;function f(h){return new Map(Object.entries(h))}At.objectToMap=f;function d(h){for(const v in h)return!1;return!0}At.isEmpty=d;function p(h,v){return(0,i.mapOutput)(h,m=>({...m,__TYPE__:v}))}return At.addType=p,At}var M2;function bbe(){if(M2)return Qp;M2=1,Object.defineProperty(Qp,"__esModule",{value:!0}),Qp.WidgetKey=void 0;const t=H.__importStar(ee),n=uu(),r=new RegExp("^[^<>]+$");return Qp.WidgetKey=(0,n.refineType)(t.string,"WidgetKey",i=>i.length===0||r.test(i)),Qp}var x2;function tf(){return x2||(x2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),H.__exportStar(bbe(),e)}(aw)),aw}var uw={},sw={},Ci={},cw={},lw={},fw={},$y={};const ua=wc(cF);var k2;function _be(){if(k2)return $y;k2=1,Object.defineProperty($y,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=e.__importStar(ee);return $y.default=new r.Type("dateFromString",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.string.validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i.toISOString()),$y}var Ty={},A2;function Sbe(){if(A2)return Ty;A2=1,Object.defineProperty(Ty,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=e.__importStar(ee);return Ty.default=new r.Type("dateFromStringOrNumber",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.union([r.number,r.string]).validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i),Ty}var Iy={},N2;function $be(){if(N2)return Iy;N2=1,Object.defineProperty(Iy,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=e.__importStar(ee);return Iy.default=new r.Type("dateFromTsMs",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i.getTime()),Iy}var Oy={},F2;function Tbe(){if(F2)return Oy;F2=1,Object.defineProperty(Oy,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=e.__importStar(ee);return Oy.default=new r.Type("IntFromNumber",r.Int.is,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>r.Int.is(a)?r.success(a):r.success(Math.round(a)))),r.Int.encode),Oy}var wy={},P2;function Ibe(){if(P2)return wy;P2=1,Object.defineProperty(wy,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=e.__importStar(ee),i=/^([0-9]+)px$/;return wy.default=new r.Type("IntFromPixels",r.Int.is,(o,a)=>(0,n.pipe)(r.string.validate(o,a),(0,t.chain)(u=>{try{const s=u.match(i);if(!s)return r.failure(o,a);const c=parseInt(s[1]);return r.success(c)}catch{return r.failure(o,a)}})),String),wy}var Cy={},W2;function Obe(){if(W2)return Cy;W2=1,Object.defineProperty(Cy,"__esModule",{value:!0});const t=H.__importStar(ee),n=uu();return Cy.default=(0,n.refineType)(t.string,"nonEmptyString",r=>r.trim().length>0),Cy}var Ey={},Ry={},j2;function L2(){if(j2)return Ry;j2=1,Object.defineProperty(Ry,"__esModule",{value:!0});const t=H.__importStar(ee),n=uu();return Ry.default=(0,n.nullable)(t.string),Ry}var D2;function wbe(){if(D2)return Ey;D2=1,Object.defineProperty(Ey,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=ee,i=e.__importDefault(L2());return Ey.default=new r.Type("nonEmptyStringOrNull",o=>typeof o=="string"||o===null,(o,a)=>(0,n.pipe)(i.default.validate(o,a),(0,t.chain)(u=>typeof u=="string"&&u.length>0?(0,r.success)(u):(0,r.success)(null))),o=>o),Ey}var My={},q2;function Cbe(){if(q2)return My;q2=1,Object.defineProperty(My,"__esModule",{value:!0});const t=H.__importStar(ee),n=uu();return My.default=(0,n.nullable)(t.number),My}var xy={},U2;function Ebe(){if(U2)return xy;U2=1,Object.defineProperty(xy,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=e.__importStar(ee);return xy.default=new r.Type("StringFromInt",r.string.is,(i,o)=>(0,n.pipe)(r.boolean.validate(i,o),(0,t.chain)(a=>r.success(a.toString()))),i=>i),xy}var ky={},B2;function Rbe(){if(B2)return ky;B2=1,Object.defineProperty(ky,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=e.__importStar(ee);return ky.default=new r.Type("StringFromInt",r.string.is,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>r.success(a.toString()))),i=>i),ky}var z2;function vt(){return z2||(z2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=H;var n=_be();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return t.__importDefault(n).default}});var r=Sbe();Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return t.__importDefault(r).default}});var i=$be();Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return t.__importDefault(i).default}}),e.Function=t.__importStar(uu());var o=Tbe();Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return t.__importDefault(o).default}});var a=Ibe();Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return t.__importDefault(a).default}});var u=Obe();Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return t.__importDefault(u).default}});var s=wbe();Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return t.__importDefault(s).default}});var c=Cbe();Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return t.__importDefault(c).default}});var l=Ebe();Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return t.__importDefault(l).default}});var f=Rbe();Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return t.__importDefault(f).default}});var d=L2();Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return t.__importDefault(d).default}})}(fw)),fw}var eh={},dw={},K2;function V2(){return K2||(K2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=H.__importStar(ee),r=vt();e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))}(dw)),dw}var pw={},H2;function G2(){return H2||(H2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=H.__importStar(ee),r=vt();e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))}(pw)),pw}var hw={},Y2;function J2(){return Y2||(Y2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=H.__importStar(ee),r=vt();e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))}(hw)),hw}var mw={},Z2;function X2(){return Z2||(Z2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=H.__importStar(ee),r=vt();e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))}(mw)),mw}var vw={},Q2;function ez(){return Q2||(Q2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=H.__importStar(ee),r=vt();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))}(vw)),vw}var gw={},Ay={},th={},nh={},Ds={},tz;function nz(){if(tz)return Ds;tz=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.pipe=Ds.pipeable=void 0;var e=Qe(),t=function(g){return typeof g.map=="function"},n=function(g){return typeof g.contramap=="function"},r=function(g){return typeof g.mapWithIndex=="function"},i=function(g){return typeof g.ap=="function"},o=function(g){return typeof g.chain=="function"},a=function(g){return typeof g.bimap=="function"},u=function(g){return typeof g.extend=="function"},s=function(g){return typeof g.reduce=="function"},c=function(g){return typeof g.reduceWithIndex=="function"},l=function(g){return typeof g.alt=="function"},f=function(g){return typeof g.compact=="function"},d=function(g){return typeof g.filter=="function"},p=function(g){return typeof g.filterWithIndex=="function"},h=function(g){return typeof g.promap=="function"},v=function(g){return typeof g.compose=="function"},m=function(g){return typeof g.throwError=="function"};function _(g){var S={};if(t(g)){var b=function(Q){return function(re){return g.map(re,Q)}};S.map=b}if(n(g)){var $=function(Q){return function(re){return g.contramap(re,Q)}};S.contramap=$}if(r(g)){var T=function(Q){return function(re){return g.mapWithIndex(re,Q)}};S.mapWithIndex=T}if(i(g)){var M=function(Q){return function(re){return g.ap(re,Q)}},R=function(Q){return function(re){return g.ap(g.map(re,function(ke){return function(){return ke}}),Q)}};S.ap=M,S.apFirst=R,S.apSecond=function(Q){return function(re){return g.ap(g.map(re,function(){return function(ke){return ke}}),Q)}}}if(o(g)){var q=function(Q){return function(re){return g.chain(re,Q)}},Y=function(Q){return function(re){return g.chain(re,function(ke){return g.map(Q(ke),function(){return ke})})}},N=function(Q){return g.chain(Q,e.identity)};S.chain=q,S.chainFirst=Y,S.flatten=N}if(a(g)){var Z=function(Q,re){return function(ke){return g.bimap(ke,Q,re)}},ie=function(Q){return function(re){return g.mapLeft(re,Q)}};S.bimap=Z,S.mapLeft=ie}if(u(g)){var J=function(Q){return function(re){return g.extend(re,Q)}},ye=function(Q){return g.extend(Q,e.identity)};S.extend=J,S.duplicate=ye}if(s(g)){var we=function(Q,re){return function(ke){return g.reduce(ke,Q,re)}},x=function(Q){var re=g.foldMap(Q);return function(ke){return function(Ot){return re(Ot,ke)}}},k=function(Q,re){return function(ke){return g.reduceRight(ke,Q,re)}};S.reduce=we,S.foldMap=x,S.reduceRight=k}if(c(g)){var E=function(Q,re){return function(ke){return g.reduceWithIndex(ke,Q,re)}},O=function(Q){var re=g.foldMapWithIndex(Q);return function(ke){return function(Ot){return re(Ot,ke)}}},F=function(Q,re){return function(ke){return g.reduceRightWithIndex(ke,Q,re)}};S.reduceWithIndex=E,S.foldMapWithIndex=O,S.reduceRightWithIndex=F}if(l(g)){var j=function(Q){return function(re){return g.alt(re,Q)}};S.alt=j}if(f(g)&&(S.compact=g.compact,S.separate=g.separate),d(g)){var X=function(Q){return function(re){return g.filter(re,Q)}},te=function(Q){return function(re){return g.filterMap(re,Q)}},xe=function(Q){return function(re){return g.partition(re,Q)}},ce=function(Q){return function(re){return g.partitionMap(re,Q)}};S.filter=X,S.filterMap=te,S.partition=xe,S.partitionMap=ce}if(p(g)){var Ne=function(Q){return function(re){return g.filterWithIndex(re,Q)}},ze=function(Q){return function(re){return g.filterMapWithIndex(re,Q)}},He=function(Q){return function(re){return g.partitionWithIndex(re,Q)}},it=function(Q){return function(re){return g.partitionMapWithIndex(re,Q)}};S.filterWithIndex=Ne,S.filterMapWithIndex=ze,S.partitionWithIndex=He,S.partitionMapWithIndex=it}if(h(g)){var Ft=function(Q,re){return function(ke){return g.promap(ke,Q,re)}};S.promap=Ft}if(v(g)){var qt=function(Q){return function(re){return g.compose(re,Q)}};S.compose=qt}if(m(g)){var Ht=function(Q){return function(re){return re._tag==="None"?g.throwError(Q()):g.of(re.value)}},xn=function(Q){return Q._tag==="Left"?g.throwError(Q.left):g.of(Q.right)},Nr=function(Q,re){return function(ke){return Q(ke)?g.of(ke):g.throwError(re(ke))}},fr=function(Q,re){return function(ke){return g.chain(ke,function(Ot){return Q(Ot)?g.of(Ot):g.throwError(re(Ot))})}};S.fromOption=Ht,S.fromEither=xn,S.fromPredicate=Nr,S.filterOrElse=fr}return S}return Ds.pipeable=_,Ds.pipe=e.pipe,Ds}var rz;function yw(){if(rz)return nh;rz=1;var e=he&&he.__createBinding||(Object.create?function(a,u,s,c){c===void 0&&(c=s),Object.defineProperty(a,c,{enumerable:!0,get:function(){return u[s]}})}:function(a,u,s,c){c===void 0&&(c=s),a[c]=u[s]}),t=he&&he.__setModuleDefault||(Object.create?function(a,u){Object.defineProperty(a,"default",{enumerable:!0,value:u})}:function(a,u){a.default=u}),n=he&&he.__importStar||function(a){if(a&&a.__esModule)return a;var u={};if(a!=null)for(var s in a)Object.hasOwnProperty.call(a,s)&&e(u,a,s);return t(u,a),u};Object.defineProperty(nh,"__esModule",{value:!0}),nh.NumberFromString=void 0;var r=n(ee),i=nz(),o=Ln();return nh.NumberFromString=new r.Type("NumberFromString",r.number.is,function(a,u){return i.pipe(r.string.validate(a,u),o.chain(function(s){var c=+s;return isNaN(c)||s.trim()===""?r.failure(a,u):r.success(c)}))},String),nh}var iz;function Mbe(){if(iz)return th;iz=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c),Object.defineProperty(u,l,{enumerable:!0,get:function(){return s[c]}})}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)Object.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(th,"__esModule",{value:!0}),th.IntFromString=void 0;var r=n(ee),i=yw(),o=nz(),a=Ln();return th.IntFromString=new r.Type("IntFromString",r.Int.is,function(u,s){return o.pipe(i.NumberFromString.validate(u,s),a.chain(function(c){return r.Int.is(c)?r.success(c):r.failure(u,s)}))},i.NumberFromString.encode),th}var oz;function bw(){if(oz)return Ay;oz=1,Object.defineProperty(Ay,"__esModule",{value:!0});const e=H,t=Ln(),n=e.__importStar(ee),r=Mbe(),i=vt(),o=new n.Type("SideConstraints",u=>!u||typeof u=="number",(u,s)=>t.either.chain(n.union([n.literal("auto"),n.literal(""),n.Int,r.IntFromString,i.IntFromNumber,i.IntFromPixels,n.null]).validate(u,s),c=>c==="auto"||c===""?n.success(null):n.success(c)),u=>u),a=n.partial({width:o,height:o});return Ay.default=a,Ay}var az;function uz(){return az||(az=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=H,n=t.__importStar(ee),r=vt(),i=t.__importDefault(bw());e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))}(gw)),gw}var _w={},sz;function cz(){return sz||(sz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=H.__importStar(ee),r=vt();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))}(_w)),_w}var Sw={},rh={},ih={},oh={},lz;function xbe(){if(lz)return oh;lz=1,Object.defineProperty(oh,"__esModule",{value:!0}),oh.clone=void 0;function e(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}return oh.clone=e,oh}var fz;function kbe(){if(fz)return ih;fz=1;var e=he&&he.__createBinding||(Object.create?function(a,u,s,c){c===void 0&&(c=s),Object.defineProperty(a,c,{enumerable:!0,get:function(){return u[s]}})}:function(a,u,s,c){c===void 0&&(c=s),a[c]=u[s]}),t=he&&he.__setModuleDefault||(Object.create?function(a,u){Object.defineProperty(a,"default",{enumerable:!0,value:u})}:function(a,u){a.default=u}),n=he&&he.__importStar||function(a){if(a&&a.__esModule)return a;var u={};if(a!=null)for(var s in a)Object.hasOwnProperty.call(a,s)&&e(u,a,s);return t(u,a),u};Object.defineProperty(ih,"__esModule",{value:!0}),ih.withValidate=void 0;var r=n(ee),i=xbe();function o(a,u,s){s===void 0&&(s=a.name);var c=i.clone(a);return c.validate=u,c.decode=function(l){return u(l,r.getDefaultContext(c))},c.name=s,c}return ih.withValidate=o,ih}var dz;function $w(){if(dz)return rh;dz=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c),Object.defineProperty(u,l,{enumerable:!0,get:function(){return s[c]}})}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)Object.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(rh,"__esModule",{value:!0}),rh.withFallback=void 0;var r=n(ee),i=kbe(),o=Ln();function a(u,s,c){return c===void 0&&(c="withFallback("+u.name+")"),i.withValidate(u,function(l,f){return o.orElse(function(){return r.success(s)})(u.validate(l,f))},c)}return rh.withFallback=a,rh}var pz;function hz(){return pz||(pz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=H,n=Ln(),r=t.__importStar(ee),i=$w(),o=vt(),a=c=>{if(c instanceof Array&&c.reduce((f,d)=>f&&typeof d=="string",!0))return r.success(c)},u=c=>{if(typeof c=="string")return r.success([c])},s=new r.Type("MasksArrayString",c=>c instanceof Array,(c,l)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(c,l),f=>a(f)||u(f)||r.failure(c,l)),c=>c);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:s,tags:s,allowTargetBlank:r.boolean})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))}(Sw)),Sw}var Tw={},mz;function vz(){return mz||(mz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=H.__importStar(ee),r=yw(),i=vt();e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))}(Tw)),Tw}var Iw={},gz;function yz(){return gz||(gz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=H.__importStar(ee),r=yw(),i=vt();e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))}(Iw)),Iw}var Ow={},bz;function _z(){return bz||(bz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=vt(),u=t.__importDefault(bw());e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},e.RichTextNodeTypeCodec=o.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const s=new o.Type("RichTextOptions",h=>typeof h=="string",h=>(0,i.pipe)(o.union([o.string,o.null]).decode(h),n.either.map(v=>{if(!v)return e.DEFAULT_OPTION;const _=v.split(",").map(g=>g.trim()).filter(g=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(g)));return _.length?_.join(","):e.DEFAULT_OPTION})),h=>h),c=h=>{if(!h)return o.success([])},l=h=>{if(h instanceof Object){const v=h;if(!Object.entries(v).length)return o.success([]);if(v[""])return o.success(v[""].map(_=>_.name));const m=Object.entries(v).reduce((_,[,g])=>_.concat(g.map(S=>S.name)),[]).filter(Boolean);return o.success(m)}},f=h=>{if(h instanceof Array&&h.reduce((m,_)=>m&&typeof _=="string",!0))return o.success(h)},d=h=>{if(typeof h=="string")return o.success([h])},p=new o.Type("RichTextLabels",h=>h instanceof Array,(h,v)=>{const m=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),_=o.readonlyArray(o.string);return(0,i.pipe)(o.union([m,_,o.string,o.null]).decode(h),n.either.chain(g=>c(g)||f(g)||l(g)||d(g)||o.failure(h,v)))},h=>h);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:s,multi:s,imageConstraint:u.default,labels:p,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))}(Ow)),Ow}var ww={},Sz;function $z(){return Sz||(Sz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=H.__importStar(ee),r=vt();e.SelectFieldType="Select",e.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))}(ww)),ww}var Cw={},Tz;function Iz(){return Tz||(Tz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=H.__importStar(ee),r=vt();e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))}(Cw)),Cw}var Ew={},Oz;function wz(){return Oz||(Oz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=H.__importStar(ee),r=vt();e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))}(Ew)),Ew}var Rw={},Cz;function Ez(){return Cz||(Cz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=H.__importStar(ee),r=vt();e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))}(Rw)),Rw}var Rz;function nf(){if(Rz)return eh;Rz=1,Object.defineProperty(eh,"__esModule",{value:!0}),eh.NestableWidget=void 0;const t=H.__importStar(ee),n=V2(),r=G2(),i=J2(),o=X2(),a=ez(),u=uz(),s=cz(),c=hz(),l=vz(),f=yz(),d=_z(),p=$z(),h=Iz(),v=wz(),m=Ez();return eh.NestableWidget=t.union([r.Color,n.BooleanField,o.Embed,a.GeoPoint,i.Date,l.Number,f.Range,d.RichText,p.Select,h.Separator,v.Text,m.Timestamp,c.Link,u.Image,s.IntegrationField]),eh}var Mz;function Mw(){return Mz||(Mz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.GroupFieldType=void 0;const n=H.__importStar(ee),r=tf(),i=vt(),o=nf();e.GroupFieldType="Group",e.GroupConfig=n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,o.NestableWidget)})),e.Group=n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:e.GroupConfig})]))}(lw)),lw}var xw={},xz;function kw(){return xz||(xz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(V2(),e),t.__exportStar(G2(),e),t.__exportStar(J2(),e),t.__exportStar(X2(),e),t.__exportStar(ez(),e),t.__exportStar(uz(),e),t.__exportStar(cz(),e),t.__exportStar(hz(),e),t.__exportStar(nf(),e),t.__exportStar(vz(),e),t.__exportStar(yz(),e),t.__exportStar(_z(),e),t.__exportStar($z(),e),t.__exportStar(Iz(),e),t.__exportStar(wz(),e),t.__exportStar(Ez(),e)}(xw)),xw}var Aw={},kz;function Abe(){return kz||(kz=1,function(e){var t=he&&he.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=bw();Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})}(Aw)),Aw}var Nw={},Fw={},Az;function Pw(){return Az||(Az=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=H.__importStar(ee),r=tf(),i=vt(),o=nf();e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]))}(Fw)),Fw}var ah={},Nz;function Fz(){if(Nz)return ah;Nz=1,Object.defineProperty(ah,"__esModule",{value:!0}),ah.LegacySlice=void 0;const t=H.__importStar(ee),n=Mw(),r=nf();return ah.LegacySlice=t.union([r.NestableWidget,n.Group]),ah}var Ww={},Pz;function Ny(){return Pz||(Pz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=H.__importStar(ee),r=$w(),i=tf(),o=nf(),a="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,a),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,o.NestableWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice",e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string})]))}(Ww)),Ww}var uh={},Wz;function jz(){if(Wz)return uh;Wz=1,Object.defineProperty(uh,"__esModule",{value:!0}),uh.SharedSliceRef=void 0;const t=H.__importStar(ee),n=Ny();return uh.SharedSliceRef=t.exact(t.type({type:t.literal(n.SharedSliceType)})),uh}var jw={},Lz;function Nbe(){return Lz||(Lz=1,Object.defineProperty(jw,"__esModule",{value:!0})),jw}var Lw={},Dz;function qz(){return Dz||(Dz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;const n=H.__importStar(ee),r=tf(),i=vt(),o=Pw(),a=Fz(),u=Ny(),s=jz();e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function c(d){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,d]))}))}e.slicesConfigReader=c,e.StaticSlicesConfig=c(u.SharedSlice),e.DynamicSlicesConfig=c(s.SharedSliceRef);const l={toStatic(d,p){const h=Object.entries(d.choices||{}).reduce((v,[m,_])=>{if(_.type==="SharedSlice"){const g=p.get(m);return g?{...v,[m]:g}:v}else return{...v,[m]:_}},{});return{...d,choices:h}}};function f(d){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:d})]))}e.slicesReader=f,e.StaticSlices=f(e.StaticSlicesConfig),e.DynamicSlices=f(e.DynamicSlicesConfig),e.Slices={toStatic(d,p){return d.config?{...d,config:l.toStatic(d.config,p)}:d}}}(Lw)),Lw}var sh={},Uz;function Fbe(){if(Uz)return sh;Uz=1,Object.defineProperty(sh,"__esModule",{value:!0}),sh.SlicesTypes=void 0;const t=H.__importStar(ee),n=Pw(),r=Ny();return sh.SlicesTypes=t.keyof({[n.CompositeSliceType]:null,[r.SharedSliceType]:null}),sh}var Bz;function Pbe(){return Bz||(Bz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Pw(),e),t.__exportStar(Fz(),e),t.__exportStar(Ny(),e),t.__exportStar(jz(),e),t.__exportStar(Nbe(),e),t.__exportStar(qz(),e),t.__exportStar(Fbe(),e)}(Nw)),Nw}var Dw={},zz;function Kz(){return zz||(zz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=H.__importStar(ee),r=vt();e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))}(Dw)),Dw}var Ir={},Vz;function Hz(){if(Vz)return Ir;Vz=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.Widgets=Ir.FieldType=Ir.DynamicWidget=Ir.StaticWidget=Ir.widgetReader=void 0;const t=H.__importStar(ee),n=Mw(),r=kw(),i=nf(),o=qz(),a=Kz();function u(s){return t.union([a.UID,i.NestableWidget,n.Group,s])}return Ir.widgetReader=u,Ir.StaticWidget=u(o.StaticSlices),Ir.DynamicWidget=u(o.DynamicSlices),Ir.FieldType=t.keyof({[r.ColorFieldType]:null,[r.BooleanFieldType]:null,[r.NumberFieldType]:null,[r.EmbedFieldType]:null,[r.GeoPointFieldType]:null,[r.DateFieldType]:null,[r.RangeFieldType]:null,[r.RichTextFieldType]:null,[r.SelectFieldType]:null,[r.SeparatorFieldType]:null,[r.TextFieldType]:null,[r.TimestampFieldType]:null,[r.LinkFieldType]:null,[r.ImageFieldType]:null,[r.IntegrationFieldType]:null,[a.UIDFieldType]:null,[n.GroupFieldType]:null,[o.SlicesFieldType]:null,[o.LegacySlicesFieldType]:null}),Ir.Widgets={toStatic(s,c){switch(s.type){case"Choice":case"Slices":return o.Slices.toStatic(s,c);default:return s}}},Ir}var Gz;function sa(){return Gz||(Gz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Mw(),e),t.__exportStar(kw(),e),t.__exportStar(Abe(),e),t.__exportStar(Pbe(),e),t.__exportStar(Kz(),e),t.__exportStar(Hz(),e)}(cw)),cw}var Yz;function rf(){if(Yz)return Ci;Yz=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.defaultCtx=Ci.getFieldCtx=Ci.LegacyContentCtx=Ci.FieldOrSliceType=void 0;const t=H.__importStar(ee),n=sa();Ci.FieldOrSliceType=t.union([n.FieldType,n.SlicesTypes]);let r=class{constructor(u,s,c){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=u,this.fieldPath=s||[],this.allTypes=c||new Map;const l=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=l,this.keyOfType=`${l}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}};Ci.LegacyContentCtx=r;function i(a,u,s){return new r(a,[...u.fieldPath,u.fieldKey,...s||[]],u.allTypes)}Ci.getFieldCtx=i;function o(a,u=new Map){return new r(a,[],u)}return Ci.defaultCtx=o,Ci}var qs={},Jz;function Nt(){if(Jz)return qs;Jz=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.hasContentType=qs.hasFieldContentType=void 0;const e=Ln(),t=NC();function n(i){return r(i)&&i.__TYPE__===t.FieldContentType&&(i==null?void 0:i.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}qs.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return qs.hasContentType=r,qs}var qw={},Uw={},Zz;function Xz(){return Zz||(Zz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.BooleanContentType="BooleanContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const u=s=>new i.Type("BooleanLegacy",e.isBooleanContent,c=>(0,r.pipe)(i.boolean.decode(c),n.either.map(l=>e.BooleanContent.encode({value:l,__TYPE__:e.BooleanContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"Boolean"}}));e.BooleanLegacy=u,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean})}(Uw)),Uw}var Bw={},Qz;function zw(){return Qz||(Qz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=vt(),a=Nt();e.EmbedContentType="EmbedContent";const u=c=>(0,a.hasContentType)(c)&&c.__TYPE__===e.EmbedContentType;e.isEmbedContent=u,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const s=c=>new i.Type("EmbedLegacy",e.isEmbedContent,l=>(0,r.pipe)(e.EmbedContentLegacy.decode(l),n.either.map(f=>({...f,all:l,__TYPE__:e.EmbedContentType}))),l=>({content:l.all,types:{[c.keyOfType]:"Embed"}}));e.EmbedLegacy=s,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(Bw)),Bw}var Kw={},Vw={},Fy={},eK;function Us(){if(eK)return Fy;eK=1,Object.defineProperty(Fy,"__esModule",{value:!0});const e=H,t=ua,n=wi,r=e.__importStar(ee);function i(o){let a=0;for(;a<o.length&&o[a]<=" ";)a++;let u=o.length;for(;a<u&&o[u-1]<=" ";)u--;return o.substring(a,u)}return Fy.default=new r.Type("TrimmedString",r.string.is,(o,a)=>(0,n.pipe)(r.string.validate(o,a),(0,t.chain)(u=>r.success(i(u)))),o=>o),Fy}var ch={},tK;function ca(){return tK||(tK=1,Object.defineProperty(ch,"__esModule",{value:!0}),ch.FieldContentType=void 0,ch.FieldContentType="FieldContent"),ch}var nK;function rK(){return nK||(nK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=sa(),a=t.__importDefault(Us()),u=Nt(),s=ca(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Color";e.isColorContent=c;const l=f=>new i.Type("ColorLegacy",e.isColorContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.ColorContent.encode({value:p,type:o.ColorFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=l,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Vw)),Vw}var Hw={},iK;function oK(){return iK||(iK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=sa(),a=t.__importDefault(Us()),u=Nt(),s=ca(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Date";e.isDateContent=c;const l=f=>new i.Type("DateLegacy",e.isDateContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.DateContent.encode({value:p,type:o.DateFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.DateFieldType}}));e.DateLegacy=l,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Hw)),Hw}var Gw={},aK;function uK(){return aK||(aK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=sa(),a=t.__importDefault(Us()),u=Nt(),s=ca(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Number";e.isNumberContent=c;const l=f=>new i.Type("NumberLegacy",e.isNumberContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.NumberContent.encode({value:p,type:o.NumberFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=l,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Gw)),Gw}var Yw={},sK;function cK(){return sK||(sK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=sa(),a=t.__importDefault(Us()),u=Nt(),s=ca(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Range";e.isRangeContent=c;const l=f=>new i.Type("RangeLegacy",e.isRangeContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.RangeContent.encode({value:p,type:o.RangeFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=l,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Yw)),Yw}var Jw={},lK;function fK(){return lK||(lK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=sa(),a=t.__importDefault(Us()),u=Nt(),s=ca(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Select";e.isSelectContent=c;const l=f=>new i.Type("SelectLegacy",e.isSelectContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.SelectContent.encode({value:p,type:o.SelectFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=l,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Jw)),Jw}var Zw={},dK;function pK(){return dK||(dK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=sa(),a=t.__importDefault(Us()),u=Nt(),s=ca(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Text";e.isTextContent=c;const l=f=>new i.Type("TextLegacy",e.isTextContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.TextContent.encode({value:p,type:o.TextFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.TextFieldType}}));e.TextLegacy=l,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Zw)),Zw}var Xw={},hK;function mK(){return hK||(hK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=sa(),a=t.__importDefault(Us()),u=Nt(),s=ca(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Timestamp";e.isTimestampContent=c;const l=f=>new i.Type("TimestampLegacy",e.isTimestampContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.TimestampContent.encode({value:p,type:o.TimestampFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=l,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Xw)),Xw}var vK;function gK(){return vK||(vK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=H,n=t.__importStar(ee),r=rK(),i=oK(),o=uK(),a=cK(),u=fK(),s=pK(),c=mK();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,u.SelectContent,s.TextContent,c.TimestampContent]),t.__exportStar(rK(),e),t.__exportStar(ca(),e),t.__exportStar(oK(),e),t.__exportStar(uK(),e),t.__exportStar(cK(),e),t.__exportStar(fK(),e),t.__exportStar(pK(),e),t.__exportStar(mK(),e)}(Kw)),Kw}var Qw={},yK;function bK(){return yK||(yK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=H,n=mt,r=wi,i=t.__importStar(ee),o=Nt();e.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const u=i.strict({position:i.strict({lat:i.number,lng:i.number})}),s=c=>new i.Type("GeoPointLegacy",e.isGeoPointContent,l=>(0,r.pipe)(u.decode(l),n.either.map(f=>e.GeoPointContent.encode({...f,__TYPE__:e.GeoPointContentType}))),l=>({content:{position:l.position},types:{[c.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=s,e.GeoPointContent=i.intersection([u,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(Qw)),Qw}var eC={},la={},_K;function SK(){if(_K)return la;_K=1,Object.defineProperty(la,"__esModule",{value:!0}),la.withOptionals=la.isNotEmpty=la.zipObjects=void 0;function e(r,i){return[...new Set(Object.keys(r||{}).concat(Object.keys(i||{})))].reduce((a,u)=>{const s=r==null?void 0:r[u],c=i==null?void 0:i[u];return{...a,[u]:{left:s,right:c}}},{})}la.zipObjects=e;function t(r){return Boolean(Object.keys(r).length)}la.isNotEmpty=t;function n(r,i){return{...r,...i.reduce((o,[a,u])=>u?{...o,[a]:u}:o,{})}}return la.withOptionals=n,la}var $K;function tC(){return $K||($K=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=SK(),a=vt(),u=Nt();e.ImageContentType="ImageContent";const s=d=>(0,u.hasContentType)(d)&&d.__TYPE__===e.ImageContentType;e.isImageContent=s;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const l=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),f=d=>new i.Type("ImageLegacy",e.isImageContent,p=>(0,r.pipe)(l.decode(p),n.either.map(h=>e.ImageContent.encode({...h,__TYPE__:e.ImageContentType}))),p=>({content:(0,o.withOptionals)({edit:p.edit,height:p.height,origin:p.origin,width:p.width},[["alt",p.alt],["credits",p.credits],["provider",p.provider],["thumbnails",p.thumbnails],["url",p.url]]),types:{[d.keyOfType]:"Image"}}));e.ImageLegacy=f,e.ImageContent=i.intersection([l,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(eC)),eC}var nC={},TK;function IK(){return TK||(TK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const u=s=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.IntegrationFieldContent.encode({value:l,__TYPE__:e.IntegrationFieldContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=u,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(nC)),nC}var rC={},OK=yy(Oi,function(e){return e.length>0},"NonEmptyString");function wK(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=_y(e);return new Te(t,function(r){return n.is(r)&&jt(r)},function(r,i){return de(n.validate(r,i),Lr(function(o){var a=bS(o);return Le(a)?tt(r,i):Ee(a.value)}))},function(r){return n.encode(r)})}function CK(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=_y(e),i=pq(t),o=lq(t);return new Te(n,function(a){return a instanceof Set&&dq(e.is)(a)},function(a,u){return de(r.validate(a,u),Lr(function(s){var c=o(s);return c.size!==s.length?tt(a,u):Ee(c)}))},function(a){return r.encode(i(a))})}function Wbe(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),CK(e,t,n)}function iC(e,t){return new Te(e,t,function(n,r){return t(n)?Ee(n):tt(n,r)},Ue)}var jbe=function(e){return e instanceof Date},Lbe=iC("Date",jbe),Dbe=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},qbe=function(e,t){return{get:e,reverseGet:t}},EK=function(e){return su(e.get,V(e.reverseGet,Yn))},Ube=function(e){return Bs(V(e.get,_t),e.reverseGet)},Bbe=function(e){return fa(V(e.get,_t),V(e.reverseGet,Yn))},zbe=function(e){return of(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},su=function(e,t){return{get:e,set:t}},oC=function(e){return fa(V(e.get,_t),e.set)},Kbe=function(e){return of(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},RK=function(e){return function(t){return su(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},Vbe=function(e){return function(t){return Bs(V(t.getOption,Ad(e.getOption)),V(e.reverseGet,t.reverseGet))}},Hbe=function(e){return function(t){return zs(aC(e))(oC(t))}},Gbe=function(){return su(D,Yn)},Ybe=function(e){return function(t){return su(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,(i={},i[e]=n,i)))(r)}})}},Jbe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return su(function(r){for(var i=n.get(r),o={},a=0,u=e;a<u.length;a++){var s=u[a];o[s]=i[s]}return o},function(r){return function(i){for(var o=n.get(i),a=0,u=e;a<u.length;a++){var s=u[a];if(r[s]!==o[s])return n.set(Object.assign({},o,r))(i)}return i}})}},Zbe=function(e){return function(t){return su(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},Xbe=function(e){return function(t){return de(t,RK(__e().at(e)))}},Bs=function(e,t){return{getOption:e,reverseGet:t}},aC=function(e){return fa(e.getOption,function(t){return xK(t)(e)})},MK=function(e){return of(function(t){return function(n){return function(r){return de(e.getOption(r),Ao(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return xK(o)(e)(r)})}))}}})},Qbe=function(e){return function(t){return function(n){return de(t.getOption(n),Ji(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},e_e=function(e){return function(t){var n=Qbe(e)(t);return function(r){return de(n(r),X$(function(){return r}))}}},xK=function(e){return e_e(function(){return e})},t_e=function(e){return function(t){return zs(oC(e))(aC(t))}},n_e=function(){return Bs(is,D)},uC=function(e){return Bs(Ov(e),D)},r_e=function(){return Bs(D,_t)},i_e=function(){return Bs(ol,Ye)},o_e=function(){return Bs(function(e){return le(e)?_t(e.left):at},Tt)},fa=function(e,t){return{getOption:e,set:t}},a_e=function(e){return of(function(t){return function(n){return function(r){return de(e.getOption(r),Ao(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},kK=function(e){return function(t){return function(n){return de(t.getOption(n),Ji(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},AK=function(e){return function(t){var n=kK(e)(t);return function(r){return de(n(r),X$(function(){return r}))}}},zs=function(e){return function(t){return fa(V(t.getOption,Ad(e.getOption)),function(n){return AK(e.set(n))(t)})}},u_e=function(e){return function(t){return de(t,zs(v_e().index(e)))}},s_e=function(e){return function(t){return de(t,zs(g_e().index(e)))}},c_e=function(e){return function(t){return de(t,zs(y_e().index(e)))}},l_e=function(e){return fa(rv(e),function(t){return function(n){return de(nv(e)(n),Ao(function(){return n},function(r){return mv(r,t,n)}))}})},NK=function(e,t,n){if(n[e]===t)return n;var r=Dbe([n[0]],n.slice(1),!0);return r[e]=t,r},f_e=function(e){return fa(rv(e),function(t){return function(n){return de(nv(e)(n),Ao(function(){return n},function(r){return NK(r,t,n)}))}})},of=function(e){return{modifyF:e}};function sC(e){return function(t){return of(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var d_e={URI:"Identity",map:function(e,t){return t(e)},of:D,ap:function(e,t){return e(t)}},p_e=function(e){return e.URI==="Identity"};function h_e(e){return function(){return of(function(t){var n=p_e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function m_e(e){return sC(h_e(e)())}var cC=function(e){return{index:e}},v_e=function(){return cC(function(e){return fa(function(t){return Xu(e,t)},function(t){return function(n){return de(Xu(e,n),Ao(function(){return n},function(){return mv(e,t,n)}))}})})},g_e=function(){return cC(function(e){return fa(function(t){return Xu(e,t)},function(t){return function(n){return de(Xu(e,n),Ao(function(){return n},function(){return NK(e,t,n)}))}})})},y_e=function(){return cC(function(e){return fa(function(t){return Du(e,t)},function(t){return function(n){return n[e]===t||Le(Du(e,n))?n:lS(e,t)(n)}})})},b_e=function(e){return{at:e}};function __e(){return b_e(function(e){return su(function(t){return Du(e,t)},Ao(function(){return xm(e)},function(t){return lS(e,t)}))})}var FK=qbe,lC=EK,fC=Ube,dC=Bbe,pC=zbe,S_e=function(e){return function(t){return FK(V(t.get,e.get),V(e.reverseGet,t.reverseGet))}},$_e=function(e){return FK(e.reverseGet,e.get)},T_e=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},PK=su,Py=Gbe,cu=oC,af=Kbe,Ks=RK,I_e=Ks,O_e=V(EK,Ks),Vs=Hbe,hC=function(e){return V(cu,zs(e))},w_e=function(e){return V(af,sC(e))},WK=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function C_e(e){return function(t){return function(n){return function(r){return de(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var E_e=function(e){return Vs(n_e())(e)};function R_e(e){return Vs(uC(e))}var jK=Ybe,LK=Jbe,M_e=Zbe,x_e=function(e){return V(cu,u_e(e))},k_e=function(e){return V(cu,s_e(e))},A_e=function(e){return V(cu,c_e(e))},N_e=Xbe,F_e=Vs(r_e()),P_e=Vs(i_e()),W_e=Vs(o_e());function j_e(e){return V(af,m_e(e))}function L_e(e){return hC(l_e(e))}function D_e(e){return hC(f_e(e))}var q_e=function(e,t){return function(n){return DK(n,e,t)}},DK=function(e,t,n){return PK(V(e.get,t),V(n,e.set))},Wy="monocle-ts/Lens",U_e={URI:Wy,imap:DK},qK={URI:Wy,compose:function(e,t){return Ks(e)(t)}},B_e={URI:Wy,compose:qK.compose,id:Py};const z_e=Object.freeze(Object.defineProperty({__proto__:null,Category:B_e,Invariant:U_e,Semigroupoid:qK,URI:Wy,asOptional:cu,asTraversal:af,atKey:N_e,component:M_e,compose:Ks,composeIso:O_e,composeLens:I_e,composeOptional:hC,composePrism:Vs,composeTraversal:w_e,filter:R_e,findFirst:L_e,findFirstNonEmpty:D_e,fromNullable:E_e,id:Py,imap:q_e,index:x_e,indexNonEmpty:k_e,key:A_e,left:W_e,lens:PK,modify:WK,modifyF:C_e,prop:jK,props:LK,right:P_e,some:F_e,traverse:j_e},Symbol.toStringTag,{value:"Module"}));var UK=a_e,Hs=zs,K_e=kK,V_e=AK,H_e=uC,mC=aC,vC=MK,gC=Vbe,G_e=t_e,da=sC,BK=function(e){return function(t){return t.modifyF(d_e)(e)}},Y_e=function(e){return BK(function(){return e})};function J_e(e){return da(MK(uC(e)))}var zK=function(e){return new VK(e.get,e.reverseGet)},uf=function(e){return new yC(e.get,e.set)},lh=function(e){return new HK(e.getOption,e.reverseGet)},Vr=function(e){return new Z_e(e.getOption,e.set)},Or=function(e){return new X_e(e.modifyF)},KK=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},VK=function(){function e(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return e.prototype.reverse=function(){return zK($_e(this))},e.prototype.modify=function(t){return T_e(t)(this)},e.prototype.asLens=function(){return uf(lC(this))},e.prototype.asPrism=function(){return lh(fC(this))},e.prototype.asOptional=function(){return Vr(dC(this))},e.prototype.asTraversal=function(){return Or(pC(this))},e.prototype.asFold=function(){var t=this;return new sf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new YK(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return zK(S_e(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return uf(de(this,lC,Ks(t)))},e.prototype.composePrism=function(t){return lh(de(this,fC,gC(t)))},e.prototype.composeOptional=function(t){return Vr(de(this,dC,Hs(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,pC,da(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),yC=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return uf(de(Py(),jK(t)))}},e.fromProps=function(){return function(t){return uf(de(Py(),LK.apply(z_e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=is(r[t]);return Le(i)?n:i.value},function(r){return function(i){return KK(i,t,r)}})}},e.prototype.modify=function(t){return WK(t)(this)},e.prototype.asOptional=function(){return Vr(cu(this))},e.prototype.asTraversal=function(){return Or(af(this))},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new YK(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new sf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return uf(Ks(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return Vr(de(this,cu,Hs(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,af,da(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return uf(de(this,Ks(de(t,lC))))},e.prototype.composePrism=function(t){return Vr(Vs(t)(this))},e}(),HK=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return lh(H_e(t))},e.some=function(){return GK},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return Le(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return TN.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return Vr(mC(this))},e.prototype.asTraversal=function(){return Or(vC(this))},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new sf(function(n){return function(r){return function(i){var o=t.getOption(i);return Le(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return lh(gC(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Vr(de(this,mC,Hs(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,vC,da(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return lh(de(this,gC(de(t,fC))))},e.prototype.composeLens=function(t){return Vr(G_e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),GK=new HK(D,_t),Z_e=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return is(n[t])},function(n){return function(r){return r[t]==null?r:KK(r,t,n)}})}},e.fromOptionProp=function(){var t=yC.fromProp();return function(n){return t(n).composePrism(GK)}},e.prototype.modify=function(t){return V_e(t)(this)},e.prototype.modifyOption=function(t){return K_e(t)(this)},e.prototype.asTraversal=function(){return Or(UK(this))},e.prototype.asFold=function(){var t=this;return new sf(function(n){return function(r){return function(i){var o=t.getOption(i);return Le(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Vr(Hs(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Or(de(this,UK,da(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return Vr(de(this,Hs(de(t,cu))))},e.prototype.composePrism=function(t){return Vr(de(this,Hs(de(t,mC))))},e.prototype.composeIso=function(t){return Vr(de(this,Hs(de(t,dC))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),X_e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return BK(t)(this)},e.prototype.set=function(t){return Y_e(t)(this)},e.prototype.filter=function(t){return Or(J_e(t)(this))},e.prototype.asFold=function(){var t=this;return new sf(function(n){return function(r){return t.modifyF(wN(n))(function(i){return al(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new fh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Or(da(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return Or(de(this,da(de(t,af))))},e.prototype.composePrism=function(t){return Or(de(this,da(de(t,vC))))},e.prototype.composeIso=function(t){return Or(de(this,da(de(t,pC))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),YK=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new sf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),sf=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(M$())(La),this.exist=t(QW),this.all=t(XW),this.foldMapFirst=t(IN())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst(Ov(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),fh=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Yn(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),Q_e=new VK(Cc,Cc);function eSe(){return Q_e}function tSe(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=eSe();return new Te(t,function(r){return e.is(r)},function(r,i){return de(e.validate(r,i),cs(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var nSe=Xp({_tag:Jp("None")}),rSe=Jp("Some");function JK(e,t){return t===void 0&&(t="Option<"+e.name+">"),Zp([nSe,Xp({_tag:rSe,value:e},"Some<"+e.name+">")],t)}function iSe(e,t){return t===void 0&&(t="Option<"+e.name+">"),new Te(t,JK(e).is,function(n,r){return n==null?Ee(at):de(e.validate(n,r),cs(_t))},function(n){return Q$(de(n,Ji(e.encode)))})}var oSe=new Te("DateFromISOString",function(e){return e instanceof Date},function(e,t){return de(Oi.validate(e,t),Lr(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return e.toISOString()});function aSe(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),wK(e,t)}function ZK(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var uSe=new Te("DateFromNumber",function(e){return e instanceof Date},function(e,t){return de(Ls.validate(e,t),Lr(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return e.getTime()});function jy(e,t,n){n===void 0&&(n=e.name);var r=ZK(e);return r.validate=t,r.decode=function(i){return t(i,I2(r))},r.name=n,r}function sSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),jy(e,function(r,i){return tF(function(){return Ee(t)})(e.validate(r,i))},n)}var cSe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,lSe=yy(Oi,function(e){return cSe.test(e)},"UUID");function fSe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),jy(e,function(r,i){return r==null?Ee(t):e.validate(r,i)},n)}var dSe=new Te("BooleanFromString",gy.is,function(e,t){return de(Oi.validate(e,t),Lr(function(n){return n==="true"?Ee(!0):n==="false"?Ee(!1):tt(e,t)}))},String);function pSe(e,t){return jy(e,function(n,r){return qd(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function XK(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return XK(e.type)}}var hSe=yC.fromProp();function mSe(e){var t={};for(var n in XK(e))t[n]=hSe(n);return t}var vSe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},gSe=iC("RegExp",vSe),ySe=new Te("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return de(by.validate(e,t),Lr(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),bC=new Te("NumberFromString",Ls.is,function(e,t){return de(Oi.validate(e,t),Lr(function(n){var r=+n;return isNaN(r)||n.trim()===""?tt(e,t):Ee(r)}))},String),bSe=new Te("IntFromString",by.is,function(e,t){return de(bC.validate(e,t),Lr(function(n){return by.is(n)?Ee(n):tt(e,t)}))},bC.encode),QK=ew("JsonArray",function(){return _2(Ly)}),eV=ew("JsonRecord",function(){return rw(Oi,Ly)}),Ly=Zp([gy,Ls,Oi,XO,QK,eV],"Json"),_Se=new Te("JsonFromString",Ly.is,function(e,t){try{return Ee(JSON.parse(e))}catch{return tt(e,t)}},function(e){return JSON.stringify(e)}),SSe=Jp("Left"),$Se=Jp("Right");function TSe(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Zp([Xp({_tag:SSe,left:e},"Left<"+e.name+">"),Xp({_tag:$Se,right:t},"Right<"+e.name+">")],n)}var ISe=new Te("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return de(Oi.validate(e,t),Lr(function(n){if(!OK.is(n.trim()))return tt(e,t);try{return Ee(BigInt(n))}catch{return tt(e,t)}}))},String);function OSe(e,t,n){return n===void 0&&(n=e.name),new Te(n,e.is,e.validate,t)}var wSe=new Te("BooleanFromNumber",gy.is,function(e,t){return de(Ls.validate(e,t),cs(function(n){return n!==0}))},Number);const tV=wc(Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:ISe,BooleanFromNumber:wSe,BooleanFromString:dSe,DateFromISOString:oSe,DateFromNumber:uSe,DateFromUnixTime:ySe,IntFromString:bSe,Json:Ly,JsonArray:QK,JsonFromString:_Se,JsonRecord:eV,NonEmptyString:OK,NumberFromString:bC,UUID:lSe,clone:ZK,date:Lbe,either:TSe,fromNewtype:tSe,fromNullable:fSe,fromRefinement:iC,getLenses:mSe,mapOutput:E2,nonEmptyArray:wK,option:JK,optionFromNullable:iSe,readonlyNonEmptyArray:aSe,readonlySetFromArray:Wbe,regexp:gSe,setFromArray:CK,withEncode:OSe,withFallback:sSe,withMessage:pSe,withValidate:jy},Symbol.toStringTag,{value:"Module"})));var nV;function _C(){return nV||(nV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.ExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.DocumentLinkType=e.FileLinkContent=e.FileLinkType=e.ImageLinkContent=e.ImageLinkType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=tV,a=vt(),u=uu(),s=Nt();e.ImageLinkType="ImageLink";const c=i.exact(i.intersection([i.type({id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string,kind:i.string}),i.partial({date:a.StringOrNull})])),l=new i.Type("ImageLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.ImageLinkType,S=>(0,r.pipe)(c.decode(S),n.either.map(b=>e.ImageLinkContent.encode({...b,__TYPE__:e.ImageLinkType}))),S=>c.encode(S));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),c]),e.FileLinkType="FileLink";const f=i.exact(i.intersection([i.type({id:i.string,url:i.string,name:i.string,kind:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:(0,u.nullable)(i.string)})])),d=new i.Type("FileLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.FileLinkType,S=>(0,r.pipe)(f.decode(S),n.either.map(b=>e.FileLinkContent.encode({...b,__TYPE__:e.FileLinkType}))),S=>f.encode(S));e.FileLinkContent=i.intersection([f,i.exact(i.intersection([i.type({__TYPE__:i.literal(e.FileLinkType)}),i.partial({size:(0,o.withFallback)(i.string,"0")})]))]),e.DocumentLinkType="DocumentLink";const p=i.strict({id:a.NonEmptyString}),h=new i.Type("DocumentLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.DocumentLinkType,S=>(0,r.pipe)(p.decode(S),n.either.map(b=>e.DocumentLinkContent.encode({...b,__TYPE__:e.DocumentLinkType}))),S=>p.encode(S));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),p]),e.ExternalLinkType="ExternalLink";const v=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:a.StringOrNull,preview:(0,u.nullable)(i.partial({title:i.string}))})])),m=new i.Type("ExternalLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.ExternalLinkType,S=>(0,r.pipe)(v.decode(S),n.either.map(b=>e.ExternalLinkContent.encode({...b,__TYPE__:e.ExternalLinkType}))),S=>v.encode(S));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),v]),e.LinkContentType="LinkContent";const _=S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.LinkContentType;e.isLinkContent=_,e.LinkLegacy=i.union([l,d,h,m]);const g=S=>new i.Type("LinkLegacy",e.isLinkContent,b=>(0,r.pipe)(e.LinkLegacy.decode(b),n.either.map($=>e.LinkContent.encode({value:$,__TYPE__:e.LinkContentType}))),b=>({content:e.LinkLegacy.encode(b.value),types:{[S.keyOfType]:"Link"}}));e.LinkContentLegacy=g,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent]),e.LinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link})}(rC)),rC}var pa={},SC={},rV;function CSe(){return rV||(rV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const u=i.union([i.null,i.type({value:i.null})]),s=c=>new i.Type("EmptyLegacy",e.isEmptyContent,l=>(0,r.pipe)(u.decode(l),n.either.map(()=>({type:c,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=s,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(SC)),SC}var $C={},TC={},iV;function oV(){return iV||(iV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.BlockLegacy=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedMetas=e.Span=e.Meta=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=kw(),u=vt(),s=uu(),c=zw(),l=tC(),f=_C();e.Meta=o.exact(o.intersection([o.partial({data:o.unknown}),o.type({start:o.number,end:o.number,type:o.union([a.RichTextNodeTypeCodec,o.literal("label")])})])),e.Span=e.Meta;const d=b=>new o.Type("ValidatedMetas",$=>Array.isArray($)&&$.every(e.Meta.is),($,T)=>{if(Array.isArray($)){const M=$.reduce((R,q)=>{const Y=e.Meta.decode(q);if((0,r.isRight)(Y)){const N=Y.right;if(N.data&&N.type==="hyperlink"){const Z=b.decode(N.data);return(0,r.isLeft)(Z)?R:[...R,{...N,data:Z.right}]}else if(N.type!=="hyperlink")return[...R,N]}return R},[]).sort((R,q)=>R.start-q.start);return o.success(M)}else return o.failure($,T)},$=>$.reduce((T,M)=>{if(M.type==="hyperlink"&&M.data){const R=b.decode(M.data);return(0,r.isLeft)(R)?T:[...T,{...M,data:b.encode(R.right)}]}return[...T,e.Meta.encode(M)]},[]));e.ValidatedMetas=d,e.ImageBlock=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.image),data:o.intersection([l.ImageContentView,o.partial({linkTo:(0,s.nullable)(f.Link)})])}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function p(b){return b.type===a.RichTextNodeType.image}e.checkImageBlock=p;const h=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.embed),data:o.unknown}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})])),v=new o.Type("EmbedBlockLegacy",b=>b.type==="embed",b=>(0,i.pipe)(h.decode(b),n.either.chain($=>n.either.map(T=>[$,T])(c.EmbedContentLegacy.decode($.data))),n.either.map(([$,T])=>e.EmbedBlock.encode({...$,data:{...T,__TYPE__:c.EmbedContentType,all:$.data}}))),b=>({...h.encode(b),data:c.EmbedContentLegacy.encode(b.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.embed),data:c.EmbedContent}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function m(b){return b.type===a.RichTextNodeType.embed}e.checkEmbedBlock=m;const _=b=>o.exact(o.intersection([o.type({type:(0,s.refineType)(a.RichTextNodeTypeCodec,`string which isn't ${a.RichTextNodeType.image} ${a.RichTextNodeType.embed}`,$=>$!==a.RichTextNodeType.image&&$!==a.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedMetas)(b)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=_(f.Link);const g=_(f.LinkLegacy),S=o.union([v,e.ImageBlock,g]);e.BlockLegacy=new o.Type("BlockLegacy",b=>v.is(b)||e.ImageBlock.is(b)||g.is(b),b=>S.decode(b),b=>e.ImageBlock.is(b)?e.ImageBlock.encode(b):e.EmbedBlock.is(b)?v.encode(b):g.encode(b)),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(TC)),TC}var aV;function uV(){return aV||(aV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt(),a=oV();e.RichTextContentType="StructuredTextContent";const u=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.RichTextContentType;e.isRichTextContent=u;const s=i.array(a.BlockLegacy);e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),t.__exportStar(oV(),e);const c=l=>new i.Type("RichTextLegacy",e.isRichTextContent,f=>(0,r.pipe)(s.decode(f),n.either.map(d=>e.RichTextContent.encode({value:d,__TYPE__:e.RichTextContentType}))),f=>({content:s.encode(f.value),types:{[l.keyOfType]:"StructuredText"}}));e.RichTextLegacy=c}($C)),$C}var IC={},sV;function cV(){return sV||(sV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=H.__importStar(ee),r=Nt();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(IC)),IC}var lV;function ESe(){if(lV)return pa;lV=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.NestableLegacy=pa.isNestableContent=pa.NestableContent=void 0;const e=H,t=Ln(),n=e.__importStar(ee),r=CSe(),i=Xz(),o=zw(),a=gK(),u=ca(),s=bK(),c=tC(),l=IK(),f=_C(),d=uV(),p=cV();pa.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,s.GeoPointContent,c.ImageContent,l.IntegrationFieldContent,f.LinkContent,d.RichTextContent,p.SeparatorContent]);const h=m=>(0,a.isTextContent)(m)||(0,a.isColorContent)(m)||(0,a.isDateContent)(m)||(0,a.isTimestampContent)(m)||(0,a.isNumberContent)(m)||(0,a.isRangeContent)(m)||(0,a.isSelectContent)(m)||(0,s.isGeoPointContent)(m)||(0,d.isRichTextContent)(m)||(0,i.isBooleanContent)(m)||(0,o.isEmbedContent)(m)||(0,c.isImageContent)(m)||(0,l.isIntegrationFieldContent)(m)||(0,f.isLinkContent)(m)||(0,p.isSeparatorContent)(m);pa.isNestableContent=h;const v=m=>({decode(_){if(!m.fieldType)return;const g=(0,r.EmptyLegacy)(m.fieldType).decode(_);if((0,t.isRight)(g))return g;const S=(()=>{switch(m.fieldType){case"Text":return(0,a.TextLegacy)(m);case"Color":return(0,a.ColorLegacy)(m);case"Date":return(0,a.DateLegacy)(m);case"Timestamp":return(0,a.TimestampLegacy)(m);case"Number":return(0,a.NumberLegacy)(m);case"Range":return(0,a.RangeLegacy)(m);case"Select":return(0,a.SelectLegacy)(m);case"GeoPoint":return(0,s.GeoPointLegacy)(m);case"StructuredText":return(0,d.RichTextLegacy)(m);case"Boolean":return(0,i.BooleanLegacy)(m);case"Embed":return(0,o.EmbedLegacy)(m);case"Image":return(0,c.ImageLegacy)(m);case"IntegrationFields":return(0,l.IntegrationFieldLegacy)(m);case"Link":return(0,f.LinkContentLegacy)(m);case"Separator":return(0,p.SeparatorLegacy)(m);default:return}})();if(S)return S.decode(_)},encode(_){switch(_.__TYPE__){case u.FieldContentType:return _.type==="Text"?(0,a.TextLegacy)(m).encode(_):_.type==="Color"?(0,a.ColorLegacy)(m).encode(_):_.type==="Range"?(0,a.RangeLegacy)(m).encode(_):_.type==="Date"?(0,a.DateLegacy)(m).encode(_):_.type==="Number"?(0,a.NumberLegacy)(m).encode(_):_.type==="Timestamp"?(0,a.TimestampLegacy)(m).encode(_):_.type==="Select"?(0,a.SelectLegacy)(m).encode(_):void 0;case s.GeoPointContentType:return(0,s.GeoPointLegacy)(m).encode(_);case d.RichTextContentType:return(0,d.RichTextLegacy)(m).encode(_);case o.EmbedContentType:return(0,o.EmbedLegacy)(m).encode(_);case i.BooleanContentType:return(0,i.BooleanLegacy)(m).encode(_);case c.ImageContentType:return(0,c.ImageLegacy)(m).encode(_);case l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(m).encode(_);case f.LinkContentType:return(0,f.LinkContentLegacy)(m).encode(_);case p.SeparatorContentType:return(0,p.SeparatorLegacy)(m).encode(_);default:return}}});return pa.NestableLegacy=v,pa}var fV;function Gs(){return fV||(fV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Xz(),e),t.__exportStar(zw(),e),t.__exportStar(gK(),e),t.__exportStar(bK(),e),t.__exportStar(tC(),e),t.__exportStar(IK(),e),t.__exportStar(_C(),e),t.__exportStar(ESe(),e),t.__exportStar(uV(),e),t.__exportStar(cV(),e)}(qw)),qw}var dV;function Dy(){return dV||(dV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GroupContent=e.isGroupContent=e.GroupContentType=e.GroupLegacy=e.GroupItemLegacy=e.GroupItemContent=e.GroupItemContentType=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=rf(),u=Nt(),s=Gs();e.GroupItemContentType="GroupItemContent",e.GroupItemContent=o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,s.NestableContent]))});const c=o.array(o.tuple([o.string,o.unknown])),l=p=>new o.Type("GroupItemLegacy",h=>(0,u.hasContentType)(h)&&h.__TYPE__===e.GroupItemContentType,h=>(0,i.pipe)(c.decode(h),n.either.map(m=>({value:m.reduce((g,[S,b])=>{const $=(0,a.getFieldCtx)(S,p),T=(0,s.NestableLegacy)($).decode(b);return!T||(0,r.isLeft)(T)?g:[...g,[S,T.right]]},[]),__TYPE__:e.GroupItemContentType}))),h=>h.value.reduce((v,[m,_])=>{const g=(0,a.getFieldCtx)(m,p),S=(0,s.NestableLegacy)(g).encode(_);return S?{content:[...v.content,[m,S.content]],types:{...v.types,...S.types}}:v},{content:[],types:{}}));e.GroupItemLegacy=l;const f=p=>{const h=o.array((0,e.GroupItemLegacy)(p));return new o.Type("GroupLegacy",e.isGroupContent,v=>(0,i.pipe)(h.decode(v),n.either.map(m=>({value:m,__TYPE__:e.GroupContentType}))),v=>{const m=h.encode(v.value);return{content:m.map(_=>_.content),types:m.reduce((_,g)=>({..._,...g.types}),{[p.keyOfType]:"Group"})}})};e.GroupLegacy=f,e.GroupContentType="GroupContentType";const d=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.GroupContentType;e.isGroupContent=d,e.GroupContent=o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)})}(sw)),sw}var OC={},wC={},CC={},Ys={},pV;function hV(){if(pV)return Ys;pV=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.RepeatableWidgets=Ys.RepeatableWidgetsLegacy=void 0;const t=H.__importStar(ee),n=Dy(),r=Gs(),i=u=>t.array((0,n.GroupItemLegacy)(u));Ys.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return t.array(o),Ys.RepeatableWidgets=t.array(a),Ys}var mV;function EC(){return mV||(mV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=rf(),u=Nt(),s=Gs(),c=hV();e.CompositeSliceContentType="CompositeSliceContent";const l=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=l;const f=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),d=p=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,h=>(0,i.pipe)(f.decode(h),n.either.map(v=>{const m=(()=>{const g=(0,a.getFieldCtx)("repeat",p),S=(0,c.RepeatableWidgetsLegacy)(g).decode(v.repeat);if(!(!S||(0,r.isLeft)(S)))return S.right})()||[];return{nonRepeat:Object.entries(v["non-repeat"]||{}).reduce((g,[S,b])=>{const $=(0,a.getFieldCtx)(S,p,["non-repeat"]);if(!$)return g;const T=(0,s.NestableLegacy)($).decode(b);return!T||(0,r.isLeft)(T)?g:{...g,[S]:T.right}},{}),repeat:m,__TYPE__:e.CompositeSliceContentType}})),h=>{const v=Object.entries(h.nonRepeat).reduce((_,[g,S])=>{const b=(0,a.getFieldCtx)(g,p,["non-repeat"]),$=(0,s.NestableLegacy)(b).encode(S);return $?{content:{..._.content,[g]:$.content},types:{..._.types,...$.types}}:_},{content:{},types:{}}),m=(()=>{const _=(0,a.getFieldCtx)("repeat",p);return(0,c.RepeatableWidgetsLegacy)(_).encode(h.repeat)})()||[];return{content:{"non-repeat":v.content,repeat:m.map(_=>_.content)},types:{[p.keyOfType]:"Slice",...v.types,...m.reduce((_,g)=>({..._,...g.types}),{})}}});e.CompositeSliceLegacy=d,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,s.NestableContent),repeat:c.RepeatableWidgets})}(CC)),CC}var RC={},vV;function MC(){return vV||(vV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=tV,u=rf(),s=Nt(),c=Gs(),l=hV();e.SharedSliceContentType="SharedSliceContent";const f=h=>(0,s.hasContentType)(h)&&h.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=f;const d=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),p=h=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,v=>(0,i.pipe)(d.decode(v),n.either.map(m=>{const _=(()=>{const S=(0,u.getFieldCtx)("items",h,["variations",m.variation]),b=(0,l.RepeatableWidgetsLegacy)(S).decode(m.items);if(!(!b||(0,r.isLeft)(b)))return b.right})()||[],g=Object.entries(m.primary).reduce((S,[b,$])=>{const T=(0,u.getFieldCtx)(b,h,["variations",m.variation,"primary"]),M=(0,c.NestableLegacy)(T).decode($);return!M||(0,r.isLeft)(M)?S:{...S,[b]:M.right}},{});return{variation:m.variation,primary:g,items:_,__TYPE__:e.SharedSliceContentType}})),v=>{const m=Object.entries(v.primary).reduce((g,[S,b])=>{const $=(0,u.getFieldCtx)(S,h,["variations",v.variation,"primary"]),T=(0,c.NestableLegacy)($).encode(b);return T?{content:{...g.content,[S]:T.content},types:{...g.types,...T.types}}:g},{content:{},types:{}}),_=(()=>{const g=(0,u.getFieldCtx)("items",h,["variations",v.variation]);return(0,l.RepeatableWidgetsLegacy)(g).encode(v.items)})()||[];return{content:{primary:m.content,items:_.map(g=>g.content),variation:v.variation},types:{[h.keyOfType]:"SharedSlice",...m.types,..._.reduce((g,S)=>({...g,...S.types}),{})}}});e.SharedSliceLegacy=p,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,c.NestableContent),items:l.RepeatableWidgets})}(RC)),RC}var ha={},gV;function xC(){if(gV)return ha;gV=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.SimpleSliceLegacy=ha.isSimpleSliceContent=ha.SimpleSliceContent=void 0;const t=H.__importStar(ee),n=Dy(),r=Gs();ha.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=a=>(0,r.isNestableContent)(a)||(0,n.isGroupContent)(a);ha.isSimpleSliceContent=i;const o=a=>({decode:((0,r.NestableLegacy)(a)||(0,n.GroupLegacy)(a)).decode.bind(null),encode:u=>{switch(u.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(a).encode(u);default:return(0,r.NestableLegacy)(a).encode(u)}}});return ha.SimpleSliceLegacy=o,ha}var yV;function bV(){return yV||(yV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=H,n=t.__importStar(ee),r=EC(),i=MC(),o=xC(),a=u=>({decode:s=>(()=>{switch(u.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(u);case"SharedSlice":return(0,i.SharedSliceLegacy)(u);default:return(0,o.SimpleSliceLegacy)(u)}})().decode(s),encode:s=>{switch(s.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(u).encode(s);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(u).encode(s);default:return(0,o.SimpleSliceLegacy)(u).encode(s)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),t.__exportStar(EC(),e),t.__exportStar(MC(),e),t.__exportStar(xC(),e)}(wC)),wC}var Js={},_V;function SV(){if(_V)return Js;_V=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.SlicesItemLegacy=Js.SliceItemContent=void 0;const e=H,t=mt,n=Ln(),r=Qe(),i=e.__importStar(ee),o=uu(),a=rf(),u=bV(),s=EC(),c=MC(),l=xC();Js.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:u.SliceContent});const f=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),d=p=>new i.Type("SlicesItemLegacy",h=>((0,c.isSharedSliceContent)(h.widget),(0,s.isCompositeSliceContent)(h.widget),(0,l.isSimpleSliceContent)(h.widget)),(h,v)=>(0,r.pipe)(f.decode(h),t.either.chain(m=>{var _;const g=m.key.indexOf("$"),S=m.key.substring(0,g>0?g:void 0),b=(0,a.getFieldCtx)(S,p),$=(0,u.SliceLegacy)(b).decode(m.value);return!$||(0,n.isLeft)($)?i.failure(h,v):i.success({key:m.key,name:S,maybeLabel:(_=m.label)!==null&&_!==void 0?_:void 0,widget:$.right})})),h=>{const v=(0,a.getFieldCtx)(h.name,p),m=(0,u.SliceLegacy)(v).encode(h.widget);return{content:{key:h.key,label:h.maybeLabel,value:(m==null?void 0:m.content)||{}},types:(m==null?void 0:m.types)||{}}});return Js.SlicesItemLegacy=d,Js}var kC={},$V;function RSe(){return $V||($V=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt(),a=SV();e.SlicesContentType="SliceContentType";const u=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.SlicesContentType;e.isSlicesContent=u;const s=c=>{const l=i.array((0,a.SlicesItemLegacy)(c));return new i.Type("SlicesLegacy",e.isSlicesContent,f=>(0,r.pipe)(l.decode(f),n.either.map(d=>({__TYPE__:e.SlicesContentType,value:d}))),f=>{const d=l.encode(f.value);return{content:d.map(p=>p.content),types:d.reduce((p,h)=>({...p,...h.types}),{[c.keyOfType]:"Slices"})}})};e.SlicesLegacy=s,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(a.SliceItemContent)})}(kC)),kC}var TV;function IV(){return TV||(TV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(bV(),e),t.__exportStar(SV(),e),t.__exportStar(RSe(),e)}(OC)),OC}var AC={},OV;function wV(){return OV||(OV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.UIDContentType="UIDContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.UIDContentType;e.isUIDContent=a;const u=s=>new i.Type("UIDLegacy",e.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.UIDContent.encode({value:l,__TYPE__:e.UIDContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"UID"}}));e.UIDLegacy=u,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(AC)),AC}var ma={},CV;function MSe(){if(CV)return ma;CV=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.WidgetLegacy=ma.isWidgetContent=ma.WidgetContent=void 0;const t=H.__importStar(ee),n=Dy(),r=Gs(),i=IV(),o=wV();ma.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=s=>(0,n.isGroupContent)(s)||(0,r.isNestableContent)(s)||(0,o.isUIDContent)(s)||(0,i.isSlicesContent)(s);ma.isWidgetContent=a;const u=s=>({decode(c){if(!s.fieldType)return;const l=(()=>{switch(s.fieldType){case"UID":return(0,o.UIDLegacy)(s);case"Group":return(0,n.GroupLegacy)(s);case"Choice":case"Slices":return(0,i.SlicesLegacy)(s);default:return(0,r.NestableLegacy)(s)}})();if(l)return l.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(s).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(s).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(s).encode(c);default:return(0,r.NestableLegacy)(s).encode(c)}}});return ma.WidgetLegacy=u,ma}var EV;function NC(){return EV||(EV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Dy(),e),t.__exportStar(Gs(),e),t.__exportStar(IV(),e),t.__exportStar(wV(),e),t.__exportStar(MSe(),e)}(uw)),uw}var RV;function xSe(){if(RV)return Yu;RV=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.DocumentLegacy=Yu.Document=void 0;const e=H,t=mt,n=Ln(),r=Qe(),i=e.__importStar(ee),o=tf(),a=NC(),u=rf();Yu.Document=i.record(o.WidgetKey,a.WidgetContent);const s=i.record(o.WidgetKey,i.unknown),c=p=>new i.Type("Document",h=>!!h&&typeof h=="object",h=>(0,r.pipe)(s.decode(h),t.either.map(v=>Object.entries(v).reduce((m,[_,g])=>{const S=(0,u.defaultCtx)(_,p),b=(0,a.WidgetLegacy)(S).decode(g);return!b||(0,n.isLeft)(b)?m:{...m,[_]:b.right}},{}))),h=>Object.entries(h).reduce((v,[m,_])=>{const g=(0,u.defaultCtx)(m,p),S=(0,a.WidgetLegacy)(g).encode(_);return S?{content:{...v.content,[m]:S.content},types:{...v.types,...S.types}}:v},{content:{},types:{}}));function l(p){const h=Object.entries(p),{types:v,widgets:m}=h.reduce((S,[b,$])=>{if(b.endsWith("_TYPE")){const T=u.FieldOrSliceType.decode($);if((0,n.isRight)(T))return{...S,types:S.types.set(b.substring(0,b.length-5),T.right)}}return!b.endsWith("_POSITION")&&!b.endsWith("_TYPE")?{...S,widgets:{...S.widgets,[b]:$}}:S},{types:new Map,widgets:{}}),_=p.slugs_INTERNAL||[],g=p.uid;return{widgets:m,types:v,uid:g,slugs:_}}function f(p){const h=(0,r.pipe)(i.record(o.WidgetKey,i.unknown).decode(p),t.either.chain(v=>{const{types:m,widgets:_}=l(v);return c(m).decode(_)}));return(0,n.isLeft)(h)?void 0:h.right}function d(p){const h=c().encode(p);return{...h.content,...h.types}}return Yu.DocumentLegacy={_codec:c,extractMetadata:l,parse:f,encode:d},Yu}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(xSe(),e),t.__exportStar(NC(),e),t.__exportStar(rf(),e)})(ot);function wr(e){var t;return((t=e.config)==null?void 0:t.label)??(e.type==="Boolean"||e.type==="Separator"?void 0:e.fieldset)??e.type}const MV="...";function lu(e,t){var n,r,i;return e.type==="Boolean"?(t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)??MV:e.type==="GeoPoint"?"TODO":((i=e.config)==null?void 0:i.placeholder)??MV}const kSe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var a;const o=(e==null?void 0:e.value)??((a=t.config)==null?void 0:a.default_value)??!1;return I.jsxs(C.Field,{children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"toggleOff"})}),I.jsx(C.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsxs(C.FieldControl,{children:[I.jsx(C.Text,{children:lu(t,o)}),I.jsx(C.Switch,{checked:o,id:n,onCheckedChange:u=>{i||r(ASe(u))}})]})]})};function ASe(e){return{__TYPE__:"BooleanContent",value:e}}const NSe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e},FSe=({id:e,field:t,content:n,onContentChange:r})=>I.jsxs(C.Field,{children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"colorLens"})}),I.jsx(C.FieldLabel,{id:e,children:wr(t)}),I.jsx(C.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(C.Box,{padding:{left:4},alignItems:"center",children:I.jsx(C.ColorInput,{onValueChange:i=>r(NSe(i)),value:n==null?void 0:n.value,"aria-labelledby":e,placeholder:lu(t)})})})})]}),PSe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Date",value:e},WSe=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>I.jsxs(C.Field,{children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"dateRange"})}),I.jsx(C.FieldLabel,{id:e,children:wr(n)}),I.jsx(C.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(C.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:I.jsx(C.DateInput,{mode:"date","aria-labelledby":e,readOnly:t,value:r==null?void 0:r.value,onValueChange:o=>i(PSe(o))})})})})]});var Je;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(const u of o)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Je||(Je={}));var FC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(FC||(FC={}));const oe=Je.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fu=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},G=Je.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),jSe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ei extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],s++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Je.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ei.create=e=>new Ei(e);const dh=(e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Je.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${Je.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Je.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${Je.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Je.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,Je.assertNever(e)}return{message:n}};let xV=dh;function LSe(e){xV=e}function qy(){return xV}const Uy=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let u="";const s=r.filter(c=>!!c).slice().reverse();for(const c of s)u=c(a,{data:t,defaultError:u}).message;return{...i,path:o,message:i.message||u}},DSe=[];function ue(e,t){const n=Uy({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,qy(),dh].filter(r=>!!r)});e.common.issues.push(n)}class Cn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Oe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Cn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return Oe;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Oe=Object.freeze({status:"aborted"}),kV=e=>({status:"dirty",value:e}),qn=e=>({status:"valid",value:e}),PC=e=>e.status==="aborted",WC=e=>e.status==="dirty",By=e=>e.status==="valid",zy=e=>typeof Promise<"u"&&e instanceof Promise;var me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(me||(me={}));class lo{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const AV=(e,t)=>{if(By(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ei(e.common.issues);return this._error=n,this._error}}};function Re(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,u)=>a.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:i}}class Ae{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return fu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:fu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:fu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(zy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return AV(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:fu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(zy(i)?i:Promise.resolve(i));return AV(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),u=()=>o.addIssue({code:G.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(s=>s?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new xi({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ga.create(this,this._def)}nullable(){return ec.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mi.create(this,this._def)}promise(){return df.create(this,this._def)}or(t){return vh.create([this,t],this._def)}and(t){return gh.create(this,t,this._def)}transform(t){return new xi({...Re(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new $h({...Re(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new FV({typeName:_e.ZodBranded,type:this,...Re(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Jy({...Re(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Th.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const qSe=/^c[^\s-]{8,}$/i,USe=/^[a-z][a-z0-9]*$/,BSe=/[0-9A-HJKMNP-TV-Z]{26}/,zSe=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,KSe=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,VSe=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,HSe=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,GSe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,YSe=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function JSe(e,t){return!!((t==="v4"||!t)&&HSe.test(e)||(t==="v6"||!t)&&GSe.test(e))}class Ri extends Ae{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:G.invalid_string,...me.errToObj(r)}),this.nonempty=t=>this.min(1,me.errToObj(t)),this.trim=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.string,received:o.parsedType}),Oe}const r=new Cn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,u=t.data.length<o.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?ue(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&ue(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")KSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"email",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")VSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"emoji",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")zSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"uuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")qSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")USe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid2",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")BSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ulid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ue(i,{validation:"url",code:G.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"regex",code:G.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?YSe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?JSe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ip",code:G.invalid_string,message:o.message}),r.dirty()):Je.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Ri({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...me.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...me.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...me.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...me.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...me.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...me.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...me.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...me.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...me.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ri.create=e=>{var t;return new Ri({checks:[],typeName:_e.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Re(e)})};function ZSe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class du extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.number,received:o.parsedType}),Oe}let r;const i=new Cn;for(const o of this._def.checks)o.kind==="int"?Je.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:G.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?ZSe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_finite,message:o.message}),i.dirty()):Je.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,me.toString(n))}setLimit(t,n,r,i){return new du({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(t){return new du({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Je.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}du.create=e=>new du({checks:[],typeName:_e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class pu extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==oe.bigint){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.bigint,received:o.parsedType}),Oe}let r;const i=new Cn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Je.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,me.toString(n))}setLimit(t,n,r,i){return new pu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(t){return new pu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}pu.create=e=>{var t;return new pu({checks:[],typeName:_e.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Re(e)})};class ph extends Ae{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.boolean,received:r.parsedType}),Oe}return qn(t.data)}}ph.create=e=>new ph({typeName:_e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class Zs extends Ae{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.date,received:o.parsedType}),Oe}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_date}),Oe}const r=new Cn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Je.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Zs({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:me.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:me.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Zs.create=e=>new Zs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:_e.ZodDate,...Re(e)});class Ky extends Ae{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.symbol,received:r.parsedType}),Oe}return qn(t.data)}}Ky.create=e=>new Ky({typeName:_e.ZodSymbol,...Re(e)});class hh extends Ae{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.undefined,received:r.parsedType}),Oe}return qn(t.data)}}hh.create=e=>new hh({typeName:_e.ZodUndefined,...Re(e)});class mh extends Ae{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.null,received:r.parsedType}),Oe}return qn(t.data)}}mh.create=e=>new mh({typeName:_e.ZodNull,...Re(e)});class cf extends Ae{constructor(){super(...arguments),this._any=!0}_parse(t){return qn(t.data)}}cf.create=e=>new cf({typeName:_e.ZodAny,...Re(e)});class Xs extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(t){return qn(t.data)}}Xs.create=e=>new Xs({typeName:_e.ZodUnknown,...Re(e)});class va extends Ae{_parse(t){const n=this._getOrReturnCtx(t);return ue(n,{code:G.invalid_type,expected:oe.never,received:n.parsedType}),Oe}}va.create=e=>new va({typeName:_e.ZodNever,...Re(e)});class Vy extends Ae{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.void,received:r.parsedType}),Oe}return qn(t.data)}}Vy.create=e=>new Vy({typeName:_e.ZodVoid,...Re(e)});class Mi extends Ae{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return ue(n,{code:G.invalid_type,expected:oe.array,received:n.parsedType}),Oe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,u=n.data.length<i.exactLength.value;(a||u)&&(ue(n,{code:a?G.too_big:G.too_small,minimum:u?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ue(n,{code:G.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ue(n,{code:G.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>i.type._parseAsync(new lo(n,a,n.path,u)))).then(a=>Cn.mergeArray(r,a));const o=[...n.data].map((a,u)=>i.type._parseSync(new lo(n,a,n.path,u)));return Cn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Mi({...this._def,minLength:{value:t,message:me.toString(n)}})}max(t,n){return new Mi({...this._def,maxLength:{value:t,message:me.toString(n)}})}length(t,n){return new Mi({...this._def,exactLength:{value:t,message:me.toString(n)}})}nonempty(t){return this.min(1,t)}}Mi.create=(e,t)=>new Mi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Re(t)});function lf(e){if(e instanceof St){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ga.create(lf(r))}return new St({...e._def,shape:()=>t})}else return e instanceof Mi?new Mi({...e._def,type:lf(e.element)}):e instanceof ga?ga.create(lf(e.unwrap())):e instanceof ec?ec.create(lf(e.unwrap())):e instanceof fo?fo.create(e.items.map(t=>lf(t))):e}class St extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Je.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const c=this._getOrReturnCtx(t);return ue(c,{code:G.invalid_type,expected:oe.object,received:c.parsedType}),Oe}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof va&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||u.push(c);const s=[];for(const c of a){const l=o[c],f=i.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new lo(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof va){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of u)s.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")u.length>0&&(ue(i,{code:G.unrecognized_keys,keys:u}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of u){const f=i.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new lo(i,f,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of s){const f=await l.key;c.push({key:f,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Cn.mergeObjectSync(r,c)):Cn.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return me.errToObj,new St({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,u;const s=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=me.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new St({...this._def,unknownKeys:"strip"})}passthrough(){return new St({...this._def,unknownKeys:"passthrough"})}extend(t){return new St({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new St({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:_e.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new St({...this._def,catchall:t})}pick(t){const n={};return Je.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new St({...this._def,shape:()=>n})}omit(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new St({...this._def,shape:()=>n})}deepPartial(){return lf(this)}partial(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new St({...this._def,shape:()=>n})}required(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof ga;)o=o._def.innerType;n[r]=o}}),new St({...this._def,shape:()=>n})}keyof(){return NV(Je.objectKeys(this.shape))}}St.create=(e,t)=>new St({shape:()=>e,unknownKeys:"strip",catchall:va.create(),typeName:_e.ZodObject,...Re(t)}),St.strictCreate=(e,t)=>new St({shape:()=>e,unknownKeys:"strict",catchall:va.create(),typeName:_e.ZodObject,...Re(t)}),St.lazycreate=(e,t)=>new St({shape:e,unknownKeys:"strip",catchall:va.create(),typeName:_e.ZodObject,...Re(t)});class vh extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new Ei(u.ctx.common.issues));return ue(n,{code:G.invalid_union,unionErrors:a}),Oe}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const s of r){const c={...n,common:{...n.common,issues:[]},parent:null},l=s._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(s=>new Ei(s));return ue(n,{code:G.invalid_union,unionErrors:u}),Oe}}get options(){return this._def.options}}vh.create=(e,t)=>new vh({options:e,typeName:_e.ZodUnion,...Re(t)});const Hy=e=>e instanceof bh?Hy(e.schema):e instanceof xi?Hy(e.innerType()):e instanceof _h?[e.value]:e instanceof hu?e.options:e instanceof Sh?Object.keys(e.enum):e instanceof $h?Hy(e._def.innerType):e instanceof hh?[void 0]:e instanceof mh?[null]:null;class Gy extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ue(n,{code:G.invalid_type,expected:oe.object,received:n.parsedType}),Oe;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ue(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=Hy(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of a){if(i.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new Gy({typeName:_e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Re(r)})}}function jC(e,t){const n=fu(e),r=fu(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Je.objectKeys(t),o=Je.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=jC(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],u=t[o],s=jC(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class gh extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(PC(o)||PC(a))return Oe;const u=jC(o.value,a.value);return u.valid?((WC(o)||WC(a))&&n.dirty(),{status:n.value,value:u.data}):(ue(r,{code:G.invalid_intersection_types}),Oe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}gh.create=(e,t,n)=>new gh({left:e,right:t,typeName:_e.ZodIntersection,...Re(n)});class fo extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ue(r,{code:G.invalid_type,expected:oe.array,received:r.parsedType}),Oe;if(r.data.length<this._def.items.length)return ue(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&r.data.length>this._def.items.length&&(ue(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const s=this._def.items[u]||this._def.rest;return s?s._parse(new lo(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Cn.mergeArray(n,a)):Cn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new fo({...this._def,rest:t})}}fo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fo({items:e,typeName:_e.ZodTuple,rest:null,...Re(t)})};class yh extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ue(r,{code:G.invalid_type,expected:oe.object,received:r.parsedType}),Oe;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new lo(r,u,r.path,u)),value:a._parse(new lo(r,r.data[u],r.path,u))});return r.common.async?Cn.mergeObjectAsync(n,i):Cn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ae?new yh({keyType:t,valueType:n,typeName:_e.ZodRecord,...Re(r)}):new yh({keyType:Ri.create(),valueType:t,typeName:_e.ZodRecord,...Re(n)})}}class Yy extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ue(r,{code:G.invalid_type,expected:oe.map,received:r.parsedType}),Oe;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new lo(r,u,r.path,[c,"key"])),value:o._parse(new lo(r,s,r.path,[c,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const s of a){const c=await s.key,l=await s.value;if(c.status==="aborted"||l.status==="aborted")return Oe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const s of a){const c=s.key,l=s.value;if(c.status==="aborted"||l.status==="aborted")return Oe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}Yy.create=(e,t,n)=>new Yy({valueType:t,keyType:e,typeName:_e.ZodMap,...Re(n)});class Qs extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ue(r,{code:G.invalid_type,expected:oe.set,received:r.parsedType}),Oe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ue(r,{code:G.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ue(r,{code:G.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(s){const c=new Set;for(const l of s){if(l.status==="aborted")return Oe;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const u=[...r.data.values()].map((s,c)=>o._parse(new lo(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new Qs({...this._def,minSize:{value:t,message:me.toString(n)}})}max(t,n){return new Qs({...this._def,maxSize:{value:t,message:me.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Qs.create=(e,t)=>new Qs({valueType:e,minSize:null,maxSize:null,typeName:_e.ZodSet,...Re(t)});class ff extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ue(n,{code:G.invalid_type,expected:oe.function,received:n.parsedType}),Oe;function r(u,s){return Uy({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qy(),dh].filter(c=>!!c),issueData:{code:G.invalid_arguments,argumentsError:s}})}function i(u,s){return Uy({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qy(),dh].filter(c=>!!c),issueData:{code:G.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof df?qn(async(...u)=>{const s=new Ei([]),c=await this._def.args.parseAsync(u,o).catch(d=>{throw s.addIssue(r(u,d)),s}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(d=>{throw s.addIssue(i(l,d)),s})}):qn((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new Ei([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new Ei([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ff({...this._def,args:fo.create(t).rest(Xs.create())})}returns(t){return new ff({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ff({args:t||fo.create([]).rest(Xs.create()),returns:n||Xs.create(),typeName:_e.ZodFunction,...Re(r)})}}class bh extends Ae{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}bh.create=(e,t)=>new bh({getter:e,typeName:_e.ZodLazy,...Re(t)});class _h extends Ae{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ue(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:t.data}}get value(){return this._def.value}}_h.create=(e,t)=>new _h({value:e,typeName:_e.ZodLiteral,...Re(t)});function NV(e,t){return new hu({values:e,typeName:_e.ZodEnum,...Re(t)})}class hu extends Ae{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{expected:Je.joinValues(r),received:n.parsedType,code:G.invalid_type}),Oe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{received:n.data,code:G.invalid_enum_value,options:r}),Oe}return qn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return hu.create(t)}exclude(t){return hu.create(this.options.filter(n=>!t.includes(n)))}}hu.create=NV;class Sh extends Ae{_parse(t){const n=Je.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Je.objectValues(n);return ue(r,{expected:Je.joinValues(i),received:r.parsedType,code:G.invalid_type}),Oe}if(n.indexOf(t.data)===-1){const i=Je.objectValues(n);return ue(r,{received:r.data,code:G.invalid_enum_value,options:i}),Oe}return qn(t.data)}get enum(){return this._def.values}}Sh.create=(e,t)=>new Sh({values:e,typeName:_e.ZodNativeEnum,...Re(t)});class df extends Ae{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ue(n,{code:G.invalid_type,expected:oe.promise,received:n.parsedType}),Oe;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return qn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}df.create=(e,t)=>new df({type:e,typeName:_e.ZodPromise,...Re(t)});class xi extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{ue(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const a=u=>{const s=i.refinement(u,o);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Oe:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Oe:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!By(a))return a;const u=i.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>By(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Je.assertNever(i)}}xi.create=(e,t,n)=>new xi({schema:e,typeName:_e.ZodEffects,effect:t,...Re(n)}),xi.createWithPreprocess=(e,t,n)=>new xi({schema:t,effect:{type:"preprocess",transform:e},typeName:_e.ZodEffects,...Re(n)});class ga extends Ae{_parse(t){return this._getType(t)===oe.undefined?qn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ga.create=(e,t)=>new ga({innerType:e,typeName:_e.ZodOptional,...Re(t)});class ec extends Ae{_parse(t){return this._getType(t)===oe.null?qn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ec.create=(e,t)=>new ec({innerType:e,typeName:_e.ZodNullable,...Re(t)});class $h extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}$h.create=(e,t)=>new $h({innerType:e,typeName:_e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Re(t)});class Jy extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return zy(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Jy.create=(e,t)=>new Jy({innerType:e,typeName:_e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Re(t)});class Zy extends Ae{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.nan,received:r.parsedType}),Oe}return{status:"valid",value:t.data}}}Zy.create=e=>new Zy({typeName:_e.ZodNaN,...Re(e)});const XSe=Symbol("zod_brand");class FV extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Th extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Oe:o.status==="dirty"?(n.dirty(),kV(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Oe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Th({in:t,out:n,typeName:_e.ZodPipeline})}}const PV=(e,t={},n)=>e?cf.create().superRefine((r,i)=>{var o,a;if(!e(r)){const u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,s=(a=(o=u.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...c,fatal:s})}}):cf.create(),QSe={object:St.lazycreate};var _e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(_e||(_e={}));const e$e=(e,t={message:`Input not instance of ${e.name}`})=>PV(n=>n instanceof e,t),ki=Ri.create,mu=du.create,t$e=Zy.create,n$e=pu.create,WV=ph.create,r$e=Zs.create,i$e=Ky.create,o$e=hh.create,a$e=mh.create,u$e=cf.create,jV=Xs.create,s$e=va.create,c$e=Vy.create,LC=Mi.create,pf=St.create,l$e=St.strictCreate,f$e=vh.create,d$e=Gy.create,p$e=gh.create,h$e=fo.create,m$e=yh.create,v$e=Yy.create,g$e=Qs.create,y$e=ff.create,b$e=bh.create,_$e=_h.create,S$e=hu.create,$$e=Sh.create,T$e=df.create,LV=xi.create,I$e=ga.create,O$e=ec.create,w$e=xi.createWithPreprocess,C$e=Th.create;var Un=Object.freeze({__proto__:null,defaultErrorMap:dh,setErrorMap:LSe,getErrorMap:qy,makeIssue:Uy,EMPTY_PATH:DSe,addIssueToContext:ue,ParseStatus:Cn,INVALID:Oe,DIRTY:kV,OK:qn,isAborted:PC,isDirty:WC,isValid:By,isAsync:zy,get util(){return Je},get objectUtil(){return FC},ZodParsedType:oe,getParsedType:fu,ZodType:Ae,ZodString:Ri,ZodNumber:du,ZodBigInt:pu,ZodBoolean:ph,ZodDate:Zs,ZodSymbol:Ky,ZodUndefined:hh,ZodNull:mh,ZodAny:cf,ZodUnknown:Xs,ZodNever:va,ZodVoid:Vy,ZodArray:Mi,ZodObject:St,ZodUnion:vh,ZodDiscriminatedUnion:Gy,ZodIntersection:gh,ZodTuple:fo,ZodRecord:yh,ZodMap:Yy,ZodSet:Qs,ZodFunction:ff,ZodLazy:bh,ZodLiteral:_h,ZodEnum:hu,ZodNativeEnum:Sh,ZodPromise:df,ZodEffects:xi,ZodTransformer:xi,ZodOptional:ga,ZodNullable:ec,ZodDefault:$h,ZodCatch:Jy,ZodNaN:Zy,BRAND:XSe,ZodBranded:FV,ZodPipeline:Th,custom:PV,Schema:Ae,ZodSchema:Ae,late:QSe,get ZodFirstPartyTypeKind(){return _e},coerce:{string:e=>Ri.create({...e,coerce:!0}),number:e=>du.create({...e,coerce:!0}),boolean:e=>ph.create({...e,coerce:!0}),bigint:e=>pu.create({...e,coerce:!0}),date:e=>Zs.create({...e,coerce:!0})},any:u$e,array:LC,bigint:n$e,boolean:WV,date:r$e,discriminatedUnion:d$e,effect:LV,enum:S$e,function:y$e,instanceof:e$e,intersection:p$e,lazy:b$e,literal:_$e,map:v$e,nan:t$e,nativeEnum:$$e,never:s$e,null:a$e,nullable:O$e,number:mu,object:pf,oboolean:()=>WV().optional(),onumber:()=>mu().optional(),optional:I$e,ostring:()=>ki().optional(),pipeline:C$e,preprocess:w$e,promise:T$e,record:m$e,set:g$e,strictObject:l$e,string:ki,symbol:i$e,transformer:LV,tuple:h$e,undefined:o$e,union:f$e,unknown:jV,void:c$e,NEVER:Oe,ZodIssueCode:G,quotelessJson:jSe,ZodError:Ei});function ya(e){return e!=null}async function DC(e,t){const{okType:n,errorType:r=M$e,signal:i,headers:o,body:a,timeout:u=1e4,...s}=t,c=new Headers(o);c.has("Content-Type")||c.set("Content-Type","application/json");const l=A$e();l&&c.set("Authorization",`Bearer ${l}`);const f=c.get("Content-Type")==="application/json"?JSON.stringify(a):a;let d=!1;try{const p=new AbortController,h=x$e([p.signal,i].filter(ya));setTimeout(()=>{d=!0,p.abort()},u);const v=await fetch(e,{...s,body:f,headers:c,signal:h}),{status:m}=v,_=v.clone(),g=await v.json().catch(S=>_.text());if(v.ok){const S=n.safeParse(g);return S.success?{ok:!0,body:S.data}:{ok:!1,error:"validation",status:m,cause:S.error}}else{const S=r.safeParse(g);return S.success?{ok:!1,error:"http",status:m,body:S.data}:{ok:!1,error:"validation",status:m,cause:S.error}}}catch(p){return k$e(p)?{ok:!1,error:d?"timeout":"abort"}:{ok:!1,error:"unknown",cause:p}}}const E$e=new Set(["http","abort","timeout","unknown","validation"]);function DV(e){return ya(e)&&!e.ok&&E$e.has(e.error)}function R$e(e){return DV(e)?e.error==="unknown"?!0:e.error!=="http"?!1:e.status===401||e.status===403:!1}const M$e=jV();function x$e(e){const t=new AbortController;function n(){t.abort();for(const r of e)r.removeEventListener("abort",n)}for(const r of e){if(r.aborted){n();break}r.addEventListener("abort",n)}return t.signal}function k$e(e){return e instanceof DOMException&&e.name==="AbortError"}let A$e=()=>"";function qV(e){const t=U.useRef(e);return U.useLayoutEffect(()=>{t.current=e}),U.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function UV(){const[e,t]=U.useState({});return U.useCallback(()=>t({}),[])}function BV(e,t,n){U.useEffect(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[n,t,e])}function N$e(e,t){P$e(e,t),F$e(e,t);const n=ba.get(e,t);if(!n){const r=e(...t);throw ba.set(e,t,{state:"fetching",promise:r}),zV(e,t,r).catch(i=>console.error(i)),r}if(n.state==="fetching")throw n.promise;if(n.ok)return n.body;throw n.error}function F$e(e,t){const n=UV(),r=UC(t);U.useEffect(()=>()=>{},[e,n,r])}function P$e(e,t){const n=UV();U.useEffect(()=>{const r=ba.getFetcherConfig(e).revalidationStrategy;if((r==null?void 0:r.type)==="never"||!(r!=null&&r.onFocus))return;function i(){if(document.visibilityState==="hidden")return;const o=ba.get(e,t);if(!o||o.state!=="fetched")return;const a=e(...t);o.ok?ba.set(e,t,{state:"revalidating",promise:a,ok:!0,body:o.body}):ba.set(e,t,{state:"revalidating",promise:a,ok:!1,error:o.error}),zV(e,t,a).then(n).catch(u=>console.error(u))}return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)})}function zV(e,t,n){return n.then(r=>ba.set(e,t,{state:"fetched",ok:!0,body:r})).catch(r=>ba.set(e,t,{state:"fetched",ok:!1,error:r}))}const ba=W$e(),qC=ba;function W$e(){const e=new Map,t=new Map,n={cacheCapacity:100,revalidationStrategy:{type:"swr",onFocus:!0}};function r(i){return e.get(i)??n}return{get(i,o){const a=UC(o),u=t.get(i);if(!u||!u.has(a))return;const s=u.get(a);return u.delete(a),s!==void 0&&u.set(a,s),s},set(i,o,a){let u=t.get(i);u||(u=new Map,t.set(i,u));const s=r(i),c=UC(o);u.size===s.cacheCapacity&&!u.has(c)&&u.delete(u.keys().next().value),u.set(c,a)},getFetcherConfig:r,registerFetcherConfig(i,o){e.set(i,o)},clear(...i){if(i.length>0)for(const o of i)t.delete(o);else t.clear()}}}function UC(e){return e.join(`
29
- `)}function BC(e,t){const n=N$e(e,t);if(!n.ok)throw n;return n.body}function Xy(e){try{return new URL(e)}catch{return}}const j$e=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>{const[o,a]=U.useState((r==null?void 0:r.embed_url)??""),u=f=>{a(f),Xy(f)||i(void 0)},[s,c]=U.useState(o),l=U.useCallback(f=>U.startTransition(()=>c(f)),[]);return BV(o,300,l),I.jsxs(C.Field,{footer:I.jsx(L$e,{url:s,content:r,onContentChange:i}),children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"cloud"})}),I.jsx(C.FieldLabel,{htmlFor:e,children:wr(n)}),I.jsx(C.FieldControl,{children:I.jsx(C.TextInput,{id:e,readOnly:t,placeholder:lu(n),value:o,onValueChange:u,variant:Xy(o)?"link":"normal",endAdornment:I.jsx(C.Button,{startIcon:I.jsx(C.Icon,{name:"close"}),variant:"secondary",size:"small",disabled:!o,onClick:()=>u("")})})})]})},L$e=({url:e,content:t,onContentChange:n})=>Xy(e)?e===(t==null?void 0:t.embed_url)?I.jsx(zC,{content:t}):I.jsx(D$e,{url:e,onError:()=>n(void 0),children:I.jsx(U.Suspense,{fallback:t&&I.jsx(zC,{content:t}),children:I.jsx(q$e,{url:e,onContentChange:n})})}):null;class D$e extends U.Component{constructor(){super(...arguments);Vf(this,"state",{hasError:!1})}static getDerivedStateFromError(n){return{hasError:KV(n)}}componentDidUpdate(n){this.state.hasError&&this.props.url!==n.url&&(qC.clear(VV),this.setState({hasError:!1}))}componentDidCatch(n){KV(n)&&this.props.onError()}render(){return this.state.hasError?I.jsx(C.FieldFooter,{children:I.jsx(C.EmptyEmbed,{title:"There is no embed data available."})}):this.props.children}}const KV=e=>DV(e)&&!R$e(e),zC=({content:e})=>I.jsx(C.FieldFooter,{children:I.jsx(C.EmbedPreview,{...z$e({content:e})})}),q$e=({url:e,onContentChange:t})=>{const n=U$e({url:e,onContentChange:t});return I.jsx(zC,{content:n})},U$e=({url:e,onContentChange:t})=>{const{embeds:n}=pd(),r=BC(VV,[e,n.url]),i=qV(t);return U.useEffect(()=>i(r),[r,i]),r},VV=async(e,t)=>{const n=new URL(t);return n.search=new URLSearchParams({url:e}).toString(),DC(n.toString(),{okType:B$e({url:e})})},B$e=({url:e})=>Un.object({type:Un.string(),version:Un.string().or(Un.number()).nullish(),title:Un.string().nullish(),author_name:Un.string().nullish(),author_url:Un.string().nullish(),provider_name:Un.string().nullish(),provider_url:Un.string().nullish(),cache_age:Un.string().or(Un.number()).nullish(),thumbnail_url:Un.string().nullish(),thumbnail_width:Un.number().nullish(),thumbnail_height:Un.number().nullish(),html:Un.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}}),z$e=({content:e})=>{let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t="View this post"+(e.provider_name?` on ${e.provider_name}`:"");break;default:t="Open"+(e.provider_name?` on ${e.provider_name}`:"")}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}},Ih="__MAIN_THUMBNAIL__";function HV(e,t,n){const r=e.name===Ih?void 0:e.name;let i;return t?ya(n)?i=[n.width,n.height]:ya(e.width)||ya(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}x${i[1]??"auto"}px`:void 0]}function K$e(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:Ih}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function V$e(e,t){var a,u;const{__TYPE__:n,thumbnails:r,...i}=t,o=(u=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:u.map(({name:s})=>r==null?void 0:r[s]);return[i,...o??[]]}function H$e(e,t,n,r){const i=r.length===0?void 0:r;return e===Ih?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function GV(e,t){const{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function YV(e,t,n,r,i){const o=new URL(e);if(i){const{x:a,y:u,width:s,height:c}=t;o.searchParams.set("rect",[a,u,s,c].join(",")),o.searchParams.set("w",n.toString()),o.searchParams.set("h",r.toString())}return o.toString()}function JV(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.set("w","800"),t.searchParams.set("h","800"),t.searchParams.set("auto","compress,format"),t.searchParams.set("fit","max"),t.toString()}function G$e(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.delete("fm"),t.searchParams.set("w","300"),t.searchParams.set("auto","compress,format"),t.toString()}const ZV=({contentView:e,constraints:t,croppedImage:n})=>{const[r,i]=GV(e.origin,t),o=YV(e.origin.url,n,r,i,!0);return{...e,width:r,height:i,url:o,edit:{...e.edit,zoom:n.zoom,crop:{x:n.x,y:n.y}}}},Y$e=({field:e,content:t,thumbnail:n,croppedImage:r})=>{var u,s,c,l;if(n===Ih){const f=ZV({contentView:t,constraints:(u=e.config)==null?void 0:u.constraint,croppedImage:r});return f.url===t.url?t:{...t,...f}}const i=(c=(s=e.config)==null?void 0:s.thumbnails)==null?void 0:c.find(f=>f.name===n),o=(l=t.thumbnails)==null?void 0:l[n];if(!i||!o)return t;const a=ZV({contentView:o,constraints:i,croppedImage:r});return a.url===o.url?t:{...t,thumbnails:{...t.thumbnails,[n]:a}}},J$e=({initialSize:e,constraints:t})=>{const n=t!=null&&t.width&&(t!=null&&t.height)?t.width/t.height:e.width/e.height,[r,i]=e.width<e.height?[e.width,Math.round(e.width/n)]:[Math.round(e.height*n),e.height],o=Math.max(r/e.width,i/e.height,1);return{width:Math.round(r/o),height:Math.round(i/o)}},Z$e=({contentView:e,constraints:t})=>{const n=J$e({initialSize:e.origin,constraints:t}),r=e.edit.zoom??1,i=Math.round(n.width/r),o=Math.round(n.height/r);return{...e.edit.crop,width:i,height:o,zoom:r}},XV={x:0,y:0,width:0,height:0,zoom:1},X$e=({selectedImage:{thumbnail:e,contentView:t}})=>e.width&&e.height?e.width/e.height:t?t.origin.width/t.origin.height:1,Q$e=({trigger:e,initialImages:t,initialOption:n,onClose:r})=>{var T;const[i,o]=$e.useState({}),[a,u]=$e.useState({}),[s,c]=$e.useState(!1),[l,f]=$e.useState(!1),[d,p]=$e.useState(n),h=t[d],v=M=>{if(!h)return;const R=h.thumbnail.name,q=i[R]??XV;o({...i,[R]:{...q,zoom:M}})},m=M=>{if(!h)return;const R=h.thumbnail.name,q=i[R]??XV;o({...i,[R]:{...q,...M}})},_=M=>{if(!h)return;const R=h.thumbnail.name,q=a[R];u({...a,[R]:{...q,crop:M}})},g=M=>{if(!h)return;const R=h.thumbnail.name,q=a[R]??{};u({...a,[R]:{...q,aspectRatio:M}})},S=i[(h==null?void 0:h.thumbnail.name)??""],b=s?S??((h==null?void 0:h.contentView)&&Z$e({contentView:h.contentView,constraints:h.thumbnail})):void 0,$=a[(h==null?void 0:h.thumbnail.name)??""];return I.jsxs(C.Dialog,{trigger:e,onAnimationEnd:()=>f(!0),open:s,onOpenChange:M=>{M?(p(n),o({}),u({})):(f(!1),r({option:d,croppedImages:i})),c(M)},children:[I.jsx(C.DialogHeader,{icon:"photo",title:"Image editor"}),I.jsx(C.DialogOptions,{value:String(d),onValueChange:M=>p(Number(M)),children:t.map((M,R)=>I.jsx(C.DialogOptionsItem,{value:String(R),icon:"photo",title:M.labels[0]??"Main",subtitle:M.labels[1]??""},M.thumbnail.name))}),h&&I.jsx(C.DialogContent,{children:l&&I.jsx(C.CropperControls,{image:((T=h.contentView)==null?void 0:T.origin.url)??"",crop:($==null?void 0:$.crop)??{x:0,y:0},onCropChange:_,zoom:(S==null?void 0:S.zoom)??1,onZoomChange:v,aspectRatio:X$e({selectedImage:h,cropper:$}),onAspectRatioChange:g,initialCroppedArea:b,onCropAreaChange:m},h.thumbnail.name)})]})},e0e=pf({id:ki(),kind:ki(),extension:ki(),filename:ki(),width:mu(),height:mu(),last_modified:mu(),url:ki()}),t0e=pf({total:mu(),cursor:ki(),items:LC(e0e)});function QV(e,t){const n=new URLSearchParams({assetType:"image",limit:"30"});return DC(`${e}?${n.toString()}`,{headers:{repository:t},okType:t0e})}qC.registerFetcherConfig(QV,{cacheCapacity:5,revalidationStrategy:{type:"swr",onFocus:!0}});function n0e(e,t){return BC(QV,[e,t]).items}const r0e=e=>{const{onMediaSelected:t}=e,n=pd();return n.assets?I.jsx(a0e,{children:I.jsx(C.ErrorBoundary,{errorImageSrc:C.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",renderError:r=>I.jsx(C.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:r}),children:I.jsx(U.Suspense,{fallback:I.jsx(C.MasonrySkeleton,{}),children:I.jsx(i0e,{assetsURL:n.assets.url,repository:n.assets.repository,onMediaSelected:t})})})}):null},i0e=e=>{const{assetsURL:t,repository:n,onMediaSelected:r}=e,i=n0e(t,n);return i.length===0?I.jsx(o0e,{}):I.jsx(C.Masonry,{items:i,getItemInfo:u0e,children:o=>I.jsx(C.MasonryMedia,{url:o.url,onClick:()=>r(o)})})},o0e=()=>I.jsx(C.Box,{backgroundColor:"grey3",borderRadius:4,alignItems:"center",justifyContent:"center",animation:"fadeIn",flex:1,children:I.jsxs(C.BlankSlate,{children:[I.jsx(C.BlankSlateIcon,{name:"cloudUpload"}),I.jsx(C.BlankSlateDescription,{children:"Drop files here or"}),I.jsx(C.BlankSlateActions,{children:I.jsx(C.Button,{variant:"secondary",size:"large",children:"Upload media"})})]})}),a0e=({children:e})=>I.jsx(C.ScrollArea,{style:{height:"100%",paddingInline:C.tokens.space[24],paddingTop:C.tokens.space[4]},children:e});function u0e(e){return{key:e.id,aspectRatio:e.width/e.height}}const s0e=pf({id:ki(),width:mu(),height:mu(),urls:pf({full:ki(),small:ki().transform(G$e)})}),c0e=pf({results:LC(s0e)}).transform(e=>e.results);function e3(e,t){const n=new URLSearchParams({page:"1",per_page:"30",query:t});return DC(`${e}/search/photos?${n.toString()}`,{okType:c0e})}qC.registerFetcherConfig(e3,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function l0e(e,t){return BC(e3,[e,t])}const f0e=e=>{const{onMediaSelected:t}=e,[n,r]=U.useState(""),[i,o]=U.useState(n),[a,u]=U.useTransition(),s=U.useCallback(c=>u(()=>o(c)),[]);return BV(n,200,s),I.jsxs(I.Fragment,{children:[I.jsx(C.Box,{padding:{inline:24},flexDirection:"column",children:I.jsx(C.SearchInput,{value:n,placeholder:"Search on Unsplash.com",onValueChange:r})}),I.jsx(h0e,{children:I.jsx(C.ErrorBoundary,{errorImageSrc:C.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",renderError:c=>I.jsx(C.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:c}),children:I.jsx(U.Suspense,{fallback:I.jsx(C.MasonrySkeleton,{}),children:I.jsx(d0e,{term:i,isUpdating:a,onMediaSelected:t})})})})]})},d0e=e=>{const{term:t,isUpdating:n,onMediaSelected:r}=e,i=pd(),o=l0e(i.unsplash.url,t||"fruit"),a=p0e(n);return o.length?I.jsx(C.Masonry,{items:o,getItemInfo:m0e,style:a,children:u=>I.jsx(C.MasonryMedia,{url:u.urls.small,onClick:()=>r({id:u.id,url:u.urls.full,width:u.width,height:u.height})})}):I.jsxs(C.BlankSlate,{style:{marginTop:"auto",marginBottom:"auto",...a},children:[I.jsx(C.BlankSlateImage,{children:I.jsx("img",{src:C.dialogErrorImage,alt:"No results"})}),I.jsx(C.BlankSlateTitle,{size:"big",children:"Oh no ..."}),I.jsx(C.BlankSlateDescription,{children:"The search returned no result."})]})};function p0e(e){return{opacity:e?.4:1,transitionProperty:e?"opacity":"none",transitionDuration:C.tokens.transitionDuration[300],transitionTimingFunction:C.tokens.transitionTimingFunction.easeInOut}}const h0e=({children:e})=>I.jsx(C.ScrollArea,{style:{height:"100%",paddingInline:C.tokens.space[24],paddingTop:C.tokens.space[4]},children:e});function m0e(e){return{key:e.id,aspectRatio:e.width/e.height}}const t3=e=>{const{trigger:t,onMediaSelected:n}=e,r=pd(),[i,o]=U.useState(!1),[a,u]=U.useState(r.assets?"media":"unsplash"),s=c=>{if(c!=="media"&&c!=="unsplash")throw new Error(`Invalid option ${c}.`);u(c)};return I.jsxs(C.Dialog,{trigger:t,open:i,onOpenChange:o,children:[I.jsx(C.DialogHeader,{icon:"folder",title:"Add an image"}),I.jsxs(C.DialogOptions,{value:a,onValueChange:s,children:[r.assets&&I.jsx(C.DialogOptionsItem,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),I.jsx(C.DialogOptionsItem,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"})]}),I.jsx(C.DialogContent,{children:I.jsx(v0e,{option:a,onMediaSelected:c=>{o(!1),n==null||n(c)}})})]})},v0e=e=>{const{option:t,onMediaSelected:n}=e;switch(t){case"media":return I.jsx(r0e,{onMediaSelected:n});case"unsplash":return I.jsx(f0e,{onMediaSelected:n})}};function g0e(e,t){const n={};for(const r in e)n[r]=t(e[r],r);return n}function y0e(e,t,n,r){var u,s,c,l,f,d;if(!n){const p=(u=t.config)==null?void 0:u.thumbnails,h=p&&Object.fromEntries(p.map(v=>[v.name,Qy(r,v)]));return{__TYPE__:"ImageContent",...Qy(r,(s=t.config)==null?void 0:s.constraint),thumbnails:h}}if(e===Ih){const p=Qy(r,(c=t.config)==null?void 0:c.constraint);return p.url===n.url?n:{...n,...p}}const i=(f=(l=t.config)==null?void 0:l.thumbnails)==null?void 0:f.find(p=>p.name===e);if(!i)return n;const o=(d=n.thumbnails)==null?void 0:d[e],a=Qy(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:g0e(n.thumbnails??{},(p,h)=>h===e?a:p)}}function Qy(e,t){const{width:n,height:r,rect:i}=b0e(e,t),o=Boolean((t==null?void 0:t.width)||(t==null?void 0:t.height));return{url:YV(e.url,i,n,r,o),origin:{id:e.id,url:e.url,width:e.width,height:e.height},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function b0e(e,t){const[n,r]=GV(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2),u=Math.round(n/i),s=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:u,height:s}}}const _0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const[o,a]=U.useState(0),[u,s]=U.useTransition(),c=S0e(t),l=c[o],f=e?V$e(t,e):void 0,d=f==null?void 0:f[o],p=wr(t),h=l?HV(l,e,d).filter(ya):[],v=e&&!i?"visible":"hidden";function m(b){if(!l)return;const $=y0e(l.name,t,e,b);$!==e&&s(()=>r($))}function _(b){s(()=>a(b))}const g=c.map((b,$)=>{const T=f==null?void 0:f[$];return{thumbnail:b,contentView:T,labels:HV(b,e,T)}}),S=({option:b,croppedImages:$})=>{if(a(b),!e)return;const T=Object.entries($).reduce((M,[R,q])=>Y$e({field:t,content:M,thumbnail:R,croppedImage:q}),e);T!==e&&s(()=>r(T))};return I.jsxs(C.Card,{color:"grey2",variant:"dashed",children:[I.jsxs(C.CardHeader,{children:[I.jsxs(C.CardHeaderTitle,{children:[p,h.length&&I.jsx(C.Text,{color:"grey11",component:"span",children:` • ${h.join(" • ")}`})]}),I.jsxs(C.CardHeaderActions,{style:{visibility:v},children:[I.jsx(Q$e,{trigger:I.jsx(C.Button,{startIcon:I.jsx(C.Icon,{name:"crop"}),children:"Crop & Resize"}),initialImages:g,initialOption:o,onClose:S}),I.jsx(t3,{trigger:I.jsx(C.Button,{startIcon:I.jsx(C.Icon,{name:"imageSearch"}),children:"Replace"}),onMediaSelected:m}),I.jsx(C.Button,{onClick:()=>{a(0),r(void 0)},startIcon:I.jsx(C.Icon,{name:"delete"}),children:"Clear"})]})]}),I.jsx(U.Suspense,{fallback:I.jsx("div",{style:{height:466}}),children:l&&e&&f?I.jsx($0e,{allContentViews:f,content:e,contentView:d,id:n,onContentChange:r,onPageChange:_,page:o,readOnly:i,thumbnailName:l.name,isUpdating:u}):I.jsx(T0e,{onMediaSelected:m,readOnly:i,isUpdating:u})})]})};function S0e(e){return U.useMemo(()=>K$e(e),[e])}const $0e=e=>{const{allContentViews:t,content:n,contentView:r,id:i,onContentChange:o,onPageChange:a,page:u,readOnly:s,thumbnailName:c,isUpdating:l}=e;return I.jsxs(C.CardContent,{children:[I.jsx(C.Carousel,{getItemSource:I0e,items:t,onPageChange:a,page:u,style:{height:400},children:f=>(f==null?void 0:f.url)&&I.jsx(C.CarouselItem,{src:JV(f.url),alt:f.alt??void 0,isUpdating:l},`${c}_${f.url}`)}),I.jsxs(C.Field,{labelPosition:"side",children:[I.jsx(C.FieldLabel,{htmlFor:i,children:"Alt text"}),I.jsx(C.FieldControl,{children:I.jsx(C.TextInput,{id:i,onValueChange:f=>{r&&o(H$e(c,n,r,f))},placeholder:"Short description for the visually impaired",readOnly:s||!r,value:(r==null?void 0:r.alt)??""})})]})]})},T0e=({onMediaSelected:e,readOnly:t,isUpdating:n})=>I.jsx(C.CardContent,{children:I.jsx(C.Card,{color:"grey3",variant:"outlined",children:I.jsx(C.CardContent,{style:{paddingBlock:parseFloat(C.tokens.space[48])},children:I.jsxs(C.BlankSlate,{children:[I.jsx(C.BlankSlateIcon,{name:"cloudUpload"}),I.jsx(C.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!t&&I.jsx(C.BlankSlateActions,{children:I.jsx(t3,{trigger:I.jsx(C.Button,{disabled:n,children:"Select image"}),onMediaSelected:e})})]})})})});function I0e(e){return e!=null&&e.url?JV(e.url):void 0}const O0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>I.jsxs(C.Field,{children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"notes"})}),I.jsx(C.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsx(C.FieldControl,{children:I.jsx(C.TextArea,{id:n,onChange:o=>{r(w0e(o.target.value))},placeholder:lu(t),readOnly:i,value:(e==null?void 0:e.value)??""})})]});function w0e(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function C0e(e){return e.charAt(0).toUpperCase()+e.slice(1)}const E0e=e=>{const{hasLink:t,onUnlink:n}=e;return I.jsxs(I.Fragment,{children:[I.jsx(C.Select,{value:"web",variant:"secondary",size:"small",icon:"public",disabled:!0,children:I.jsx(C.SelectItem,{value:"web",icon:"public",children:"Link to web page"})}),I.jsx(C.Button,{startIcon:I.jsx(C.Icon,{name:"linkOff"}),variant:"secondary",size:"small",disabled:!t,onClick:n})]})},R0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var h,v;const[o,a]=U.useState(!1),[u,s]=U.useState(!1);if((h=t.config)!=null&&h.select&&((v=t.config)==null?void 0:v.select)!=="web")return null;const c=(e==null?void 0:e.value.__TYPE__)==="ExternalLink"?e.value:void 0,l=c==null?void 0:c.url,f=l?Xy(l):void 0,d=(o||u)&&Boolean(f),p=m=>r(M0e(c,m));return I.jsx(C.LinkDescriptionPopover,{url:f,title:f?x0e(f):"",open:d,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,onMouseOverChange:s,anchor:I.jsxs(C.Field,{onMouseOverChange:a,children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"link"})}),I.jsx(C.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsx(C.FieldControl,{children:I.jsx(C.TextInput,{id:n,onValueChange:p,placeholder:lu(t),readOnly:i,value:l??"",variant:f?"link":"normal",onFocus:()=>a(!0),onBlur:()=>a(!1),endAdornment:I.jsx(E0e,{hasLink:Boolean(l),onUnlink:()=>p("")})})})]})})};function M0e(e,t){if(t)return e?{__TYPE__:"LinkContent",value:{...e,url:t}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t}}}function x0e(e){return e.host.split(".").slice(0,-1).filter(t=>t!=="www").map(C0e).join("")}const k0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var u,s;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return I.jsxs(C.Field,{children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"pin"})}),I.jsx(C.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsx(C.FieldControl,{children:I.jsx(C.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,placeholder:lu(t),readOnly:i,onValueChange:c=>r(A0e(c))})})]})};function A0e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function gn(e){this.content=e}gn.prototype={constructor:gn,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),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new gn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new gn(n)},addToStart:function(e,t){return new gn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new gn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new gn(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=gn.from(e),e.size?new gn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=gn.from(e),e.size?new gn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=gn.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}},gn.from=function(e){if(e instanceof gn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new gn(t)};function n3(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),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=n3(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function r3(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),u=t.child(--o),s=a.nodeSize;if(a==u){n-=s,r-=s;continue}if(!a.sameMarkup(u))return{a:n,b:r};if(a.isText&&a.text!=u.text){let c=0,l=Math.min(a.text.length,u.text.length);for(;c<l&&a.text[a.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||u.content.size){let c=r3(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class z{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&r(s,i+u,o||null,a)!==!1&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new z(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 o=0,a=0;a<n;o++){let u=this.content[o],s=a+u.nodeSize;s>t&&((a<t||s>n)&&(u.isText?u=u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u=u.cut(Math.max(0,t-a-1),Math.min(u.content.size,n-a-1))),r.push(u),i+=u.nodeSize),a=s}return new z(r,i)}cutByIndex(t,n){return t==n?z.empty:t==0&&n==this.content.length?this:new z(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new z(i,o)}addToStart(t){return new z([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new z(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))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(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return n3(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return r3(this,t,n,r)}findIndex(t,n=-1){if(t==0)return eb(0,t);if(t==this.size)return eb(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?eb(r+1,a):eb(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return z.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return z.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new z(n||t,r)}static from(t){if(!t)return z.empty;if(t instanceof z)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new z([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const KC={index:0,offset:0};function eb(e,t){return KC.index=e,KC.offset=t,KC}function tb(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 r=0;r<e.length;r++)if(!tb(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!tb(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let rt=class BR{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&tb(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return BR.none;if(t instanceof BR)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};rt.none=[];class nb extends Error{}class se{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=o3(this.content,t+this.openStart,n);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(t,n){return new se(i3(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return se.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new se(z.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new se(t,r,i)}}se.empty=new se(z.empty,0,0);function i3(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:u}=e.findIndex(n);if(i==t||o.isText){if(u!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(i3(o.content,t-i-1,n-i-1)))}function o3(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=o3(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function N0e(e,t,n){if(n.openStart>e.depth)throw new nb("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new nb("Inconsistent open depths");return a3(e,t,n,0)}function a3(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=a3(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,u=a.content;return nc(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=F0e(n,e);return nc(o,s3(e,a,u,t,r))}else return nc(o,rb(e,t,r))}function u3(e,t){if(!t.type.compatibleContent(e.type))throw new nb("Cannot join "+t.type.name+" onto "+e.type.name)}function VC(e,t,n){let r=e.node(n);return u3(r,t.node(n)),r}function tc(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 Oh(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(tc(e.nodeAfter,r),o++));for(let u=o;u<a;u++)tc(i.child(u),r);t&&t.depth==n&&t.textOffset&&tc(t.nodeBefore,r)}function nc(e,t){return e.type.checkContent(t),e.copy(t)}function s3(e,t,n,r,i){let o=e.depth>i&&VC(e,t,i+1),a=r.depth>i&&VC(n,r,i+1),u=[];return Oh(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(u3(o,a),tc(nc(o,s3(e,t,n,r,i+1)),u)):(o&&tc(nc(o,rb(e,t,i+1)),u),Oh(t,n,i,u),a&&tc(nc(a,rb(n,r,i+1)),u)),Oh(r,null,i,u),new z(u)}function rb(e,t,n){let r=[];if(Oh(null,e,n,r),e.depth>n){let i=VC(e,t,n+1);tc(nc(i,rb(e,t,n+1)),r)}return Oh(t,null,n,r),new z(r)}function F0e(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(z.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class wh{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return rt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new ib(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u),a.isText))break;o=c-1,i+=s+1}return new wh(n,r,o)}static resolveCached(t,n){for(let i=0;i<HC.length;i++){let o=HC[i];if(o.pos==n&&o.doc==t)return o}let r=HC[GC]=wh.resolve(t,n);return GC=(GC+1)%P0e,r}}let HC=[],GC=0,P0e=12;class ib{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}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)}}const W0e=Object.create(null);let rc=class zR{constructor(t,n,r,i=rt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||z.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&tb(this.attrs,n||t.defaultAttrs||W0e)&&rt.sameSet(this.marks,r||rt.none)}copy(t=null){return t==this.content?this:new zR(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new zR(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return se.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),c=i.node(a).content.cut(i.pos-u,o.pos-u);return new se(c,i.depth-a,o.depth-a)}replace(t,n,r){return N0e(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return wh.resolveCached(this,t)}resolveNoCache(t){return wh.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),c3(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=z.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=rt.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!rt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=z.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};rc.prototype.text=void 0;class ob extends rc{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):c3(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new ob(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ob(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function c3(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class ic{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new j0e(t,n);if(r.next==null)return ic.empty;let i=l3(r);r.next&&r.err("Unexpected trailing text");let o=K0e(z0e(i));return V0e(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return z.from(u.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:u,next:s}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||s.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
30
- `)}}ic.empty=new ic(!0);class j0e{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function l3(e){let t=[];do t.push(L0e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function L0e(e){let t=[];do t.push(D0e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function D0e(e){let t=B0e(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=q0e(e,t);else break;return t}function f3(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function q0e(e,t){let n=f3(e),r=n;return e.eat(",")&&(e.next!="}"?r=f3(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function U0e(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function B0e(e){if(e.eat("(")){let t=l3(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=U0e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function z0e(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,u,s){let c={term:s,to:u};return t[a].push(c),c}function i(a,u){a.forEach(s=>s.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(o(c,u)),[]);if(a.type=="seq")for(let s=0;;s++){let c=o(a.exprs[s],u);if(s==a.exprs.length-1)return c;i(c,u=n())}else if(a.type=="star"){let s=n();return r(u,s),i(o(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(o(a.expr,u),s),i(o(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let s=u;for(let c=0;c<a.min;c++){let l=n();i(o(a.expr,s),l),s=l}if(a.max==-1)i(o(a.expr,s),s);else for(let c=a.min;c<a.max;c++){let l=n();r(s,l),i(o(a.expr,s),l),s=l}return[r(s)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function d3(e,t){return t-e}function p3(e,t){let n=[];return r(t),n.sort(d3);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];!u&&n.indexOf(s)==-1&&r(s)}}}function K0e(e){let t=Object.create(null);return n(p3(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:u,to:s})=>{if(!u)return;let c;for(let l=0;l<i.length;l++)i[l][0]==u&&(c=i[l][1]);p3(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new ic(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(d3);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function V0e(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:s,next:c}=i.next[u];a.push(s.name),o&&!(s.isText||s.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function h3(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 m3(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function v3(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new H0e(e[n]);return t}let g3=class j6{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=v3(r.attrs),this.defaultAttrs=h3(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ic.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:m3(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new rc(this,this.computeAttrs(t),z.from(n),rt.setFrom(r))}createChecked(t=null,n,r){return n=z.from(n),this.checkContent(n),new rc(this,this.computeAttrs(t),n,rt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=z.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(z.empty,!0);return o?new rc(this,t,n.append(o),rt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:rt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new j6(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class H0e{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class ab{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=v3(i.attrs),this.excluded=null;let o=h3(this.attrs);this.instance=o?new rt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new rt(this,m3(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new ab(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class G0e{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=gn.from(t.nodes),n.marks=gn.from(t.marks||{}),this.nodes=g3.compile(this.spec.nodes,this),this.marks=ab.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=ic.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?y3(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:y3(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof g3){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new ob(r,r.defaultAttrs,t,rt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return rc.fromJSON(this,t)}markFromJSON(t){return rt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function y3(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let u in e.marks){let s=e.marks[u];(i=="_"||s.spec.group&&s.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class hf{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new $3(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new $3(this,n,!0);return r.addAll(t,n.from,n.to),se.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(Z0e(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(u.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(u.charCodeAt(t.length)!=61||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let u=n[a];if((u.priority==null?50:u.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=T3(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=T3(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new hf(t,hf.schemaRules(t)))}}const b3={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Y0e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_3={ol:!0,ul:!0},ub=1,sb=2,Ch=4;function S3(e,t,n){return t!=null?(t?ub:0)|(t==="full"?sb:0):e&&e.whitespace=="pre"?ub|sb:n&~Ch}class cb{constructor(t,n,r,i,o,a,u){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=rt.none,this.stashMarks=[],this.match=a||(u&Ch?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(z.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&ub)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=z.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(z.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):Q0e(i.type,t))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!b3.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class $3{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=S3(null,n.preserveWhitespace,0)|(r?Ch:0);i?o=new cb(i.type,i.attrs,rt.none,rt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new cb(null,null,rt.none,rt.none,!0,null,a):o=new cb(t.schema.topNodeType,null,rt.none,rt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let r=this.readStyles(X0e(n));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(t);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&sb||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&ub)r.options&sb?n=n.replace(/\r\n?/g,`
31
- `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;_3.hasOwnProperty(r)&&this.parser.normalizeLists&&J0e(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:Y0e.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let a,u=this.top,s=this.needsBlock;if(b3.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
32
- `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=rt.none,r=rt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(s=>this.insertNode(s));else{let s=t;typeof n.contentElement=="string"?s=t.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=r==null?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=S3(t,i,o.options);o.options&Ch&&o.content.length==0&&(a|=Ch),this.nodes.push(new cb(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));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(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(u,s)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;s>=o;s--)if(a(u-1,s))return!0;return!1}else{let l=s>0||s==0&&i?this.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!l||l.name!=c&&l.groups.indexOf(c)==-1)return!1;s--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=eTe(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let a=i.popFromStashMark(t);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==n)break}}}function J0e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&_3.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function Z0e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function X0e(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function T3(e){let t={};for(let n in e)t[n]=e[n];return t}function Q0e(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=u=>{o.push(u);for(let s=0;s<u.edgeCount;s++){let{type:c,next:l}=u.edge(s);if(c==t||o.indexOf(l)<0&&a(l))return!0}};if(a(i.contentMatch))return!0}}function eTe(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class po{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=YC(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let u=0,s=0;for(;u<o.length&&s<a.marks.length;){let c=a.marks[s];if(!this.marks[c.type.name]){s++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,s++}for(;u<o.length;)i=o.pop()[1];for(;s<a.marks.length;){let c=a.marks[s++],l=this.serializeMark(c,a.isInline,n);l&&(o.push([c,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=po.renderSpec(YC(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&po.renderSpec(YC(r),i(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){c=2;for(let l in s)if(s[l]!=null){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let l=c;l<n.length;l++){let f=n[l];if(f===0){if(l<n.length-1||l>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:d,contentDOM:p}=po.renderSpec(t,f,r);if(u.appendChild(d),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new po(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=I3(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return I3(t.marks)}}function I3(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function YC(e){return e.document||window.document}const O3=65535,w3=Math.pow(2,16);function tTe(e,t){return e+t*w3}function C3(e){return e&O3}function nTe(e){return(e-(e&O3))/w3}const E3=1,R3=2,lb=4,M3=8;class JC{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&M3)>0}get deletedBefore(){return(this.delInfo&(E3|lb))>0}get deletedAfter(){return(this.delInfo&(R3|lb))>0}get deletedAcross(){return(this.delInfo&lb)>0}}class Hr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Hr.empty)return Hr.empty}recover(t){let n=0,r=C3(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+nTe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:tTe(u/3,t-s),v=t==s?R3:t==f?E3:lb;return(n<0?t!=s:t!=f)&&(v|=M3),new JC(p,v,h)}i+=l-c}return r?t+i:new JC(t+i,0,null)}touches(t,n){let r=0,i=C3(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o],l=s+c;if(t<=l&&u==i*3)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Hr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Hr.empty:new Hr(t<0?[0,-t,0]:[0,0,t])}}Hr.empty=new Hr([]);class Eh{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new Eh(this.maps,this.mirror,t,n)}copy(){return new Eh(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Eh;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],u=a.mapResult(t,n);if(u.recover!=null){let s=this.getMirror(o);if(s!=null&&s>o&&s<this.to){o=s,t=this.maps[s].recover(u.recover);continue}}i|=u.delInfo,t=u.pos}return r?t:new JC(t,i,null)}}const ZC=Object.create(null);class ur{getMap(){return Hr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ZC[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in ZC)throw new RangeError("Duplicate use of step JSON ID "+t);return ZC[t]=n,n.prototype.jsonID=t,n}}class Vt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Vt(t,null)}static fail(t){return new Vt(null,t)}static fromReplace(t,n,r,i){try{return Vt.ok(t.replace(n,r,i))}catch(o){if(o instanceof nb)return Vt.fail(o.message);throw o}}}function XC(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(XC(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return z.fromArray(r)}class vu extends ur{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new se(XC(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Vt.fromReplace(t,this.from,this.to,o)}invert(){return new ho(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 vu(n.pos,r.pos,this.mark)}merge(t){return t instanceof vu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new vu(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 new RangeError("Invalid input for AddMarkStep.fromJSON");return new vu(n.from,n.to,t.markFromJSON(n.mark))}}ur.jsonID("addMark",vu);class ho extends ur{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new se(XC(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Vt.fromReplace(t,this.from,this.to,r)}invert(){return new vu(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 ho(n.pos,r.pos,this.mark)}merge(t){return t instanceof ho&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ho(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 new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ho(n.from,n.to,t.markFromJSON(n.mark))}}ur.jsonID("removeMark",ho);class gu extends ur{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new gu(this.pos,n.marks[i]);return new gu(this.pos,this.mark)}}return new mf(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new gu(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 new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new gu(n.pos,t.markFromJSON(n.mark))}}ur.jsonID("addNodeMark",gu);class mf extends ur{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new gu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new mf(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 new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new mf(n.pos,t.markFromJSON(n.mark))}}ur.jsonID("removeNodeMark",mf);class En extends ur{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&QC(t,this.from,this.to)?Vt.fail("Structure replace would overwrite content"):Vt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Hr([this.from,this.to-this.from,this.slice.size])}invert(t){return new En(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new En(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof En)||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?se.empty:new se(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new En(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?se.empty:new se(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new En(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new En(n.from,n.to,se.fromJSON(t,n.slice),!!n.structure)}}ur.jsonID("replace",En);class tn extends ur{constructor(t,n,r,i,o,a,u=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=u}apply(t){if(this.structure&&(QC(t,this.from,this.gapFrom)||QC(t,this.gapTo,this.to)))return Vt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Vt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Vt.fromReplace(t,this.from,this.to,r):Vt.fail("Content does not fit in gap")}getMap(){return new Hr([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 tn(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=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new tn(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}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 new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new tn(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(t,n.slice),n.insert,!!n.structure)}}ur.jsonID("replaceAround",tn);function QC(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function rTe(e,t,n,r){let i=[],o=[],a,u;e.doc.nodesBetween(t,n,(s,c,l)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&l.type.allowsMarkType(r.type)){let d=Math.max(c,t),p=Math.min(c+s.nodeSize,n),h=r.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(h)||(a&&a.to==d&&a.mark.eq(f[v])?a.to=p:i.push(a=new ho(d,p,f[v])));u&&u.to==d?u.to=p:o.push(u=new vu(d,p,r))}}),i.forEach(s=>e.step(s)),o.forEach(s=>e.step(s))}function iTe(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,u)=>{if(!a.isInline)return;o++;let s=null;if(r instanceof ab){let c=a.marks,l;for(;l=r.isInSet(c);)(s||(s=[])).push(l),c=l.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(u+a.nodeSize,n);for(let l=0;l<s.length;l++){let f=s[l],d;for(let p=0;p<i.length;p++){let h=i[p];h.step==o-1&&f.eq(i[p].style)&&(d=h)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(u,t),to:c,step:o})}}}),i.forEach(a=>e.step(new ho(a.from,a.to,a.style)))}function oTe(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],a=t+1;for(let u=0;u<i.childCount;u++){let s=i.child(u),c=a+s.nodeSize,l=r.matchType(s.type);if(!l)o.push(new En(a,c,se.empty));else{r=l;for(let f=0;f<s.marks.length;f++)n.allowsMarkType(s.marks[f].type)||e.step(new ho(a,c,s.marks[f]))}a=c}if(!r.validEnd){let u=r.fillBefore(z.empty,!0);e.replace(a,a,new se(u,0,0))}for(let u=o.length-1;u>=0;u--)e.step(o[u])}function aTe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function vf(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!aTe(i,o,a))break}return null}function uTe(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),u=i.after(o+1),s=a,c=u,l=z.empty,f=0;for(let h=o,v=!1;h>n;h--)v||r.index(h)>0?(v=!0,l=z.from(r.node(h).copy(l)),f++):s--;let d=z.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)<i.end(h)?(v=!0,d=z.from(i.node(h).copy(d)),p++):c++;e.step(new tn(s,c,a,u,new se(l.append(d),f,p),l.size-f,!0))}function eE(e,t,n=null,r=e){let i=sTe(e,t),o=i&&cTe(r,t);return o?i.map(x3).concat({type:t,attrs:n}).concat(o.map(x3)):null}function x3(e){return{type:e,attrs:null}}function sTe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function cTe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;s&&c<i;c++)s=s.matchType(n.child(c).type);return!s||!s.validEnd?null:a}function lTe(e,t,n){let r=z.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let u=n[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=z.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new tn(i,o,i,o,new se(r,0,0),n.length,!0))}function fTe(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&dTe(e.doc,e.mapping.slice(o).map(u),r)){e.clearIncompatible(e.mapping.slice(o).map(u,1),r);let s=e.mapping.slice(o),c=s.map(u,1),l=s.map(u+a.nodeSize,1);return e.step(new tn(c,l,c+1,l-1,new se(z.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function dTe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function pTe(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new tn(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new se(z.from(a),0,0),1,!0))}function gf(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,l=n-2;c>o;c--,l--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[l]||f;if(h!=f&&(p=p.replaceChild(0,h.type.create(h.attrs))),!f.canReplace(d+1,f.childCount)||!h.type.validContent(p))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function hTe(e,t,n=1,r){let i=e.doc.resolve(t),o=z.empty,a=z.empty;for(let u=i.depth,s=i.depth-n,c=n-1;u>s;u--,c--){o=z.from(i.node(u).copy(o));let l=r&&r[c];a=z.from(l?l.type.create(l.attrs,a):i.node(u).copy(a))}e.step(new En(t,t,new se(o.append(a),n,n),!0))}function yu(e,t){let n=e.resolve(t),r=n.index();return k3(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function k3(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function A3(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&k3(o,a)&&r.node(i).canReplace(u,u+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function mTe(e,t,n){let r=new En(t-n,t+n,se.empty,!0);e.step(r)}function vTe(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 i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function gTe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,s=r.index(a)+(u>0?1:0),c=r.node(a),l=!1;if(o==1)l=c.canReplace(s,s,i);else{let f=c.contentMatchAt(s).findWrapping(i.firstChild.type);l=f&&c.canReplaceWith(s,s,f[0])}if(l)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function tE(e,t,n=t,r=se.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return N3(i,o,r)?new En(t,n,r):new yTe(i,o,r).fit()}function N3(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class yTe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=z.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=z.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let s=new se(o,a,u);return t>-1?new tn(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new En(r.pos,i.pos,s):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=nE(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:s,match:c}=this.frontier[u],l,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(z.from(a),!1)):o&&s.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:f};if(n==2&&a&&(l=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=nE(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new se(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=nE(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new se(Rh(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new se(Rh(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,u=r?r.content:a.content,s=a.openStart-t,c=0,l=[],{match:f,type:d}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));f=f.matchFragment(i)}let p=u.size+t-(a.content.size-a.openEnd);for(;c<u.childCount;){let v=u.child(c),m=f.matchType(v.type);if(!m)break;c++,(c>1||s==0||v.content.size)&&(f=m,l.push(F3(v.mark(d.allowedMarks(v.marks)),c==1?s:0,c==u.childCount?p:-1)))}let h=c==u.childCount;h||(p=-1),this.placed=Mh(this.placed,n,z.from(l)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,m=u;v<p;v++){let _=m.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),m=_.content}this.unplaced=h?t==0?se.empty:new se(Rh(a.content,t-1,1),t-1,p<0?a.openEnd:t-1):new se(Rh(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!rE(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=rE(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=rE(t,u,c,s,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Mh(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Mh(this.placed,this.depth,z.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(z.empty,!0);n.childCount&&(this.placed=Mh(this.placed,this.frontier.length,n))}}function Rh(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Rh(e.firstChild.content,t-1,n)))}function Mh(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Mh(e.lastChild.content,t-1,n)))}function nE(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function F3(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,F3(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(z.empty,!0)))),e.copy(r)}function rE(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!bTe(n,o.content,a)?u:null}function bTe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function _Te(e){return e.spec.defining||e.spec.definingForContent}function STe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(N3(i,o,r))return e.step(new En(t,n,r));let a=W3(i,e.doc.resolve(n));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let d=i.depth,p=i.pos-1;d>0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(d)>-1?u=d:i.before(d)==p&&a.splice(1,0,-d)}let s=a.indexOf(u),c=[],l=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(c.push(h),p==r.openStart)break;d=h.content}for(let d=l-1;d>=0;d--){let p=c[d].type,h=_Te(p);if(h&&i.node(s).type!=p)l=d;else if(h||!p.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+l+1)%(r.openStart+1),h=c[p];if(h)for(let v=0;v<a.length;v++){let m=a[(v+s)%a.length],_=!0;m<0&&(_=!1,m=-m);let g=i.node(m-1),S=i.index(m-1);if(g.canReplaceWith(S,S,h.type,h.marks))return e.replace(i.before(m),_?o.after(m):n,new se(P3(r.content,0,r.openStart,p),p,r.openEnd))}}let f=e.steps.length;for(let d=a.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=a[d];p<0||(t=i.before(p),n=o.after(p))}}function P3(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(P3(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),a=o.fillBefore(e).append(e);e=a.append(o.matchFragment(a).fillBefore(z.empty,!0))}return e}function $Te(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=vTe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new se(z.from(r),0,0))}function TTe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=W3(r,i);for(let a=0;a<o.length;a++){let u=o[a],s=a==o.length-1;if(s&&u==0||r.node(u).type.contentMatch.validEnd)return e.delete(r.start(u),i.end(u));if(u>0&&(s||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return e.delete(r.before(u),i.after(u))}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)return e.delete(r.before(a),n);e.delete(t,n)}function W3(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<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;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class yf extends ur{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Vt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.from(i),0,n.isLeaf?0:1))}getMap(){return Hr.empty}invert(t){return new yf(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 yf(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 new RangeError("Invalid input for AttrStep.fromJSON");return new yf(n.pos,n.attr,n.value)}}ur.jsonID("attr",yf);let bf=class extends Error{};bf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},bf.prototype=Object.create(Error.prototype),bf.prototype.constructor=bf,bf.prototype.name="TransformError";class ITe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Eh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new bf(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=se.empty){let i=tE(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new se(z.from(r),0,0))}delete(t,n){return this.replace(t,n,se.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return STe(this,t,n,r),this}replaceRangeWith(t,n,r){return $Te(this,t,n,r),this}deleteRange(t,n){return TTe(this,t,n),this}lift(t,n){return uTe(this,t,n),this}join(t,n=1){return mTe(this,t,n),this}wrap(t,n){return lTe(this,t,n),this}setBlockType(t,n=t,r,i=null){return fTe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return pTe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new yf(t,n,r)),this}addNodeMark(t,n){return this.step(new gu(t,n)),this}removeNodeMark(t,n){if(!(n instanceof rt)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new mf(t,n)),this}split(t,n=1,r){return hTe(this,t,n,r),this}addMark(t,n,r){return rTe(this,t,n,r),this}removeMark(t,n,r){return iTe(this,t,n,r),this}clearIncompatible(t,n,r){return oTe(this,t,n,r),this}}const iE=Object.create(null);class We{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new OTe(t.min(n),t.max(n))]}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 t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=se.empty){let r=n.content.lastChild,i=null;for(let u=0;u<n.openEnd;u++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:s,$to:c}=a[u],l=t.mapping.slice(o);t.replaceRange(l.map(s.pos),l.map(c.pos),u?se.empty:n),u==0&&D3(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),D3(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Be(t):_f(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let a=n<0?_f(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):_f(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ai(t.node(0))}static atStart(t){return _f(t,t,0,0,1)||new Ai(t)}static atEnd(t){return _f(t,t,t.content.size,t.childCount,-1)||new Ai(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=iE[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in iE)throw new RangeError("Duplicate use of selection JSON ID "+t);return iE[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Be.between(this.$anchor,this.$head).getBookmark()}}We.prototype.visible=!0;class OTe{constructor(t,n){this.$from=t,this.$to=n}}let j3=!1;function L3(e){!j3&&!e.parent.inlineContent&&(j3=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Be extends We{constructor(t,n=t){L3(t),L3(n),super(t,n)}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 We.near(r);let i=t.resolve(n.map(this.anchor));return new Be(i.parent.inlineContent?i:r,r)}replace(t,n=se.empty){if(super.replace(t,n),n==se.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new fb(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 new RangeError("Invalid input for TextSelection.fromJSON");return new Be(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=We.findFrom(n,r,!0)||We.findFrom(n,-r,!0);if(o)n=o.$head;else return We.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(We.findFrom(t,-r,!0)||We.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Be(t,n)}}We.jsonID("text",Be);class fb{constructor(t,n){this.anchor=t,this.head=n}map(t){return new fb(t.map(this.anchor),t.map(this.head))}resolve(t){return Be.between(t.resolve(this.anchor),t.resolve(this.head))}}class Se extends We{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?We.near(o):new Se(o)}content(){return new se(z.from(this.node),0,0)}eq(t){return t instanceof Se&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new oE(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Se(t.resolve(n.anchor))}static create(t,n){return new Se(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Se.prototype.visible=!1,We.jsonID("node",Se);class oE{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new fb(r,r):new oE(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Se.isSelectable(r)?new Se(n):We.near(n)}}class Ai extends We{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=se.empty){if(n==se.empty){t.delete(0,t.doc.content.size);let r=We.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ai(t)}map(t){return new Ai(t)}eq(t){return t instanceof Ai}getBookmark(){return wTe}}We.jsonID("all",Ai);const wTe={map(){return this},resolve(e){return new Ai(e)}};function _f(e,t,n,r,i,o=!1){if(t.inlineContent)return Be.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let u=t.child(a);if(u.isAtom){if(!o&&Se.isSelectable(u))return Se.create(e,n-(i<0?u.nodeSize:0))}else{let s=_f(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function D3(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof En||i instanceof tn))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(We.near(e.doc.resolve(a),n))}const q3=1,db=2,U3=4;class CTe extends ITe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|q3)&~db,this.storedMarks=null,this}get selectionSet(){return(this.updated&q3)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=db,this}ensureMarks(t){return rt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&db)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~db,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||rt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(n);o=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),this.selection.empty||this.setSelection(We.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=U3,this}get scrolledIntoView(){return(this.updated&U3)>0}}function B3(e,t){return!t||!e?e:e.bind(t)}class xh{constructor(t,n,r){this.name=t,this.init=B3(n.init,r),this.apply=B3(n.apply,r)}}const ETe=[new xh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new xh("selection",{init(e,t){return e.selection||We.atStart(t.doc)},apply(e){return e.selection}}),new xh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new xh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class aE{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ETe.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new xh(r.key,r.spec.state,r))})}}class Sf{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Sf(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new CTe(this)}static create(t){let n=new aE(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Sf(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new aE(this.schema,t.plugins),r=n.fields,i=new Sf(n);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new aE(t.schema,t.plugins),o=new Sf(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=rc.fromJSON(t.schema,n.doc);else if(a.name=="selection")o.selection=We.fromJSON(o.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let u in r){let s=r[u],c=s.spec.state;if(s.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[a.name]=c.fromJSON.call(s,t,n[u],o);return}}o[a.name]=a.init(t,o)}}),o}}function z3(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=z3(i,t,{})),n[r]=i}return n}class Gr{constructor(t){this.spec=t,this.props={},t.props&&z3(t.props,this,this.props),this.key=t.key?t.key.key:K3("plugin")}getState(t){return t[this.key]}}const uE=Object.create(null);function K3(e){return e in uE?e+"$"+ ++uE[e]:(uE[e]=0,e+"$")}class bu{constructor(t="key"){this.key=K3(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Cr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},kh=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let V3=null;const _a=function(e,t,n){let r=V3||(V3=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},oc=function(e,t,n,r){return n&&(H3(e,t,n,r,-1)||H3(e,t,n,r,1))},RTe=/^(img|br|input|textarea|hr)$/i;function H3(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:mo(e))){let o=e.parentNode;if(!o||o.nodeType!=1||xTe(e)||RTe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Cr(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?mo(e):0}else return!1}}function mo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function MTe(e,t,n){for(let r=t==0,i=t==mo(e);r||i;){if(e==n)return!0;let o=Cr(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==mo(e)}}function xTe(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)}const pb=function(e){return e.focusNode&&oc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ac(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function kTe(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}const _u=typeof navigator<"u"?navigator:null,G3=typeof document<"u"?document:null,Su=_u&&_u.userAgent||"",sE=/Edge\/(\d+)/.exec(Su),Y3=/MSIE \d/.exec(Su),cE=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Su),sr=!!(Y3||cE||sE),$u=Y3?document.documentMode:cE?+cE[1]:sE?+sE[1]:0,Ni=!sr&&/gecko\/(\d+)/i.test(Su);Ni&&+(/Firefox\/(\d+)/.exec(Su)||[0,0])[1];const lE=!sr&&/Chrome\/(\d+)/.exec(Su),Bn=!!lE,ATe=lE?+lE[1]:0,zn=!sr&&!!_u&&/Apple Computer/.test(_u.vendor),$f=zn&&(/Mobile\/\w+/.test(Su)||!!_u&&_u.maxTouchPoints>2),Yr=$f||(_u?/Mac/.test(_u.platform):!1),Fi=/Android \d/.test(Su),hb=!!G3&&"webkitFontSmoothing"in G3.documentElement.style,NTe=hb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function FTe(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Tu(e,t){return typeof e=="number"?e:e[t]}function PTe(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 J3(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let a=n||e.dom;a;a=kh(a)){if(a.nodeType!=1)continue;let u=a,s=u==o.body,c=s?FTe(o):PTe(u),l=0,f=0;if(t.top<c.top+Tu(r,"top")?f=-(c.top-t.top+Tu(i,"top")):t.bottom>c.bottom-Tu(r,"bottom")&&(f=t.bottom-c.bottom+Tu(i,"bottom")),t.left<c.left+Tu(r,"left")?l=-(c.left-t.left+Tu(i,"left")):t.right>c.right-Tu(r,"right")&&(l=t.right-c.right+Tu(i,"right")),l||f)if(s)o.defaultView.scrollBy(l,f);else{let d=u.scrollLeft,p=u.scrollTop;f&&(u.scrollTop+=f),l&&(u.scrollLeft+=l);let h=u.scrollLeft-d,v=u.scrollTop-p;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(s)break}}function WTe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let u=e.root.elementFromPoint(o,a);if(!u||u==e.dom||!e.dom.contains(u))continue;let s=u.getBoundingClientRect();if(s.top>=n-20){r=u,i=s.top;break}}return{refDOM:r,refTop:i,stack:Z3(e.dom)}}function Z3(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=kh(r));return t}function jTe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;X3(n,r==0?0:r-t)}function X3(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Tf=null;function LTe(e){if(e.setActive)return e.setActive();if(Tf)return e.focus(Tf);let t=Z3(e);e.focus(Tf==null?{get preventScroll(){return Tf={preventScroll:!0},!0}}:void 0),Tf||(Tf=!1,X3(t,0))}function Q3(e,t){let n,r=2e8,i,o=0,a=t.top,u=t.top;for(let s=e.firstChild,c=0;s;s=s.nextSibling,c++){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=_a(s).getClientRects();else continue;for(let f=0;f<l.length;f++){let d=l[f];if(d.top<=a&&d.bottom>=u){a=Math.max(d.bottom,a),u=Math.min(d.top,u);let p=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(p<r){n=s,r=p,i=p&&n.nodeType==3?{left:d.right<t.left?d.right:d.left,top:t.top}:t,s.nodeType==1&&p&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&n.nodeType==3?DTe(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:Q3(n,i)}function DTe(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let o=Iu(r,1);if(o.top!=o.bottom&&fE(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function fE(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function qTe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function UTe(e,t,n){let{node:r,offset:i}=Q3(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function BTe(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let a=e.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let u=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(u.left>r.left||u.top>r.top?i=a.posBefore:(u.right<r.left||u.bottom<r.top)&&(i=a.posAfter)),!a.contentDOM&&i<0)return(a.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function e4(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)),o=i;;){let a=e.childNodes[o];if(a.nodeType==1){let u=a.getClientRects();for(let s=0;s<u.length;s++){let c=u[s];if(fE(t,c))return e4(a,t,c)}}if((o=(o+1)%r)==i)break}return e}function zTe(e,t){let n=e.dom.ownerDocument,r,i=0;if(n.caretPositionFromPoint)try{let s=n.caretPositionFromPoint(t.left,t.top);s&&({offsetNode:r,offset:i}=s)}catch{}if(!r&&n.caretRangeFromPoint){let s=n.caretRangeFromPoint(t.left,t.top);s&&({startContainer:r,startOffset:i}=s)}let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!o||!e.dom.contains(o.nodeType!=1?o.parentNode:o)){let s=e.dom.getBoundingClientRect();if(!fE(t,s)||(o=e4(e.dom,t,s),!o))return null}if(zn)for(let s=o;r&&s;s=kh(s))s.draggable&&(r=void 0);if(o=qTe(o,t),r){if(Ni&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let s=r.childNodes[i],c;s.nodeName=="IMG"&&(c=s.getBoundingClientRect()).right<=t.left&&c.bottom>t.top&&i++}r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=BTe(e,r,i,t))}a==null&&(a=UTe(e,o,t));let u=e.docView.nearestDesc(o,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function Iu(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const KTe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function t4(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),a=hb||Ni;if(r.nodeType==3)if(a&&(KTe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let s=Iu(_a(r,i,i),n);if(Ni&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=Iu(_a(r,i-1,i-1),-1);if(c.top==s.top){let l=Iu(_a(r,i,i+1),-1);if(l.top!=s.top)return Ah(l,l.left<c.left)}}return s}else{let s=i,c=i,l=n<0?1:-1;return n<0&&!i?(c++,l=-1):n>=0&&i==r.nodeValue.length?(s--,l=1):n<0?s--:c++,Ah(Iu(_a(r,s,c),1),l<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==mo(r))){let s=r.childNodes[i-1];if(s.nodeType==1)return dE(s.getBoundingClientRect(),!1)}if(o==null&&i<mo(r)){let s=r.childNodes[i];if(s.nodeType==1)return dE(s.getBoundingClientRect(),!0)}return dE(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==mo(r))){let s=r.childNodes[i-1],c=s.nodeType==3?_a(s,mo(s)-(a?0:1)):s.nodeType==1&&(s.nodeName!="BR"||!s.nextSibling)?s:null;if(c)return Ah(Iu(c,1),!1)}if(o==null&&i<mo(r)){let s=r.childNodes[i];for(;s.pmViewDesc&&s.pmViewDesc.ignoreForCoords;)s=s.nextSibling;let c=s?s.nodeType==3?_a(s,0,a?0:1):s.nodeType==1?s:null:null;if(c)return Ah(Iu(c,-1),!0)}return Ah(Iu(r.nodeType==3?_a(r):r,-n),n>=0)}function Ah(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 dE(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 n4(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 VTe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return n4(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let u=e.docView.nearestDesc(o,!0);if(!u)break;if(u.node.isBlock){o=u.contentDOM||u.dom;break}o=u.dom.parentNode}let a=t4(e,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let s;if(u.nodeType==1)s=u.getClientRects();else if(u.nodeType==3)s=_a(u,0,u.nodeValue.length).getClientRects();else continue;for(let c=0;c<s.length;c++){let l=s[c];if(l.bottom>l.top+1&&(n=="up"?a.top-l.top>(l.bottom-a.top)*2:l.bottom-a.bottom>(a.bottom-l.top)*2))return!1}}return!0})}const HTe=/[\u0590-\u08ac]/;function GTe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,u=e.domSelection();return!HTe.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:a:n4(e,t,()=>{let{focusNode:s,focusOffset:c,anchorNode:l,anchorOffset:f}=e.domSelectionRange(),d=u.caretBidiLevel;u.modify("move",n,"character");let p=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:v}=e.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||s==h&&c==v;try{u.collapse(l,f),s&&(s!=l||c!=f)&&u.extend&&u.extend(s,c)}catch{}return d!=null&&(u.caretBidiLevel=d),m})}let r4=null,i4=null,o4=!1;function YTe(e,t,n){return r4==t&&i4==n?o4:(r4=t,i4=n,o4=n=="up"||n=="down"?VTe(e,t,n):GTe(e,t,n))}const Pi=0,a4=1,If=2,vo=3;class Nh{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Pi,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.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(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let o,a;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>Cr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],u=o+a.size;if(u>t||a instanceof c4){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof u4&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Cr(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Cr(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(i==-1&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Cr(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let l=u+1;l<this.children.length;l++){let f=this.children[l];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Cr(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),a=Math.max(t,n);for(let d=0,p=0;d<this.children.length;d++){let h=this.children[d],v=p+h.size;if(o>p&&a<v)return h.setSelection(t-p-h.border,n-p-h.border,r,i);p=v}let u=this.domFromPos(t,t?-1:1),s=n==t?u:this.domFromPos(n,n?-1:1),c=r.getSelection(),l=!1;if((Ni||zn)&&t==n){let{node:d,offset:p}=u;if(d.nodeType==3){if(l=!!(p&&d.nodeValue[p-1]==`
33
- `),l&&p==d.nodeValue.length)for(let h=d,v;h;h=h.parentNode){if(v=h.nextSibling){v.nodeName=="BR"&&(u=s={node:v.parentNode,offset:Cr(v)+1});break}let m=h.pmViewDesc;if(m&&m.node&&m.node.isBlock)break}}else{let h=d.childNodes[p-1];l=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(Ni&&c.focusNode&&c.focusNode!=s.node&&c.focusNode.nodeType==1){let d=c.focusNode.childNodes[c.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||l&&zn)&&oc(u.node,u.offset,c.anchorNode,c.anchorOffset)&&oc(s.node,s.offset,c.focusNode,c.focusOffset))return;let f=!1;if((c.extend||t==n)&&!l){c.collapse(u.node,u.offset);try{t!=n&&c.extend(s.node,s.offset),f=!0}catch{}}if(!f){if(t>n){let p=u;u=s,s=p}let d=document.createRange();d.setEnd(s.node,s.offset),d.setStart(u.node,u.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?If:a4,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=vo:o.markDirty(t-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?If:vo}r=a}this.dirty=If}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?If:a4;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class u4 extends Nh{constructor(t,n,r,i){let o,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(a.nodeType!=1){let u=document.createElement("span");u.appendChild(a),a=u}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Pi&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class JTe extends Nh{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class uc extends Nh{constructor(t,n,r,i){super(t,[],r,i),this.mark=n}static create(t,n,r,i){let o=i.nodeViews[n.type.name],a=o&&o(n,i,r);return(!a||!a.dom)&&(a=po.renderSpec(document,n.type.spec.toDOM(n,r))),new uc(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&vo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return this.dirty!=vo&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Pi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Pi}}slice(t,n,r){let i=uc.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=mE(o,n,a,r)),t>0&&(o=mE(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class sc extends Nh{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u,a&&this.updateChildren(s,c)}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>{if(!s)return a;if(s.parent)return s.parent.posBeforeChild(s)},r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!l)l=document.createTextNode(n.text);else if(l.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else l||({dom:l,contentDOM:f}=po.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&l.nodeName!="BR"&&(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=d4(l,r,n),c?s=new ZTe(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new mb(t,n,r,i,l,d,o):new sc(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){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 n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>z.empty)}return t}matchesNode(t,n,r){return this.dirty==Pi&&t.eq(this.node)&&hE(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,a=o&&o.pos>-1?o:null,u=o&&o.pos<0,s=new QTe(this,a&&a.node,t);nIe(this.node,this.innerDeco,(c,l,f)=>{c.spec.marks?s.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!f&&s.syncToMarks(l==this.node.childCount?rt.none:this.node.child(l).marks,r,t),s.placeWidget(c,t,i)},(c,l,f,d)=>{s.syncToMarks(c.marks,r,t);let p;s.findNodeMatch(c,l,f,d)||u&&t.state.selection.from>i&&t.state.selection.to<i+c.nodeSize&&(p=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(c,l,f,p,t)||s.updateNextNode(c,l,f,t,d)||s.addNode(c,l,f,t,i),i+=c.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==If)&&(a&&this.protectLocalComposition(t,a),l4(this.contentDOM,this.children,t),$f&&rIe(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Be)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=iIe(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let u=a.nodeValue,s=oIe(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}else return{node:a,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new JTe(this,o,n,i);t.input.compositionNodes.push(a),this.children=mE(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==vo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Pi}updateOuterDeco(t){if(hE(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=f4(this.dom,this.nodeDOM,pE(this.outerDeco,this.node,n),pE(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function s4(e,t,n,r,i){return d4(r,t,e),new sc(void 0,e,t,n,r,r,r,i,0)}class mb extends sc{constructor(t,n,r,i,o,a,u){super(t,n,r,i,o,null,a,u,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==vo||this.dirty!=Pi&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Pi||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Pi,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new mb(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=vo)}get domAtom(){return!1}}class c4 extends Nh{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Pi&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class ZTe extends sc{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(this.dirty==vo)return!1;if(this.spec.update){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function l4(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let a=t[o],u=a.dom;if(u.parentNode==e){for(;u!=r;)r=p4(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(u,r);if(a instanceof uc){let s=r?r.previousSibling:e.lastChild;l4(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}for(;r;)r=p4(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Fh=function(e){e&&(this.nodeName=e)};Fh.prototype=Object.create(null);const cc=[new Fh];function pE(e,t,n){if(e.length==0)return cc;let r=n?cc[0]:new Fh,i=[r];for(let o=0;o<e.length;o++){let a=e[o].type.attrs;if(a){a.nodeName&&i.push(r=new Fh(a.nodeName));for(let u in a){let s=a[u];s!=null&&(n&&i.length==1&&i.push(r=new Fh(t.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+s:u=="style"?r.style=(r.style?r.style+";":"")+s:u!="nodeName"&&(r[u]=s))}}}return i}function f4(e,t,n,r){if(n==cc&&r==cc)return t;let i=t;for(let o=0;o<r.length;o++){let a=r[o],u=n[o];if(o){let s;u&&u.nodeName==a.nodeName&&i!=e&&(s=i.parentNode)&&s.nodeName.toLowerCase()==a.nodeName||(s=document.createElement(a.nodeName),s.pmIsDeco=!0,s.appendChild(i),u=cc[0]),i=s}XTe(i,u||cc[0],a)}return i}function XTe(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 o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function d4(e,t,n){return f4(e,e,cc,pE(t,n,e.nodeType!=1))}function hE(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 p4(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class QTe{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=eIe(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let i=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&t[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Pi,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){let c=this.top.children[s];if(c.matchesMark(t[o])&&!this.isLocked(c.dom)){u=s;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let s=uc.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return a.dirty==vo&&a.dom==a.contentDOM&&(a.dirty=If),a.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o){for(let a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof sc){let s=this.preMatch.matched.get(u);if(s!=null&&s!=o)return!1;let c=u.dom;if(!(this.isLocked(c)&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=vo&&hE(n,u.outerDeco)))&&u.update(t,n,r,i))return this.destroyBetween(this.index,a),u.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(t,n,r,i,o){this.top.children.splice(this.index++,0,sc.create(this.top,t,n,r,i,o)),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new u4(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof uc;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof mb)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((zn||Bn)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new c4(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function eIe(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,a=[];e:for(;i>0;){let u;for(;;)if(r){let c=n.children[r-1];if(c instanceof uc)n=c,r=c.children.length;else{u=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=u.node;if(s){if(s!=e.child(i-1))break;--i,o.set(u,i),a.push(u)}}return{index:i,matched:o,matches:a.reverse()}}function tIe(e,t){return e.type.side-t.type.side}function nIe(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let l=e.child(c);r(l,i,t.forChild(o,l),c),o+=l.nodeSize}return}let a=0,u=[],s=null;for(let c=0;;){if(a<i.length&&i[a].to==o){let h=i[a++],v;for(;a<i.length&&i[a].to==o;)(v||(v=[h])).push(i[a++]);if(v){v.sort(tIe);for(let m=0;m<v.length;m++)n(v[m],c,!!s)}else n(h,c,!!s)}let l,f;if(s)f=-1,l=s,s=null;else if(c<e.childCount)f=c,l=e.child(c++);else break;for(let h=0;h<u.length;h++)u[h].to<=o&&u.splice(h--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)u.push(i[a++]);let d=o+l.nodeSize;if(l.isText){let h=d;a<i.length&&i[a].from<h&&(h=i[a].from);for(let v=0;v<u.length;v++)u[v].to<h&&(h=u[v].to);h<d&&(s=l.cut(h-o),l=l.cut(0,h-o),d=h,f=-1)}let p=l.isInline&&!l.isLeaf?u.filter(h=>!h.inline):u.slice();r(l,p,t.forChild(o,l),f),o=d}}function rIe(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 iIe(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=mo(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function oIe(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let a=e.child(i++),u=o;if(o+=a.nodeSize,!a.isText)continue;let s=a.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;s+=c.text}if(o>=n){let c=u<r?s.lastIndexOf(t,r-u-1):-1;if(c>=0&&c+t.length+u>=n)return u+c;if(n==r&&s.length>=r+t.length-u&&s.slice(r-u,r-u+t.length)==t)return r}}return-1}function mE(e,t,n,r,i){let o=[];for(let a=0,u=0;a<e.length;a++){let s=e[a],c=u,l=u+=s.size;c>=n||l<=t?o.push(s):(c<t&&o.push(s.slice(0,t-c,r)),i&&(o.push(i),i=void 0),l>n&&o.push(s.slice(n-c,s.size,r)))}return o}function vE(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,c;if(pb(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&Se.isSelectable(l)&&i.parent&&!(l.isInline&&MTe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new Se(a==f?u:r.resolve(f))}}else{let l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;s=r.resolve(l)}if(!c){let l=t=="pointer"||e.state.selection.head<u.pos&&!o?1:-1;c=yE(e,s,u,l)}return c}function h4(e){return e.editable?e.hasFocus():S4(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Sa(e,t=!1){let n=e.state.selection;if(y4(e,n),!!h4(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Bn){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&oc(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)uIe(e);else{let{anchor:r,head:i}=n,o,a;m4&&!(n instanceof Be)&&(n.$from.parent.inlineContent||(o=v4(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=v4(e,n.to))),e.docView.setSelection(r,i,e.root,t),m4&&(o&&g4(o),a&&g4(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&aIe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const m4=zn||Bn&&ATe<63;function v4(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(zn&&i&&i.contentEditable=="false")return gE(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return gE(i);if(o)return gE(o)}}function gE(e){return e.contentEditable="true",zn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function g4(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function aIe(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(()=>{(!h4(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function uIe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Cr(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&sr&&$u<=11&&(r.disabled=!0,r.disabled=!1)}function y4(e,t){if(t instanceof Se){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(b4(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else b4(e)}function b4(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function yE(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Be.between(t,n,r)}function _4(e){return e.editable&&!e.hasFocus()?!1:S4(e)}function S4(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function sIe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return oc(t.node,t.offset,n.anchorNode,n.anchorOffset)}function bE(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&We.findFrom(o,t)}function lc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function $4(e,t,n){let r=e.state.selection;if(r instanceof Be){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let i=bE(e.state,t);return i&&i instanceof Se?lc(e,i):!1}else if(!(Yr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM?Se.isSelectable(o)?lc(e,new Se(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):hb?lc(e,new Be(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Se&&r.node.isInline)return lc(e,new Be(t>0?r.$to:r.$from));{let i=bE(e.state,t);return i?lc(e,i):!1}}}function vb(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ph(e){let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function _E(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(Ni&&n.nodeType==1&&r<vb(n)&&Ph(n.childNodes[r])&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Ph(u))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(T4(n))break;{let u=n.previousSibling;for(;u&&Ph(u);)i=n.parentNode,o=Cr(u),u=u.previousSibling;if(u)n=u,r=vb(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?$E(e,n,r):i&&$E(e,i,o)}function SE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=vb(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Ph(u))o=n,a=++r;else break}else{if(T4(n))break;{let u=n.nextSibling;for(;u&&Ph(u);)o=u.parentNode,a=Cr(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=vb(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&$E(e,o,a)}function T4(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function $E(e,t,n){let r=e.domSelection();if(pb(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Sa(e)},50)}function I4(e,t,n){let r=e.state.selection;if(r instanceof Be&&!r.empty||n.indexOf("s")>-1||Yr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=bE(e.state,t);if(a&&a instanceof Se)return lc(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof Ai?We.near(a,t):We.findFrom(a,t);return u?lc(e,u):!1}return!1}function O4(e,t){if(!(e.state.selection instanceof Be))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 o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function w4(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function cIe(e){if(!zn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;w4(e,r,"true"),setTimeout(()=>w4(e,r,"false"),20)}return!1}function lIe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function fIe(e,t){let n=t.keyCode,r=lIe(t);return n==8||Yr&&n==72&&r=="c"?O4(e,-1)||_E(e):n==46||Yr&&n==68&&r=="c"?O4(e,1)||SE(e):n==13||n==27?!0:n==37||Yr&&n==66&&r=="c"?$4(e,-1,r)||_E(e):n==39||Yr&&n==70&&r=="c"?$4(e,1,r)||SE(e):n==38||Yr&&n==80&&r=="c"?I4(e,-1,r)||_E(e):n==40||Yr&&n==78&&r=="c"?cIe(e)||I4(e,1,r)||SE(e):r==(Yr?"m":"c")&&(n==66||n==73||n==89||n==90)}function C4(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=e.someProp("clipboardSerializer")||po.fromSchema(e.state.schema),u=F4(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=A4[c.nodeName.toLowerCase()]);){for(let p=l.length-1;p>=0;p--){let h=u.createElement(l[p]);for(;s.firstChild;)h.appendChild(s.firstChild);s.appendChild(h),f++}c=s.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,`
34
-
35
- `);return{dom:s,text:d}}function E4(e,t,n,r,i){let o=i.parent.type.spec.code,a,u;if(!n&&!t)return null;let s=t&&(r||o||!n);if(s){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return t?new se(z.from(e.state.schema.text(t.replace(/\r\n?/g,`
36
- `))),0,0):se.empty;let f=e.someProp("clipboardTextParser",d=>d(t,i,r,e));if(f)u=f;else{let d=i.marks(),{schema:p}=e.state,h=po.fromSchema(p);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let m=a.appendChild(document.createElement("p"));v&&m.appendChild(h.serializeNode(p.text(v,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=hIe(n),hb&&mIe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let f=+l[3];f>0;f--){let d=a.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;a=d}if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||hf.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!dIe.test(d.parentNode.nodeName)?{ignore:!0}:null}})),l)u=vIe(k4(u,+l[1],+l[2]),l[4]);else if(u=se.maxOpen(pIe(u.content,i),!0),u.openStart||u.openEnd){let f=0,d=0;for(let p=u.content.firstChild;f<u.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=u.content.lastChild;d<u.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);u=k4(u,f,d)}return e.someProp("transformPasted",f=>{u=f(u,e)}),u}const dIe=/^(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 pIe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(u=>{if(!a)return;let s=i.findWrapping(u.type),c;if(!s)return a=null;if(c=a.length&&o.length&&M4(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=x4(a[a.length-1],o.length));let l=R4(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return z.from(a)}return e}function R4(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,z.from(e));return e}function M4(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=M4(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(z.from(R4(n,e,i+1))))}}function x4(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,x4(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(z.empty,!0);return e.copy(n.append(r))}function TE(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return i<r-1&&(u=TE(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,e.childCount>1||o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function k4(e,t,n){return t<e.openStart&&(e=new se(TE(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new se(TE(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const A4={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let N4=null;function F4(){return N4||(N4=document.implementation.createHTMLDocument("title"))}function hIe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=F4().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&A4[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function mIe(e){let t=e.querySelectorAll(Bn?"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==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function vIe(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:o,openEnd:a}=e;for(let u=r.length-2;u>=0;u-=2){let s=n.nodes[r[u]];if(!s||s.hasRequiredAttrs())break;i=z.from(s.create(r[u+1],i)),o++,a++}return new se(i,o,a)}const Kn={},Vn={},gIe={touchstart:!0,touchmove:!0};class yIe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function bIe(e){for(let t in Kn){let n=Kn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{SIe(e,r)&&!OE(e,r)&&(e.editable||!(r.type in Vn))&&n(e,r)},gIe[t]?{passive:!0}:void 0)}zn&&e.dom.addEventListener("input",()=>null),IE(e)}function Ou(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function _Ie(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function IE(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>OE(e,r))})}function OE(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function SIe(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 $Ie(e,t){!OE(e,t)&&Kn[t.type]&&(e.editable||!(t.type in Vn))&&Kn[t.type](e,t)}Vn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!W4(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Fi&&Bn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),$f&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,ac(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||fIe(e,n)?n.preventDefault():Ou(e,"key")},Vn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Vn.keypress=(e,t)=>{let n=t;if(W4(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Yr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Be)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function gb(e){return{left:e.clientX,top:e.clientY}}function TIe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function wE(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,u=>a>o.depth?u(e,n,o.nodeAfter,o.before(a),i,!0):u(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function Of(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function IIe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Se.isSelectable(r)?(Of(e,new Se(n),"pointer"),!0):!1}function OIe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Se&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(Se.isSelectable(u)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?(Of(e,Se.create(e.state.doc,i),"pointer"),!0):!1}function wIe(e,t,n,r,i){return wE(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?OIe(e,n):IIe(e,n))}function CIe(e,t,n,r){return wE(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function EIe(e,t,n,r){return wE(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||RIe(e,n,r)}function RIe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Of(e,Be.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)Of(e,Be.create(r,u+1,u+1+a.content.size),"pointer");else if(Se.isSelectable(a))Of(e,Se.create(r,u),"pointer");else continue;return!0}}function CE(e){return yb(e)}const P4=Yr?"metaKey":"ctrlKey";Kn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=CE(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&TIe(n,e.input.lastClick)&&!n[P4]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(gb(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new MIe(e,a,n,!!r)):(o=="doubleClick"?CIe:EIe)(e,a.pos,a.inside,n)?n.preventDefault():Ou(e,"pointer"))};class MIe{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[P4],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}const u=i?null:r.target,s=u?t.docView.nearestDesc(u,!0):null;this.target=s?s.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof Se&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ni&&!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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ou(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Sa(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(gb(t))),this.updateAllowDefault(t),this.allowDefault||!n?Ou(this.view,"pointer"):wIe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||zn&&this.mightDrag&&!this.mightDrag.node.isAtom||Bn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Of(this.view,We.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):Ou(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ou(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Kn.touchstart=e=>{e.input.lastTouch=Date.now(),CE(e),Ou(e,"pointer")},Kn.touchmove=e=>{e.input.lastTouch=Date.now(),Ou(e,"pointer")},Kn.contextmenu=e=>CE(e);function W4(e,t){return e.composing?!0:zn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const xIe=Fi?5e3:-1;Vn.compositionstart=Vn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),yb(e,!0),e.markCursor=null;else if(yb(e),Ni&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){e.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}j4(e,xIe)},Vn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,j4(e,20))};function j4(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>yb(e),t))}function L4(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=kIe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function kIe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function yb(e,t=!1){if(!(Fi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),L4(e),t||e.docView&&e.docView.dirty){let n=vE(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function AIe(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)}const wf=sr&&$u<15||$f&&NTe<604;Kn.copy=Vn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=wf?null:n.clipboardData,a=r.content(),{dom:u,text:s}=C4(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):AIe(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function NIe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function FIe(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(),setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Wh(e,r.value,null,e.input.shiftKey,t):Wh(e,r.textContent,r.innerHTML,e.input.shiftKey,t)},50)}function Wh(e,t,n,r,i){let o=E4(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",s=>s(e,i,o||se.empty)))return!0;if(!o)return!1;let a=NIe(o),u=a?e.state.tr.replaceSelectionWith(a,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Vn.paste=(e,t)=>{let n=t;if(e.composing&&!Fi)return;let r=wf?null:n.clipboardData;r&&Wh(e,r.getData("text/plain"),r.getData("text/html"),e.input.shiftKey,n)?n.preventDefault():FIe(e,n)};class PIe{constructor(t,n){this.slice=t,this.move=n}}const D4=Yr?"altKey":"ctrlKey";Kn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(gb(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Se?i.to-1:i.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(Se.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=e.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(Se.create(e.state.doc,c.posBefore)))}}let a=e.state.selection.content(),{dom:u,text:s}=C4(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(wf?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",wf||n.dataTransfer.setData("text/plain",s),e.dragging=new PIe(a,!n[D4])},Kn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Vn.dragover=Vn.dragenter=(e,t)=>t.preventDefault(),Vn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(gb(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a,e)}):a=E4(e,n.dataTransfer.getData(wf?"Text":"text/plain"),wf?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[D4]);if(e.someProp("handleDrop",h=>h(e,n,a||se.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?gTe(e.state.doc,o.pos,a):o.pos;s==null&&(s=o.pos);let c=e.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&Se.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Se(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,m,_,g)=>h=g),c.setSelection(yE(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Kn.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())&&Sa(e)},20))},Kn.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(),e.focused=!1)},Kn.beforeinput=(e,t)=>{if(Bn&&Fi&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,ac(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Vn)Kn[e]=Vn[e];function jh(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}class EE{constructor(t,n){this.toDOM=t,this.spec=n||fc,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Er(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof EE&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&jh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class wu{constructor(t,n){this.attrs=t,this.spec=n||fc}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Er(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof wu&&jh(this.attrs,t.attrs)&&jh(this.spec,t.spec)}static is(t){return t.type instanceof wu}destroy(){}}let WIe=class L6{constructor(t,n){this.attrs=t,this.spec=n||fc}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Er(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof L6&&jh(this.attrs,t.attrs)&&jh(this.spec,t.spec)}destroy(){}};class Er{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Er(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Er(t,t,new EE(n,r))}static inline(t,n,r,i){return new Er(t,n,new wu(r,i))}static node(t,n,r,i){return new Er(t,n,new WIe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof wu}}const Cf=[],fc={};class Dt{constructor(t,n){this.local=t.length?t:Cf,this.children=n.length?n:Cf}static create(t,n){return n.length?bb(n,t,0,fc):Rn}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let u=this.children[a]+1;this.children[a+2].findInner(t-u,n-u,r,i+u,o)}}map(t,n,r){return this==Rn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||fc)}mapInner(t,n,r,i,o){let a;for(let u=0;u<this.local.length;u++){let s=this.local[u].map(t,r,i);s&&s.type.valid(n,s)?(a||(a=[])).push(s):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?jIe(this.children,a||[],t,n,r,i,o):a?new Dt(a.sort(dc),Cf):Rn}add(t,n){return n.length?this==Rn?Dt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((u,s)=>{let c=s+r,l;if(l=U4(n,u,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<s;)o+=3;i[o]==s?i[o+2]=i[o+2].addInner(u,l,c+1):i.splice(o,0,s,s+u.nodeSize,bb(l,u,c+1,fc)),o+=3}});let a=q4(o?B4(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Dt(a.length?this.local.concat(a).sort(dc):this.local,i||this.children)}remove(t){return t.length==0||this==Rn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+n,s=r[o+1]+n;for(let l=0,f;l<t.length;l++)(f=t[l])&&f.from>u&&f.to<s&&(t[l]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,u+1);c!=Rn?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let u=0;u<i.length;u++)i[u].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Dt(i,r):Rn}forChild(t,n){if(this==Rn)return this;if(n.isLeaf)return Dt.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=t){this.children[u]==t&&(r=this.children[u+2]);break}let o=t+1,a=o+n.content.size;for(let u=0;u<this.local.length;u++){let s=this.local[u];if(s.from<a&&s.to>o&&s.type instanceof wu){let c=Math.max(o,s.from)-o,l=Math.min(a,s.to)-o;c<l&&(i||(i=[])).push(s.copy(c,l))}}if(i){let u=new Dt(i.sort(dc),Cf);return r?new Cu([u,r]):u}return r||Rn}eq(t){if(this==t)return!0;if(!(t instanceof Dt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return RE(this.localsInner(t))}localsInner(t){if(this==Rn)return Cf;if(t.inlineContent||!this.local.some(wu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof wu||n.push(this.local[r]);return n}}Dt.empty=new Dt([],[]),Dt.removeOverlap=RE;const Rn=Dt.empty;class Cu{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,fc));return Cu.from(r)}forChild(t,n){if(n.isLeaf)return Dt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Rn&&(o instanceof Cu?r=r.concat(o.members):r.push(o))}return Cu.from(r)}eq(t){if(!(t instanceof Cu)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?RE(r?n:n.sort(dc)):Cf}static from(t){switch(t.length){case 0:return Rn;case 1:return t[0];default:return new Cu(t.every(n=>n instanceof Dt)?t:t.reduce((n,r)=>n.concat(r instanceof Dt?r:r.members),[]))}}}function jIe(e,t,n,r,i,o,a){let u=e.slice();for(let c=0,l=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((d,p,h,v)=>{let m=v-h-(p-d);for(let _=0;_<u.length;_+=3){let g=u[_+1];if(g<0||d>g+l-f)continue;let S=u[_]+l-f;p>=S?u[_+1]=d<=S?-2:-1:h>=i&&m&&(u[_]+=m,u[_+1]+=m)}f+=m}),l=n.maps[c].map(l,-1)}let s=!1;for(let c=0;c<u.length;c+=3)if(u[c+1]<0){if(u[c+1]==-2){s=!0,u[c+1]=-1;continue}let l=n.map(e[c]+o),f=l-i;if(f<0||f>=r.content.size){s=!0;continue}let d=n.map(e[c+1]+o,-1),p=d-i,{index:h,offset:v}=r.content.findIndex(f),m=r.maybeChild(h);if(m&&v==f&&v+m.nodeSize==p){let _=u[c+2].mapInner(n,m,l+1,e[c]+o+1,a);_!=Rn?(u[c]=f,u[c+1]=p,u[c+2]=_):(u[c+1]=-2,s=!0)}else s=!0}if(s){let c=LIe(u,e,t,n,i,o,a),l=bb(c,r,0,a);t=l.local;for(let f=0;f<u.length;f+=3)u[f+1]<0&&(u.splice(f,3),f-=3);for(let f=0,d=0;f<l.children.length;f+=3){let p=l.children[f];for(;d<u.length&&u[d]<p;)d+=3;u.splice(d,0,l.children[f],l.children[f+1],l.children[f+2])}}return new Dt(t.sort(dc),u)}function q4(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 Er(i.from+t,i.to+t,i.type))}return n}function LIe(e,t,n,r,i,o,a){function u(s,c){for(let l=0;l<s.local.length;l++){let f=s.local[l].map(r,i,c);f?n.push(f):a.onRemove&&a.onRemove(s.local[l].spec)}for(let l=0;l<s.children.length;l+=3)u(s.children[l+2],s.children[l]+c+1)}for(let s=0;s<e.length;s+=3)e[s+1]==-1&&u(e[s+2],t[s]+o+1);return n}function U4(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function B4(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function bb(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=U4(e,u,s+n);if(c){o=!0;let l=bb(c,u,n+s+1,r);l!=Rn&&i.push(s,s+u.nodeSize,l)}});let a=q4(o?B4(e):e,-n).sort(dc);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new Dt(a,i):Rn}function dc(e,t){return e.from-t.from||e.to-t.to}function RE(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 o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),z4(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),z4(t,i,r.copy(o.from,r.to)));break}}}return t}function z4(e,t,n){for(;t<e.length&&dc(n,e[t])>0;)t++;e.splice(t,0,n)}function ME(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Rn&&t.push(r)}),e.cursorWrapper&&t.push(Dt.create(e.state.doc,[e.cursorWrapper.deco])),Cu.from(t)}const DIe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},qIe=sr&&$u<=11;class UIe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class BIe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new UIe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);sr&&$u<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),qIe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,DIe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);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(_4(this.view)){if(this.suppressingSelectionUpdates)return Sa(this.view);if(sr&&$u<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&oc(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=kh(o))n.add(o);for(let o=t.anchorNode;o;o=kh(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&_4(t)&&!this.ignoreSelectionChange(r),o=-1,a=-1,u=!1,s=[];if(t.editable)for(let l=0;l<n.length;l++){let f=this.registerMutation(n[l],s);f&&(o=o<0?f.from:Math.min(f.from,o),a=a<0?f.to:Math.max(f.to,a),f.typeOver&&(u=!0))}if(Ni&&s.length>1){let l=s.filter(f=>f.nodeName=="BR");if(l.length==2){let f=l[0],d=l[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&pb(r)&&(c=vE(t))&&c.eq(We.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Sa(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,a),zIe(t)),this.handleDOMChange(o,a,u,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Sa(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let l=0;l<t.addedNodes.length;l++)n.push(t.addedNodes[l]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(sr&&$u<=11&&t.addedNodes.length)for(let l=0;l<t.addedNodes.length;l++){let{previousSibling:f,nextSibling:d}=t.addedNodes[l];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d)}let a=i&&i.parentNode==t.target?Cr(i)+1:0,u=r.localPosFromDOM(t.target,a,-1),s=o&&o.parentNode==t.target?Cr(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,s,1);return{from:u,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let K4=new WeakMap,V4=!1;function zIe(e){if(!K4.has(e)&&(K4.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ni,V4)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."),V4=!0}}function KIe(e){let t;function n(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,u=e.domAtPos(e.state.selection.anchor);return oc(u.node,u.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function VIe(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:a,to:u}=e.docView.parseRange(t,n),s=e.domSelectionRange(),c,l=s.anchorNode;if(l&&e.dom.contains(l.nodeType==1?l:l.parentNode)&&(c=[{node:l,offset:s.anchorOffset}],pb(s)||c.push({node:s.focusNode,offset:s.focusOffset})),Bn&&e.input.lastKeyCode===8)for(let m=o;m>i;m--){let _=r.childNodes[m-1],g=_.pmViewDesc;if(_.nodeName=="BR"&&!g){o=m;break}if(!g||g.size)break}let f=e.state.doc,d=e.someProp("domParser")||hf.fromSchema(e.state.schema),p=f.resolve(a),h=null,v=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:HIe,context:p});if(c&&c[0].pos!=null){let m=c[0].pos,_=c[1]&&c[1].pos;_==null&&(_=m),h={anchor:m+a,head:_+a}}return{doc:v,sel:h,from:a,to:u}}function HIe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(zn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||zn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function GIe(e,t,n,r,i){if(t<0){let R=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,q=vE(e,R);if(q&&!e.state.selection.eq(q)){if(Bn&&Fi&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",N=>N(e,ac(13,"Enter"))))return;let Y=e.state.tr.setSelection(q);R=="pointer"?Y.setMeta("pointer",!0):R=="key"&&Y.scrollIntoView(),e.dispatch(Y)}return}let o=e.state.doc.resolve(t),a=o.sharedDepth(n);t=o.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u=e.state.selection,s=VIe(e,t,n),c=e.state.doc,l=c.slice(s.from,s.to),f,d;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,d="end"):(f=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let p=ZIe(l.content,s.doc.content,s.from,f,d);if(($f&&e.input.lastIOSEnter>Date.now()-225||Fi)&&i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"||R.nodeName=="LI")&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",R=>R(e,ac(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&u instanceof Be&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(s.sel&&s.sel.anchor!=s.sel.head))p={start:u.from,endA:u.to,endB:u.to};else{if(s.sel){let R=H4(e,e.state.doc,s.sel);R&&!R.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(R))}return}if(Bn&&e.cursorWrapper&&s.sel&&s.sel.anchor==e.cursorWrapper.deco.from&&s.sel.head==s.sel.anchor){let R=p.endB-p.start;s.sel={anchor:s.sel.anchor+R,head:s.sel.anchor+R}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof Be&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=s.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=s.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),sr&&$u<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>s.from&&s.doc.textBetween(p.start-s.from-1,p.start-s.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let h=s.doc.resolveNoCache(p.start-s.from),v=s.doc.resolveNoCache(p.endB-s.from),m=c.resolve(p.start),_=h.sameParent(v)&&h.parent.inlineContent&&m.end()>=p.endA,g;if(($f&&e.input.lastIOSEnter>Date.now()-225&&(!_||i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!_&&h.pos<s.doc.content.size&&(g=We.findFrom(s.doc.resolve(h.pos+1),1,!0))&&g.head==v.pos)&&e.someProp("handleKeyDown",R=>R(e,ac(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&JIe(c,p.start,p.endA,h,v)&&e.someProp("handleKeyDown",R=>R(e,ac(8,"Backspace")))){Fi&&Bn&&e.domObserver.suppressSelectionUpdates();return}Bn&&Fi&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),Fi&&!_&&h.start()!=v.start()&&v.parentOffset==0&&h.depth==v.depth&&s.sel&&s.sel.anchor==s.sel.head&&s.sel.head==p.endA&&(p.endB-=2,v=s.doc.resolveNoCache(p.endB-s.from),setTimeout(()=>{e.someProp("handleKeyDown",function(R){return R(e,ac(13,"Enter"))})},20));let S=p.start,b=p.endA,$,T,M;if(_){if(h.pos==v.pos)sr&&$u<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Sa(e),20)),$=e.state.tr.delete(S,b),T=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(M=YIe(h.parent.content.cut(h.parentOffset,v.parentOffset),m.parent.content.cut(m.parentOffset,p.endA-m.start()))))$=e.state.tr,M.type=="add"?$.addMark(S,b,M.mark):$.removeMark(S,b,M.mark);else if(h.parent.child(h.index()).isText&&h.index()==v.index()-(v.textOffset?0:1)){let R=h.parent.textBetween(h.parentOffset,v.parentOffset);if(e.someProp("handleTextInput",q=>q(e,S,b,R)))return;$=e.state.tr.insertText(R,S,b)}}if($||($=e.state.tr.replace(S,b,s.doc.slice(p.start-s.from,p.endB-s.from))),s.sel){let R=H4(e,$.doc,s.sel);R&&!(Bn&&Fi&&e.composing&&R.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(R.head==S||R.head==$.mapping.map(b)-1)||sr&&R.empty&&R.head==S)&&$.setSelection(R)}T&&$.ensureMarks(T),e.dispatch($.scrollIntoView())}function H4(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:yE(e,t.resolve(n.anchor),t.resolve(n.head))}function YIe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,a,u,s;for(let l=0;l<r.length;l++)i=r[l].removeFromSet(i);for(let l=0;l<n.length;l++)o=n[l].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],a="add",s=l=>l.mark(u.addToSet(l.marks));else if(i.length==0&&o.length==1)u=o[0],a="remove",s=l=>l.mark(u.removeFromSet(l.marks));else return null;let c=[];for(let l=0;l<t.childCount;l++)c.push(s(t.child(l)));if(z.from(c).eq(e))return{mark:u,type:a}}function JIe(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||xE(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=e.resolve(xE(o,!0,!0));return!a.parent.isTextblock||a.pos>n||xE(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function xE(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 o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function ZIe(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a,b:u}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let s=Math.max(0,o-Math.min(a,u));r-=a+s-o}if(a<o&&e.size<t.size){let s=r<=o&&r>=a?o-r:0;o-=s,u=o+(u-a),a=o}else if(u<o){let s=r<=o&&r>=u?o-r:0;o-=s,a=o+(a-u),u=o}return{start:o,endA:a,endB:u}}class XIe{constructor(t,n){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 yIe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(X4),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=J4(this),Y4(this),this.nodeViews=Z4(this),this.docView=s4(this.state.doc,G4(this),ME(this),this.dom,this),this.domObserver=new BIe(this,(r,i,o,a)=>GIe(this,r,i,o,a)),this.domObserver.start(),bIe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&IE(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(X4),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){let r=this.state,i=!1,o=!1;t.storedMarks&&this.composing&&(L4(this),o=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let d=Z4(this);e1e(d,this.nodeViews)&&(this.nodeViews=d,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&IE(this),this.editable=J4(this),Y4(this);let u=ME(this),s=G4(this),c=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=i||!this.docView.matchesNode(t.doc,s,u);(l||!t.selection.eq(r.selection))&&(o=!0);let f=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&WTe(this);if(o){this.domObserver.stop();let d=l&&(sr||Bn)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&QIe(r.selection,t.selection);if(l){let p=Bn?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,s,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=s4(t.doc,s,u,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&sIe(this))?Sa(this,d):(y4(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&jTe(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Se){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&J3(this,n.getBoundingClientRect(),t)}else J3(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let u=this.directPlugins[a].props[t];if(u!=null&&(i=n?n(u):u))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let u=o[a].props[t];if(u!=null&&(i=n?n(u):u))return i}}hasFocus(){if(sr){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&LTe(this.dom),Sa(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return zTe(this,t)}coordsAtPos(t,n=1){return t4(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return YTe(this,n||this.state,t)}pasteHTML(t,n){return Wh(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Wh(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(_Ie(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ME(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return $Ie(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return zn&&this.root.nodeType===11&&kTe(this.dom.ownerDocument)==this.dom?KIe(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function G4(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"&&(t.class+=" "+n[r]),r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),[Er.node(0,e.state.doc.content.size,t)]}function Y4(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:Er.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function J4(e){return!e.someProp("editable",t=>t(e.state)===!1)}function QIe(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 Z4(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function e1e(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function X4(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Eu={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:"'"},_b={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Q4=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),t1e=typeof navigator<"u"&&/Mac/.test(navigator.platform),n1e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),r1e=t1e||Q4&&+Q4[1]<57,yn=0;yn<10;yn++)Eu[48+yn]=Eu[96+yn]=String(yn);for(var yn=1;yn<=24;yn++)Eu[yn+111]="F"+yn;for(var yn=65;yn<=90;yn++)Eu[yn]=String.fromCharCode(yn+32),_b[yn]=String.fromCharCode(yn);for(var kE in Eu)_b.hasOwnProperty(kE)||(_b[kE]=Eu[kE]);function i1e(e){var t=r1e&&(e.ctrlKey||e.altKey||e.metaKey)||n1e&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?_b:Eu)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const o1e=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function a1e(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u++){let s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))o1e?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function u1e(e){let t=Object.create(null);for(let n in e)t[a1e(n)]=e[n];return t}function AE(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 s1e(e){return new Gr({props:{handleKeyDown:c1e(e)}})}function c1e(e){let t=u1e(e);return function(n,r){let i=i1e(r),o,a=t[AE(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=t[AE(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Eu[r.keyCode])&&o!=i){let u=t[AE(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const l1e=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function f1e(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const d1e=(e,t,n)=>{let r=f1e(e,n);if(!r)return!1;let i=e5(r);if(!i){let a=r.blockRange(),u=a&&vf(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&r5(e,i,t))return!0;if(r.parent.content.size==0&&(Ef(o,"end")||Se.isSelectable(o))){let a=tE(e.doc,r.before(),r.after(),se.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Ef(o,"end")?We.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Se.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Ef(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}const p1e=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=e5(r)}let a=o&&o.nodeBefore;return!a||!Se.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Se.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function e5(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 h1e(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const m1e=(e,t,n)=>{let r=h1e(e,n);if(!r)return!1;let i=t5(r);if(!i)return!1;let o=i.nodeAfter;if(r5(e,i,t))return!0;if(r.parent.content.size==0&&(Ef(o,"start")||Se.isSelectable(o))){let a=tE(e.doc,r.before(),r.after(),se.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Ef(o,"start")?We.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Se.create(u.doc,u.mapping.map(i.pos))),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},v1e=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=t5(r)}let a=o&&o.nodeAfter;return!a||!Se.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Se.create(e.doc,o.pos)).scrollIntoView()),!0)};function t5(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}const g1e=(e,t)=>{let n=e.selection,r=n instanceof Se,i;if(r){if(n.node.isTextblock||!yu(e.doc,n.from))return!1;i=n.from}else if(i=A3(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(Se.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},y1e=(e,t)=>{let n=e.selection,r;if(n instanceof Se){if(n.node.isTextblock||!yu(e.doc,n.to))return!1;r=n.to}else if(r=A3(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},b1e=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&vf(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},_1e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
37
- `).scrollIntoView()),!0)};function n5(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const S1e=(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),o=n.indexAfter(-1),a=n5(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let u=n.after(),s=e.tr.replaceWith(u,u,a.createAndFill());s.setSelection(We.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},$1e=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ai||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=n5(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=e.tr.insert(a,o.createAndFill());u.setSelection(Be.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},T1e=(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 o=n.before();if(gf(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&vf(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},I1e=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(Se.create(e.doc,i))),!0)};function O1e(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||yu(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function r5(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(O1e(e,t,n))return!0;let u=t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let f=t.pos+i.nodeSize,d=z.empty;for(let v=o.length-1;v>=0;v--)d=z.from(o[v].create(null,d));d=z.from(r.copy(d));let p=e.tr.step(new tn(t.pos-1,f,t.pos,f,new se(d,1,0),o.length,!0)),h=f+2*o.length;yu(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let s=We.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&vf(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&Ef(i,"start",!0)&&Ef(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=z.empty;for(let _=d.length-1;_>=0;_--)v=z.from(d[_].copy(v));let m=e.tr.step(new tn(t.pos-d.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new se(v,d.length,0),0,!0));n(m.scrollIntoView())}return!0}}return!1}function i5(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Be.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const w1e=i5(-1),C1e=i5(1);function E1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&eE(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function o5(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[o];n.doc.nodesBetween(a,u,(s,c)=>{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(e,t)))if(s.type==e)i=!0;else{let l=n.doc.resolve(c),f=l.index();i=l.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[a];o.setBlockType(u,s,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function R1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=!1,s=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let l=n.doc.resolve(a.start-2);s=new ib(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new ib(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=eE(s,e,t,a);return c?(r&&r(M1e(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function M1e(e,t,n,r,i){let o=z.empty;for(let l=n.length-1;l>=0;l--)o=z.from(n[l].type.create(n[l].attrs,o));e.step(new tn(t.start-(r?2:0),t.end,t.start,t.end,new se(o,0,0),n.length,!0));let a=0;for(let l=0;l<n.length;l++)n[l].type==i&&(a=l+1);let u=n.length-a,s=t.start+n.length-(r?2:0),c=t.parent;for(let l=t.startIndex,f=t.endIndex,d=!0;l<f;l++,d=!1)!d&&gf(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function x1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?k1e(t,n,e,o):A1e(t,n,o):!0:!1}}function k1e(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new tn(o-1,a,o,a,new se(z.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ib(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=vf(r);if(u==null)return!1;i.lift(r,u);let s=i.mapping.map(o,-1)-1;return yu(i.doc,s)&&i.join(s),t(i.scrollIntoView()),!0}function A1e(e,t,n){let r=e.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,v=n.startIndex;h>v;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,s=n.endIndex==i.childCount,c=o.node(-1),l=o.index(-1);if(!c.canReplace(l+(u?0:1),l+1,a.content.append(s?z.empty:z.from(i))))return!1;let f=o.pos,d=f+a.nodeSize;return r.step(new tn(f-(u?1:0),d+(s?1:0),f+1,d-1,new se((u?z.empty:z.from(i.copy(z.empty))).append(s?z.empty:z.from(i.copy(z.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function N1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,s=u.child(a-1);if(s.type!=e)return!1;if(n){let c=s.lastChild&&s.lastChild.type==u.type,l=z.from(c?e.create():null),f=new se(z.from(e.create(null,z.from(u.type.create(null,l)))),c?3:1,0),d=o.start,p=o.end;n(t.tr.step(new tn(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function Sb(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class $b{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([u,s])=>[u,(...l)=>{const f=s(...l)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(!s&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),u.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,p])=>[d,(...v)=>{const m=this.buildProps(c,n),_=p(...v)(m);return u.push(_),f}])),run:l};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([s,c])=>[s,(...l)=>c(...l)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);const u={tr:t,editor:i,view:a,state:Sb({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([s,c])=>[s,(...l)=>c(...l)(u)]))}};return u}}class F1e{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function fe(e,t,n){return e.config[t]===void 0&&e.parent?fe(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?fe(e.parent,t,n):null}):e.config[t]}function Tb(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function a5(e){const t=[],{nodeExtensions:n,markExtensions:r}=Tb(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=fe(a,"addGlobalAttributes",u);if(!s)return;s().forEach(l=>{l.types.forEach(f=>{Object.entries(l.attributes).forEach(([d,p])=>{t.push({type:f,name:d,attribute:{...o,...p}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=fe(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const d={...o,...f};f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete d.default,t.push({type:a.name,name:l,attribute:d})})}),t}function nn(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function bn(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}i==="class"?r[i]=[r[i],o].join(" "):i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function NE(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>bn(n,r),{})}function u5(e){return typeof e=="function"}function Fe(e,t=void 0,...n){return u5(e)?t?e.bind(t)(...n):e(...n):e}function P1e(e={}){return Object.keys(e).length===0&&e.constructor===Object}function W1e(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function s5(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(n):W1e(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function c5(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&P1e(n)?!1:n!=null))}function l5(e){var t;const n=a5(e),{nodeExtensions:r,markExtensions:i}=Tb(e),o=(t=r.find(s=>fe(s,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(r.map(s=>{const c=n.filter(m=>m.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((m,_)=>{const g=fe(_,"extendNodeSchema",l);return{...m,...g?g(s):{}}},{}),d=c5({...f,content:Fe(fe(s,"content",l)),marks:Fe(fe(s,"marks",l)),group:Fe(fe(s,"group",l)),inline:Fe(fe(s,"inline",l)),atom:Fe(fe(s,"atom",l)),selectable:Fe(fe(s,"selectable",l)),draggable:Fe(fe(s,"draggable",l)),code:Fe(fe(s,"code",l)),defining:Fe(fe(s,"defining",l)),isolating:Fe(fe(s,"isolating",l)),attrs:Object.fromEntries(c.map(m=>{var _;return[m.name,{default:(_=m==null?void 0:m.attribute)===null||_===void 0?void 0:_.default}]}))}),p=Fe(fe(s,"parseHTML",l));p&&(d.parseDOM=p.map(m=>s5(m,c)));const h=fe(s,"renderHTML",l);h&&(d.toDOM=m=>h({node:m,HTMLAttributes:NE(m,c)}));const v=fe(s,"renderText",l);return v&&(d.toText=v),[s.name,d]})),u=Object.fromEntries(i.map(s=>{const c=n.filter(v=>v.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((v,m)=>{const _=fe(m,"extendMarkSchema",l);return{...v,..._?_(s):{}}},{}),d=c5({...f,inclusive:Fe(fe(s,"inclusive",l)),excludes:Fe(fe(s,"excludes",l)),group:Fe(fe(s,"group",l)),spanning:Fe(fe(s,"spanning",l)),code:Fe(fe(s,"code",l)),attrs:Object.fromEntries(c.map(v=>{var m;return[v.name,{default:(m=v==null?void 0:v.attribute)===null||m===void 0?void 0:m.default}]}))}),p=Fe(fe(s,"parseHTML",l));p&&(d.parseDOM=p.map(v=>s5(v,c)));const h=fe(s,"renderHTML",l);return h&&(d.toDOM=v=>h({mark:v,HTMLAttributes:NE(v,c)})),[s.name,d]}));return new G0e({topNode:o,nodes:a,marks:u})}function FE(e,t){return t.nodes[e]||t.marks[e]||null}function f5(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const j1e=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,u)=>{var s,c;const l=((c=(s=i.type.spec).toText)===null||c===void 0?void 0:c.call(s,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-o))}),n};function PE(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class WE{constructor(t){this.find=t.find,this.handler=t.handler}}const L1e=(e,t)=>{if(PE(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 jE(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:u}=e,{view:s}=n;if(s.composing)return!1;const c=s.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(d=>d.type.spec.code))return!1;let l=!1;const f=j1e(c)+o;return a.forEach(d=>{if(l)return;const p=L1e(f,d.find);if(!p)return;const h=s.state.tr,v=Sb({state:s.state,transaction:h}),m={from:r-(p[0].length-o.length),to:i},{commands:_,chain:g,can:S}=new $b({editor:n,state:v});d.handler({state:v,range:m,match:p,commands:_,chain:g,can:S})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function D1e(e){const{editor:t,rules:n}=e,r=new Gr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return jE({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&jE({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?jE({editor:t,from:a.pos,to:a.pos,text:`
38
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function q1e(e){return typeof e=="number"}class U1e{constructor(t){this.find=t.find,this.handler=t.handler}}const B1e=(e,t)=>{if(PE(t))return[...e.matchAll(t)];const n=t(e);return n?n.map(r=>{const i=[r.text];return i.index=r.index,i.input=e,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function z1e(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:a,chain:u,can:s}=new $b({editor:t,state:n}),c=[];return n.doc.nodesBetween(r,i,(f,d)=>{if(!f.isTextblock||f.type.spec.code)return;const p=Math.max(r,d),h=Math.min(i,d+f.content.size),v=f.textBetween(p-d,h-d,void 0,"");B1e(v,o.find).forEach(_=>{if(_.index===void 0)return;const g=p+_.index+1,S=g+_[0].length,b={from:n.tr.mapping.map(g),to:n.tr.mapping.map(S)},$=o.handler({state:n,range:b,match:_,commands:a,chain:u,can:s});c.push($)})}),c.every(f=>f!==null)}function K1e(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map(u=>new Gr({view(s){const c=l=>{var f;r=!((f=s.dom.parentElement)===null||f===void 0)&&f.contains(l.target)?s.dom.parentElement:null};return window.addEventListener("dragstart",c),{destroy(){window.removeEventListener("dragstart",c)}}},props:{handleDOMEvents:{drop:s=>(o=r===s.dom.parentElement,!1),paste:(s,c)=>{var l;const f=(l=c.clipboardData)===null||l===void 0?void 0:l.getData("text/html");return i=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(s,c,l)=>{const f=s[0],d=f.getMeta("uiEvent")==="paste"&&!i,p=f.getMeta("uiEvent")==="drop"&&!o;if(!d&&!p)return;const h=c.doc.content.findDiffStart(l.doc.content),v=c.doc.content.findDiffEnd(l.doc.content);if(!q1e(h)||!v||h===v.b)return;const m=l.tr,_=Sb({state:l,transaction:m});if(!(!z1e({editor:t,state:_,from:Math.max(h-1,0),to:v.b-1,rule:u})||!m.steps.length))return m}}))}function V1e(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class pc{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=pc.resolve(t),this.schema=l5(this.extensions),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:FE(r.name,this.schema)};r.type==="mark"&&(!((i=Fe(fe(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=fe(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=fe(r,"onCreate",o);u&&this.editor.on("create",u);const s=fe(r,"onUpdate",o);s&&this.editor.on("update",s);const c=fe(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const l=fe(r,"onTransaction",o);l&&this.editor.on("transaction",l);const f=fe(r,"onFocus",o);f&&this.editor.on("focus",f);const d=fe(r,"onBlur",o);d&&this.editor.on("blur",d);const p=fe(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(t){const n=pc.sort(pc.flatten(t)),r=V1e(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=fe(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=fe(r,"priority")||100,a=fe(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:FE(n.name,this.schema)},i=fe(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=pc.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:t,type:FE(a.name,this.schema)},s=[],c=fe(a,"addKeyboardShortcuts",u);let l={};if(a.type==="mark"&&a.config.exitable&&(l.ArrowRight=()=>HE.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([m,_])=>[m,()=>_({editor:t})]));l={...l,...v}}const f=s1e(l);s.push(f);const d=fe(a,"addInputRules",u);f5(a,t.options.enableInputRules)&&d&&r.push(...d());const p=fe(a,"addPasteRules",u);f5(a,t.options.enablePasteRules)&&p&&i.push(...p());const h=fe(a,"addProseMirrorPlugins",u);if(h){const v=h();s.push(...v)}return s}).flat();return[D1e({editor:t,rules:r}),...K1e({editor:t,rules:i}),...o]}get attributes(){return a5(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=Tb(this.extensions);return Object.fromEntries(n.filter(r=>!!fe(r,"addNodeView")).map(r=>{const i=this.attributes.filter(s=>s.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:nn(r.name,this.schema)},a=fe(r,"addNodeView",o);if(!a)return[];const u=(s,c,l,f)=>{const d=NE(s,i);return a()({editor:t,node:s,getPos:l,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,u]}))}}function H1e(e){return Object.prototype.toString.call(e).slice(8,-1)}function LE(e){return H1e(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Ib(e,t){const n={...e};return LE(e)&&LE(t)&&Object.keys(t).forEach(r=>{LE(t[r])?r in e?n[r]=Ib(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class Rr{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Fe(fe(this,"addOptions",{name:this.name}))),this.storage=Fe(fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Rr(t)}configure(t={}){const n=this.extend();return n.options=Ib(this.options,t),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Rr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Fe(fe(n,"addOptions",{name:n.name})),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}}function d5(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
39
-
40
- `,textSerializers:a={}}=n||{};let u="",s=!0;return e.nodesBetween(r,i,(c,l,f,d)=>{var p;const h=a==null?void 0:a[c.type.name];h?(c.isBlock&&!s&&(u+=o,s=!0),f&&(u+=h({node:c,pos:l,parent:f,index:d,range:t}))):c.isText?(u+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,i-l),s=!1):c.isBlock&&!s&&(u+=o,s=!0)}),u}function p5(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const G1e=Rr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Gr({key:new bu("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(l=>l.$from.pos)),u=Math.max(...o.map(l=>l.$to.pos)),s=p5(n);return d5(r,{from:a,to:u},{textSerializers:s})}}})]}}),Y1e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),J1e=(e=!1)=>({commands:t})=>t.setContent("",e),Z1e=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(u,s)=>{if(u.type.isText)return;const{doc:c,mapping:l}=t,f=c.resolve(l.map(s)),d=c.resolve(l.map(s+u.nodeSize)),p=f.blockRange(d);if(!p)return;const h=vf(p);if(u.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,v)}(h||h===0)&&t.lift(p,h)})}),!0},X1e=e=>t=>e(t),Q1e=()=>({state:e,dispatch:t})=>$1e(e,t),eOe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const u=i.before(o),s=i.after(o);e.delete(u,s).scrollIntoView()}return!0}return!1},tOe=e=>({tr:t,state:n,dispatch:r})=>{const i=nn(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const s=o.before(a),c=o.after(a);t.delete(s,c).scrollIntoView()}return!0}return!1},nOe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},rOe=()=>({state:e,dispatch:t})=>l1e(e,t),iOe=()=>({commands:e})=>e.keyboardShortcut("Enter"),oOe=()=>({state:e,dispatch:t})=>S1e(e,t);function Ob(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:PE(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function DE(e,t,n={}){return e.find(r=>r.type===t&&Ob(r.attrs,n))}function aOe(e,t,n={}){return!!DE(e,t,n)}function qE(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=DE([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,u=o+1,s=a+r.node.nodeSize;for(DE([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;u<e.parent.childCount&&aOe([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function Ru(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}const uOe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Ru(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=qE(s,o,t);if(f&&f.from<=c&&f.to>=l){const d=Be.create(a,f.from,f.to);n.setSelection(d)}}return!0},sOe=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function UE(e){return e instanceof Be}function $a(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function h5(e,t=null){if(!t)return null;const n=We.atStart(e),r=We.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Be.create(e,$a(0,i,o),$a(e.content.size,i,o)):Be.create(e,$a(t,i,o),$a(t,i,o))}function BE(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const cOe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{BE()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!UE(n.state.selection))return a(),!0;const u=h5(i.doc,e)||n.state.selection,s=n.state.selection.eq(u);return o&&(s||i.setSelection(u),s&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},lOe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),fOe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function m5(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function wb(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)?z.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),wb("",t,n)}if(typeof e=="string"){const r=hf.fromSchema(t);return n.slice?r.parseSlice(m5(e),n.parseOptions).content:r.parse(m5(e),n.parseOptions)}return wb("",t,n)}function dOe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof En||i instanceof tn))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(We.near(e.doc.resolve(a),n))}const pOe=e=>e.toString().startsWith("<"),hOe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const a=wb(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:s}=typeof e=="number"?{from:e,to:e}:e,c=!0,l=!0;if((pOe(a)?a:[a]).forEach(d=>{d.check(),c=c?d.isText&&d.marks.length===0:!1,l=l?d.isBlock:!1}),u===s&&l){const{parent:d}=r.doc.resolve(u);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(u-=1,s+=1)}c?r.insertText(t,u,s):r.replaceWith(u,s,a),n.updateSelection&&dOe(r,r.steps.length-1,-1)}return!0},mOe=()=>({state:e,dispatch:t})=>g1e(e,t),vOe=()=>({state:e,dispatch:t})=>y1e(e,t),gOe=()=>({state:e,dispatch:t})=>d1e(e,t),yOe=()=>({state:e,dispatch:t})=>m1e(e,t);function v5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function bOe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u+=1){const s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))BE()||v5()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${s}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const _Oe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=bOe(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),s=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,u))});return s==null||s.steps.forEach(c=>{const l=c.map(r.mapping);l&&i&&r.maybeStep(l)}),!0};function Lh(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?nn(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const p=Math.max(r,d),h=Math.min(i,d+f.nodeSize);u.push({node:f,from:p,to:h})});const s=i-r,c=u.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Ob(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=s}const SOe=(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return Lh(n,i,t)?b1e(n,r):!1},$Oe=()=>({state:e,dispatch:t})=>T1e(e,t),TOe=e=>({state:t,dispatch:n})=>{const r=nn(e,t.schema);return x1e(r)(t,n)},IOe=()=>({state:e,dispatch:t})=>_1e(e,t);function Cb(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function g5(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const OOe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=Cb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=nn(e,r.schema)),u==="mark"&&(a=Ru(e,r.schema)),i&&n.selection.ranges.forEach(s=>{r.doc.nodesBetween(s.$from.pos,s.$to.pos,(c,l)=>{o&&o===c.type&&n.setNodeMarkup(l,void 0,g5(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(g5(f.attrs,t)))})})}),!0):!1},wOe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),COe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),EOe=()=>({state:e,dispatch:t})=>p1e(e,t),ROe=()=>({state:e,dispatch:t})=>v1e(e,t),MOe=()=>({state:e,dispatch:t})=>I1e(e,t),xOe=()=>({state:e,dispatch:t})=>C1e(e,t),kOe=()=>({state:e,dispatch:t})=>w1e(e,t);function y5(e,t,n={}){return wb(e,t,{slice:!1,parseOptions:n})}const AOe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=y5(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function NOe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function FOe(e,t){for(let n=e.depth;n>0;n-=1){const 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=>FOe(t.$from,e)}function POe(e,t){const n=po.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function WOe(e){const t=pc.resolve(e);return l5(t)}function jOe(e,t){const n={from:0,to:e.content.size};return d5(e,n,t)}function b5(e,t){const n=Ru(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,s=>{a.push(...s.marks)});const u=a.find(s=>s.type.name===n.name);return u?{...u.attrs}:{}}function LOe(e,t){const n=nn(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function DOe(e,t){const n=Cb(typeof t=="string"?t:t.name,e.schema);return n==="node"?LOe(e,t):n==="mark"?b5(e,t):{}}function _5(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=qE(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function KE(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Ru(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ob(f.attrs,n,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,h=d.pos;e.doc.nodesBetween(p,h,(v,m)=>{if(!v.isText&&!v.marks.length)return;const _=Math.max(p,m),g=Math.min(h,m+v.nodeSize),S=g-_;a+=S,u.push(...v.marks.map(b=>({mark:b,from:_,to:g})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ob(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(s>0?s+c:s)>=a}function qOe(e,t,n={}){if(!t)return Lh(e,null,n)||KE(e,null,n);const r=Cb(t,e.schema);return r==="node"?Lh(e,t,n):r==="mark"?KE(e,t,n):!1}function S5(e,t){const{nodeExtensions:n}=Tb(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Fe(fe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function UOe(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function BOe(e){return e instanceof Se}function zOe(e,t,n){const i=e.state.doc.content.size,o=$a(t,0,i),a=$a(n,0,i),u=e.coordsAtPos(o),s=e.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p=d-f,h=l-c,_={top:c,bottom:l,left:f,right:d,width:p,height:h,x:f,y:c};return{..._,toJSON:()=>_}}function KOe(e,t,n){var r;const{selection:i}=t;let o=null;if(UE(i)&&(o=i.$cursor),o){const u=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(u)||!u.some(s=>s.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:u,$to:s})=>{let c=u.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(u.pos,s.pos,(l,f,d)=>{if(c)return!1;if(l.isInline){const p=!d||d.type.allowsMarkType(n),h=!!n.isInSet(l.marks)||!l.marks.some(v=>v.type.excludes(n));c=p&&h}return!c}),c})}const VOe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=Ru(e,r.schema);if(i)if(a){const c=b5(r,s);n.addStoredMark(s.create({...c,...t}))}else u.forEach(c=>{const l=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(l,f,(d,p)=>{const h=Math.max(p,l),v=Math.min(p+d.nodeSize,f);d.marks.find(_=>_.type===s)?d.marks.forEach(_=>{s===_.type&&n.addMark(h,v,s.create({..._.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return KOe(r,n,s)},HOe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),GOe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=nn(e,n.schema);return o.isTextblock?i().command(({commands:a})=>o5(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>o5(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},YOe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=$a(e,0,r.content.size),o=Se.create(r,i);t.setSelection(o)}return!0},JOe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Be.atStart(r).from,u=Be.atEnd(r).to,s=$a(i,a,u),c=$a(o,a,u),l=Be.create(r,s,c);t.setSelection(l)}return!0},ZOe=e=>({state:t,dispatch:n})=>{const r=nn(e,t.schema);return N1e(r)(t,n)};function Eb(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function $5(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const XOe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:u,$to:s}=o,c=i.extensionManager.attributes,l=Eb(c,u.node().type.name,u.node().attrs);if(o instanceof Se&&o.node.isBlock)return!u.parentOffset||!gf(a,u.pos)?!1:(r&&(e&&$5(n,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const f=s.parentOffset===s.parent.content.size;o instanceof Be&&t.deleteSelection();const d=u.depth===0?void 0:NOe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&d?[{type:d,attrs:l}]:void 0,h=gf(t.doc,t.mapping.map(u.pos),1,p);if(!p&&!h&&gf(t.doc,t.mapping.map(u.pos),1,d?[{type:d}]:void 0)&&(h=!0,p=d?[{type:d,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,p),d&&!f&&!u.parentOffset&&u.parent.type!==d)){const v=t.mapping.map(u.before()),m=t.doc.resolve(v);u.node(-1).canReplaceWith(m.index(),m.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}e&&$5(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},QOe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=nn(e,n.schema),{$from:u,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(s))return!1;const l=u.node(-1);if(l.type!==a)return!1;const f=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let m=z.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let M=u.depth-_;M>=u.depth-3;M-=1)m=z.from(u.node(M).copy(m));const g=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,S=Eb(f,u.node().type.name,u.node().attrs),b=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(S))||void 0;m=m.append(z.from(a.createAndFill(null,b)||void 0));const $=u.before(u.depth-(_-1));t.replace($,u.after(-g),new se(m,4-_,0));let T=-1;t.doc.nodesBetween($,t.doc.content.size,(M,R)=>{if(T>-1)return!1;M.isTextblock&&M.content.size===0&&(T=R+1)}),T>-1&&t.setSelection(Be.near(t.doc.resolve(T))),t.scrollIntoView()}return!0}const d=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,p=Eb(f,l.type.name,l.attrs),h=Eb(f,u.node().type.name,u.node().attrs);t.delete(u.pos,s.pos);const v=d?[{type:a,attrs:p},{type:d,attrs:h}]:[{type:a,attrs:p}];return gf(t.doc,u.pos,2)?(r&&t.split(u.pos,2,v).scrollIntoView(),!0):!1},T5=(e,t)=>{const n=zE(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&yu(e.doc,n.pos)&&e.join(n.pos),!0},I5=(e,t)=>{const n=zE(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&yu(e.doc,r)&&e.join(r),!0};var ewe=Object.freeze({__proto__:null,blur:Y1e,clearContent:J1e,clearNodes:Z1e,command:X1e,createParagraphNear:Q1e,deleteCurrentNode:eOe,deleteNode:tOe,deleteRange:nOe,deleteSelection:rOe,enter:iOe,exitCode:oOe,extendMarkRange:uOe,first:sOe,focus:cOe,forEach:lOe,insertContent:fOe,insertContentAt:hOe,joinUp:mOe,joinDown:vOe,joinBackward:gOe,joinForward:yOe,keyboardShortcut:_Oe,lift:SOe,liftEmptyBlock:$Oe,liftListItem:TOe,newlineInCode:IOe,resetAttributes:OOe,scrollIntoView:wOe,selectAll:COe,selectNodeBackward:EOe,selectNodeForward:ROe,selectParentNode:MOe,selectTextblockEnd:xOe,selectTextblockStart:kOe,setContent:AOe,setMark:VOe,setMeta:HOe,setNode:GOe,setNodeSelection:YOe,setTextSelection:JOe,sinkListItem:ZOe,splitBlock:XOe,splitListItem:QOe,toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:a,commands:u,can:s})=>{const{extensions:c}=n.extensionManager,l=nn(e,i.schema),f=nn(t,i.schema),{selection:d}=i,{$from:p,$to:h}=d,v=p.blockRange(h);if(!v)return!1;const m=zE(_=>S5(_.type.name,c))(d);if(v.depth>=1&&m&&v.depth-m.depth<=1){if(m.node.type===l)return u.liftListItem(f);if(S5(m.node.type.name,c)&&l.validContent(m.node.content)&&o)return a().command(()=>(r.setNodeMarkup(m.pos,l),!0)).command(()=>T5(r,l)).command(()=>I5(r,l)).run()}return a().command(()=>s().wrapInList(l)?!0:u.clearNodes()).wrapInList(l).command(()=>T5(r,l)).command(()=>I5(r,l)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Ru(e,r.schema);return KE(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=nn(e,r.schema),a=nn(t,r.schema);return Lh(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=nn(e,n.schema);return Lh(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,u=o.transform;for(let s=u.steps.length-1;s>=0;s-=1)a.step(u.steps[s].invert(u.docs[s]));if(o.text){const s=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,s))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=Ru(e,r.schema),{$from:c,empty:l,ranges:f}=u;if(!i)return!0;if(l&&a){let{from:d,to:p}=u;const h=(o=c.marks().find(m=>m.type===s))===null||o===void 0?void 0:o.attrs,v=qE(c,s,h);v&&(d=v.from,p=v.to),n.removeMark(d,p,s)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,s)});return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=Cb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=nn(e,r.schema)),u==="mark"&&(a=Ru(e,r.schema)),i&&n.selection.ranges.forEach(s=>{const c=s.$from.pos,l=s.$to.pos;r.doc.nodesBetween(c,l,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(p=>{if(a===p.type){const h=Math.max(d,c),v=Math.min(d+f.nodeSize,l);n.addMark(h,v,a.create({...p.attrs,...t}))}})})}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return E1e(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return R1e(i,t)(n,r)}});const twe=Rr.create({name:"commands",addCommands(){return{...ewe}}}),nwe=Rr.create({name:"editable",addProseMirrorPlugins(){return[new Gr({key:new bu("editable"),props:{editable:()=>this.editor.options.editable}})]}}),rwe=Rr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Gr({key:new bu("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),iwe=Rr.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:s,doc:c}=u,{empty:l,$anchor:f}=s,{pos:d,parent:p}=f,h=We.atStart(c).from===d;return!l||!h||!p.type.isTextblock||p.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.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()},i={...r},o={...r,"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 BE()||v5()?o:i},addProseMirrorPlugins(){return[new Gr({key:new bu("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(h=>h.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:a}=t.selection,u=We.atStart(t.doc).from,s=We.atEnd(t.doc).to,c=o===u&&a===s,l=n.doc.textBetween(0,n.doc.content.size," "," ").length===0;if(i||!c||!l)return;const f=n.tr,d=Sb({state:n,transaction:f}),{commands:p}=new $b({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),owe=Rr.create({name:"tabindex",addProseMirrorPlugins(){return[new Gr({key:new bu("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var awe=Object.freeze({__proto__:null,ClipboardTextSerializer:G1e,Commands:twe,Editable:nwe,FocusEvents:rwe,Keymap:iwe,Tabindex:owe});const uwe=`.ProseMirror {
17
+ */var gM;function jH(){return gM||(gM=1,process.env.NODE_ENV!=="production"&&function(){var e=j,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function g(E){if(E===null||typeof E!="object")return null;var z=h&&E[h]||E[v];return typeof z=="function"?z:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(E){{for(var z=arguments.length,te=new Array(z>1?z-1:0),Se=1;Se<z;Se++)te[Se-1]=arguments[Se];O("error",E,te)}}function O(E,z,te){{var Se=b.ReactDebugCurrentFrame,Je=Se.getStackAddendum();Je!==""&&(z+="%s",te=te.concat([Je]));var it=te.map(function(qe){return String(qe)});it.unshift("Warning: "+z),Function.prototype.apply.call(console[E],console,it)}}var y=!1,C=!1,I=!1,M=!1,R=!1,U;U=Symbol.for("react.module.reference");function q(E){return!!(typeof E=="string"||typeof E=="function"||E===r||E===o||R||E===i||E===c||E===l||M||E===p||y||C||I||typeof E=="object"&&E!==null&&(E.$$typeof===d||E.$$typeof===f||E.$$typeof===a||E.$$typeof===u||E.$$typeof===s||E.$$typeof===U||E.getModuleId!==void 0))}function N(E,z,te){var Se=E.displayName;if(Se)return Se;var Je=z.displayName||z.name||"";return Je!==""?te+"("+Je+")":te}function Z(E){return E.displayName||"Context"}function ee(E){if(E==null)return null;if(typeof E.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof E=="function")return E.displayName||E.name||null;if(typeof E=="string")return E;switch(E){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof E=="object")switch(E.$$typeof){case u:var z=E;return Z(z)+".Consumer";case a:var te=E;return Z(te._context)+".Provider";case s:return N(E,E.render,"ForwardRef");case f:var Se=E.displayName||null;return Se!==null?Se:ee(E.type)||"Memo";case d:{var Je=E,it=Je._payload,qe=Je._init;try{return ee(qe(it))}catch{return null}}}return null}var J=Object.assign,ve=0,Ie,k,A,T,$,x,L;function X(){}X.__reactDisabledLog=!0;function ne(){{if(ve===0){Ie=console.log,k=console.info,A=console.warn,T=console.error,$=console.group,x=console.groupCollapsed,L=console.groupEnd;var E={configurable:!0,enumerable:!0,value:X,writable:!0};Object.defineProperties(console,{info:E,log:E,warn:E,error:E,group:E,groupCollapsed:E,groupEnd:E})}ve++}}function xe(){{if(ve--,ve===0){var E={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},E,{value:Ie}),info:J({},E,{value:k}),warn:J({},E,{value:A}),error:J({},E,{value:T}),group:J({},E,{value:$}),groupCollapsed:J({},E,{value:x}),groupEnd:J({},E,{value:L})})}ve<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var se=b.ReactCurrentDispatcher,Ae;function ze(E,z,te){{if(Ae===void 0)try{throw Error()}catch(Je){var Se=Je.stack.trim().match(/\n( *(at )?)/);Ae=Se&&Se[1]||""}return`
18
+ `+Ae+E}}var He=!1,ut;{var Ut=typeof WeakMap=="function"?WeakMap:Map;ut=new Ut}function Qt(E,z){if(!E||He)return"";{var te=ut.get(E);if(te!==void 0)return te}var Se;He=!0;var Je=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var it;it=se.current,se.current=null,ne();try{if(z){var qe=function(){throw Error()};if(Object.defineProperty(qe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(qe,[])}catch(ja){Se=ja}Reflect.construct(E,[],qe)}else{try{qe.call()}catch(ja){Se=ja}E.call(qe.prototype)}}else{try{throw Error()}catch(ja){Se=ja}E()}}catch(ja){if(ja&&Se&&typeof ja.stack=="string"){for(var Pe=ja.stack.split(`
19
+ `),Hn=Se.stack.split(`
20
+ `),kt=Pe.length-1,Wt=Hn.length-1;kt>=1&&Wt>=0&&Pe[kt]!==Hn[Wt];)Wt--;for(;kt>=1&&Wt>=0;kt--,Wt--)if(Pe[kt]!==Hn[Wt]){if(kt!==1||Wt!==1)do if(kt--,Wt--,Wt<0||Pe[kt]!==Hn[Wt]){var ii=`
21
+ `+Pe[kt].replace(" at new "," at ");return E.displayName&&ii.includes("<anonymous>")&&(ii=ii.replace("<anonymous>",E.displayName)),typeof E=="function"&&ut.set(E,ii),ii}while(kt>=1&&Wt>=0);break}}}finally{He=!1,se.current=it,xe(),Error.prepareStackTrace=Je}var od=E?E.displayName||E.name:"",AH=od?ze(od):"";return typeof E=="function"&&ut.set(E,AH),AH}function gn(E,z,te){return Qt(E,!1)}function dr(E){var z=E.prototype;return!!(z&&z.isReactComponent)}function Ui(E,z,te){if(E==null)return"";if(typeof E=="function")return Qt(E,dr(E));if(typeof E=="string")return ze(E);switch(E){case c:return ze("Suspense");case l:return ze("SuspenseList")}if(typeof E=="object")switch(E.$$typeof){case s:return gn(E.render);case f:return Ui(E.type,z,te);case d:{var Se=E,Je=Se._payload,it=Se._init;try{return Ui(it(Je),z,te)}catch{}}}return""}var ti=Object.prototype.hasOwnProperty,Ro={},Fa=b.ReactDebugCurrentFrame;function Bi(E){if(E){var z=E._owner,te=Ui(E.type,E._source,z?z.type:null);Fa.setExtraStackFrame(te)}else Fa.setExtraStackFrame(null)}function pr(E,z,te,Se,Je){{var it=Function.call.bind(ti);for(var qe in E)if(it(E,qe)){var Pe=void 0;try{if(typeof E[qe]!="function"){var Hn=Error((Se||"React class")+": "+te+" type `"+qe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof E[qe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Hn.name="Invariant Violation",Hn}Pe=E[qe](z,qe,Se,te,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(kt){Pe=kt}Pe&&!(Pe instanceof Error)&&(Bi(Je),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Se||"React class",te,qe,typeof Pe),Bi(null)),Pe instanceof Error&&!(Pe.message in Ro)&&(Ro[Pe.message]=!0,Bi(Je),S("Failed %s type: %s",te,Pe.message),Bi(null))}}}var ni=Array.isArray;function qi(E){return ni(E)}function zi(E){{var z=typeof Symbol=="function"&&Symbol.toStringTag,te=z&&E[Symbol.toStringTag]||E.constructor.name||"Object";return te}}function Na(E){try{return Pa(E),!1}catch{return!0}}function Pa(E){return""+E}function Wa(E){if(Na(E))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",zi(E)),Pa(E)}var ri=b.ReactCurrentOwner,Hu={key:!0,ref:!0,__self:!0,__source:!0},ed,P,F;F={};function D(E){if(ti.call(E,"ref")){var z=Object.getOwnPropertyDescriptor(E,"ref").get;if(z&&z.isReactWarning)return!1}return E.ref!==void 0}function Fe(E){if(ti.call(E,"key")){var z=Object.getOwnPropertyDescriptor(E,"key").get;if(z&&z.isReactWarning)return!1}return E.key!==void 0}function W(E,z){if(typeof E.ref=="string"&&ri.current&&z&&ri.current.stateNode!==z){var te=ee(ri.current.type);F[te]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ee(ri.current.type),E.ref),F[te]=!0)}}function ie(E,z){{var te=function(){ed||(ed=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",z))};te.isReactWarning=!0,Object.defineProperty(E,"key",{get:te,configurable:!0})}}function me(E,z){{var te=function(){P||(P=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",z))};te.isReactWarning=!0,Object.defineProperty(E,"ref",{get:te,configurable:!0})}}var he=function(E,z,te,Se,Je,it,qe){var Pe={$$typeof:t,type:E,key:z,ref:te,props:qe,_owner:it};return Pe._store={},Object.defineProperty(Pe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Pe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.defineProperty(Pe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Je}),Object.freeze&&(Object.freeze(Pe.props),Object.freeze(Pe)),Pe};function Oe(E,z,te,Se,Je){{var it,qe={},Pe=null,Hn=null;te!==void 0&&(Wa(te),Pe=""+te),Fe(z)&&(Wa(z.key),Pe=""+z.key),D(z)&&(Hn=z.ref,W(z,Je));for(it in z)ti.call(z,it)&&!Hu.hasOwnProperty(it)&&(qe[it]=z[it]);if(E&&E.defaultProps){var kt=E.defaultProps;for(it in kt)qe[it]===void 0&&(qe[it]=kt[it])}if(Pe||Hn){var Wt=typeof E=="function"?E.displayName||E.name||"Unknown":E;Pe&&ie(qe,Wt),Hn&&me(qe,Wt)}return he(E,Pe,Hn,Je,Se,ri.current,qe)}}var st=b.ReactCurrentOwner,Vn=b.ReactDebugCurrentFrame;function Nr(E){if(E){var z=E._owner,te=Ui(E.type,E._source,z?z.type:null);Vn.setExtraStackFrame(te)}else Vn.setExtraStackFrame(null)}var td;td=!1;function Ki(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function nd(){{if(st.current){var E=ee(st.current.type);if(E)return`
22
+
23
+ Check the render method of \``+E+"`."}return""}}function rd(E){{if(E!==void 0){var z=E.fileName.replace(/^.*[\\\/]/,""),te=E.lineNumber;return`
24
+
25
+ Check your code at `+z+":"+te+"."}return""}}var La={};function fM(E){{var z=nd();if(!z){var te=typeof E=="string"?E:E.displayName||E.name;te&&(z=`
26
+
27
+ Check the top-level render call using <`+te+">.")}return z}}function id(E,z){{if(!E._store||E._store.validated||E.key!=null)return;E._store.validated=!0;var te=fM(z);if(La[te])return;La[te]=!0;var Se="";E&&E._owner&&E._owner!==st.current&&(Se=" It was passed a child from "+ee(E._owner.type)+"."),Nr(E),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',te,Se),Nr(null)}}function kc(E,z){{if(typeof E!="object")return;if(qi(E))for(var te=0;te<E.length;te++){var Se=E[te];Ki(Se)&&id(Se,z)}else if(Ki(E))E._store&&(E._store.validated=!0);else if(E){var Je=g(E);if(typeof Je=="function"&&Je!==E.entries)for(var it=Je.call(E),qe;!(qe=it.next()).done;)Ki(qe.value)&&id(qe.value,z)}}}function uAe(E){{var z=E.type;if(z==null||typeof z=="string")return;var te;if(typeof z=="function")te=z.propTypes;else if(typeof z=="object"&&(z.$$typeof===s||z.$$typeof===f))te=z.propTypes;else return;if(te){var Se=ee(z);pr(te,E.props,"prop",Se,E)}else if(z.PropTypes!==void 0&&!td){td=!0;var Je=ee(z);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Je||"Unknown")}typeof z.getDefaultProps=="function"&&!z.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sAe(E){{for(var z=Object.keys(E.props),te=0;te<z.length;te++){var Se=z[te];if(Se!=="children"&&Se!=="key"){Nr(E),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),Nr(null);break}}E.ref!==null&&(Nr(E),S("Invalid attribute `ref` supplied to `React.Fragment`."),Nr(null))}}function kH(E,z,te,Se,Je,it){{var qe=q(E);if(!qe){var Pe="";(E===void 0||typeof E=="object"&&E!==null&&Object.keys(E).length===0)&&(Pe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Hn=rd(Je);Hn?Pe+=Hn:Pe+=nd();var kt;E===null?kt="null":qi(E)?kt="array":E!==void 0&&E.$$typeof===t?(kt="<"+(ee(E.type)||"Unknown")+" />",Pe=" Did you accidentally export a JSX literal instead of a component?"):kt=typeof E,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",kt,Pe)}var Wt=Oe(E,z,te,Je,it);if(Wt==null)return Wt;if(qe){var ii=z.children;if(ii!==void 0)if(Se)if(qi(ii)){for(var od=0;od<ii.length;od++)kc(ii[od],E);Object.freeze&&Object.freeze(ii)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else kc(ii,E)}return E===r?sAe(Wt):uAe(Wt),Wt}}function cAe(E,z,te){return kH(E,z,te,!0)}function lAe(E,z,te){return kH(E,z,te,!1)}var fAe=lAe,dAe=cAe;sd.Fragment=r,sd.jsx=fAe,sd.jsxs=dAe}()),sd}(function(e){process.env.NODE_ENV==="production"?e.exports=LH():e.exports=jH()})(WH);var yM=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},C_=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},bM=function(e){var t=C_(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},w_=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},_M=function(e){var t=w_(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}},DH=function(e){return function(t){return t(e)}};function B(e){return e}var Fc=B;function Gn(e){return function(){return e}}var E_=Gn(!0),$M=Gn(!1),SM=Gn(null),R_=Gn(void 0),UH=R_;function BH(e){return function(t,n){return e(n,t)}}function H(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function TM(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function qH(e){return e+1}function zH(e){return e-1}function IM(e){throw new Error("Called `absurd` function which should be uncallable")}function KH(e){return function(t){return e.apply(void 0,t)}}function VH(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function m(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return u(a(o(i(r(n(t(e)))))));case 9:return s(u(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var HH=IM,Yn=function(e,t){return t};function GH(e){return function(t){return!e(t)}}var YH=function(){return{concat:function(e,t){return H(e,t)},empty:B}};const OM=Object.freeze(Object.defineProperty({__proto__:null,SK:Yn,absurd:IM,apply:DH,constFalse:$M,constNull:SM,constTrue:E_,constUndefined:R_,constVoid:UH,constant:Gn,decrement:zH,flip:BH,flow:H,getBooleanAlgebra:yM,getEndomorphismMonoid:YH,getMonoid:bM,getRing:_M,getSemigroup:C_,getSemiring:w_,hole:HH,identity:B,increment:qH,not:GH,pipe:m,tuple:TM,tupled:KH,unsafeCoerce:Fc,untupled:VH},Symbol.toStringTag,{value:"Module"}));var Pr=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},CM=function(e){return Pr(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},wM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Pr(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},JH=function(e,t){return m(e,EM(t))},EM=function(e){return function(t){return Pr(function(n,r){return t.equals(e(n),e(r))})}},RM="Eq",Nc={equals:function(e,t){return e===t}},ZH={equals:function(){return!0}},MM=function(){return{concat:function(e,t){return Pr(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},XH=function(){return{concat:MM().concat,empty:ZH}},xM={URI:RM,contramap:JH},QH=wM,e6=CM,t6=Nc.equals,n6=xM,r6=Nc,i6=Nc,o6=Nc,a6={equals:function(e,t){return e.valueOf()===t.valueOf()}};const u6=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:xM,URI:RM,contramap:EM,eq:n6,eqBoolean:r6,eqDate:a6,eqNumber:o6,eqStrict:Nc,eqString:i6,fromEquals:Pr,getMonoid:XH,getSemigroup:MM,getStructEq:e6,getTupleEq:QH,strictEqual:t6,struct:CM,tuple:wM},Symbol.toStringTag,{value:"Module"}));function Pc(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function Ue(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function Tt(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function Wc(e,t){var n=Pc(e,t);return{map:function(r,i){return m(r,n(i))}}}const s6=Object.freeze(Object.defineProperty({__proto__:null,bindTo:Tt,flap:Ue,getFunctorComposition:Wc,map:Pc},Symbol.toStringTag,{value:"Module"}));var c6=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},At=function(e){return e._tag==="None"},gt=function(e){return e._tag==="Some"},ge={_tag:"None"},fe=function(e){return{_tag:"Some",value:e}},Bt=function(e){return e._tag==="Left"},M_=function(e){return e._tag==="Right"},Mo=function(e){return{_tag:"Left",left:e}},Da=function(e){return{_tag:"Right",right:e}},cd=function(e){return[e]},mt=function(e){return e.length>0},hr=function(e){return e[0]},Lc=function(e){return e.slice(1)},en=[],qt={},ct=Object.prototype.hasOwnProperty,hm=function(e){return c6([e[0]],e.slice(1),!0)},Ee=function(e,t){return{left:e,right:t}},l6=function(e,t){return m(e,kM(t))},f6=function(e,t){return m(e,AM(t))},d6=function(e,t,n){return m(e,FM(t,n))},kM=function(e){return function(t){return Ee(mm(t),e(vm(t)))}},AM=function(e){return function(t){return Ee(e(mm(t)),vm(t))}},FM=function(e,t){return function(n){return Ee(e(mm(n)),t(vm(n)))}},x_="Separated",p6={URI:x_,mapLeft:f6,bimap:d6},NM={URI:x_,map:l6},h6=Ue(NM),mm=function(e){return e.left},vm=function(e){return e.right};const m6=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:p6,Functor:NM,URI:x_,bimap:FM,flap:h6,left:mm,map:kM,mapLeft:AM,right:vm,separated:Ee},Symbol.toStringTag,{value:"Module"}));function xo(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function It(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Ot(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Ct(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}function zt(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function k_(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):k_(e,t-1,i)}}var A_={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function v6(e){return ct.call(A_,e)||(A_[e]=k_(TM,e-1,[])),A_[e]}function g6(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=v6(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function y6(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return k_(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function b6(e){return function(t){for(var n=Object.keys(t),r=n.length,i=y6(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const _6=Object.freeze(Object.defineProperty({__proto__:null,ap:xo,apFirst:It,apS:Ct,apSecond:Ot,getApplySemigroup:zt,sequenceS:b6,sequenceT:g6},Symbol.toStringTag,{value:"Module"}));function lt(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function wt(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}const $6=Object.freeze(Object.defineProperty({__proto__:null,bind:wt,chainFirst:lt},Symbol.toStringTag,{value:"Module"}));var PM=function(e){return function(t,n){return t===n||e(t,n)===0}},Gu=function(e){return{equals:PM(e),compare:function(t,n){return t===n?0:e(t,n)}}},WM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Gu(function(n,r){for(var i=0;i<e.length-1;i++){var o=e[i].compare(n[i],r[i]);if(o!==0)return o}return e[i].compare(n[i],r[i])})},F_=function(e){return Gu(function(t,n){return e.compare(n,t)})},S6=function(e,t){return m(e,gm(t))},gm=function(e){return function(t){return Gu(function(n,r){return t.compare(e(n),e(r))})}},LM="Ord",jM=function(){return{concat:function(e,t){return Gu(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},N_=function(){return{concat:jM().concat,empty:Gu(function(){return 0})}},DM={URI:LM,contramap:S6},T6={equals:E_,compare:Gn(0)},I6=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},UM=function(e){return function(t,n){return e.compare(t,n)===-1}},BM=function(e){return function(t,n){return e.compare(t,n)===1}},O6=function(e){return function(t,n){return e.compare(t,n)!==1}},C6=function(e){return function(t,n){return e.compare(t,n)!==-1}},ym=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},bm=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},qM=function(e){var t=ym(e),n=bm(e);return function(r,i){return function(o){return n(t(o,i),r)}}},w6=function(e){var t=UM(e),n=BM(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},E6=WM,R6=F_,M6=DM;function x6(e,t){return e<t?-1:e>t?1:0}var P_={equals:Nc.equals,compare:x6},k6=P_,A6=P_,_m=P_,F6=m(_m,gm(function(e){return e.valueOf()}));const N6=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:DM,URI:LM,between:w6,clamp:qM,contramap:gm,equals:I6,equalsDefault:PM,fromCompare:Gu,geq:C6,getDualOrd:R6,getMonoid:N_,getSemigroup:jM,getTupleOrd:E6,gt:BM,leq:O6,lt:UM,max:bm,min:ym,ord:M6,ordBoolean:k6,ordDate:F6,ordNumber:_m,ordString:A6,reverse:F_,trivial:T6,tuple:WM},Symbol.toStringTag,{value:"Module"}));var zM=function(e){return{concat:function(t,n){return e.concat(n,t)}}},P6=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},W6=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},L6=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},KM=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const j6=Object.freeze(Object.defineProperty({__proto__:null,concatAll:KM,endo:L6,filterFirst:P6,filterSecond:W6,reverse:zM},Symbol.toStringTag,{value:"Module"}));var $m=function(e){return{concat:ym(e)}},Sm=function(e){return{concat:bm(e)}},W_=function(e){return{concat:function(){return e}}},L_=zM,j_=function(e){return{concat:function(t,n){var r={};for(var i in e)ct.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},D_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,o){return i.concat(n[o],r[o])})}}},VM=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},U_=function(){return{concat:B}},Tm=function(){return{concat:function(e,t){return t}}},B_=KM,HM=W_(void 0),D6=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},U6=Tm,B6=U_,q6=D_,z6=j_,K6=L_,V6=Sm,H6=$m,G6=VM;function Y6(e){var t=B_(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var GM={concat:function(e,t){return e&&t}},YM={concat:function(e,t){return e||t}},J6=C_,JM={concat:function(e,t){return e+t}},ZM={concat:function(e,t){return e+t}},XM={concat:function(e,t){return e*t}};const QM=Object.freeze(Object.defineProperty({__proto__:null,concatAll:B_,constant:W_,first:U_,fold:Y6,getDualSemigroup:K6,getFirstSemigroup:B6,getFunctionSemigroup:J6,getIntercalateSemigroup:G6,getJoinSemigroup:V6,getLastSemigroup:U6,getMeetSemigroup:H6,getObjectSemigroup:D6,getStructSemigroup:z6,getTupleSemigroup:q6,intercalate:VM,last:Tm,max:Sm,min:$m,reverse:L_,semigroupAll:GM,semigroupAny:YM,semigroupProduct:XM,semigroupString:JM,semigroupSum:ZM,semigroupVoid:HM,struct:j_,tuple:D_},Symbol.toStringTag,{value:"Module"}));var ld=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},fd=en,Vi=mt,Im=function(e,t){return e<0||e>=t.length},q_=function(e){return function(t){return ld([e],t,!0)}},jc=q_,z_=function(e){return function(t){return ld(ld([],t,!0),[e],!1)}},Om=z_,Cm=function(e,t,n){if(Vi(n)){var r=hm(n);return r.splice(e,0,t),r}return[t]},K_=function(e,t,n){if(n[e]===t)return n;var r=hm(n);return r[e]=t,r},V_=function(e){return function(t){if(t.length===1)return t;for(var n=[xn(t)],r=ai(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},ex=function(e){if(Vi(e)){var t=N_();return Y_(e.reduce(t.concat,t.empty))}return B},H_=function(e){var t=V_(e);return function(n){return function(r){return t(m(r,pd(n)))}}},G_=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Im(Math.abs(r),t)||r===0)return t;if(r<0){var i=Rm(-r)(t),o=i[0],a=i[1];return m(a,pd(o))}else return G_(r-n)(t)}},dd=function(e){return Vi(e)?fe(e):ge},wm=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},Z6=function(e){return wm(function(){return e})},tx=function(e,t){return e<=t?wm(function(n){return e+n})(t-e+1):[e]},nx=function(e){return[xn(e),ai(e)]},rx=function(e){return[Dc(e),Ba(e)]},X6=function(e){return dd(e.slice())};function ix(e){return function(t){return t.concat(e)}}function pd(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var Q6=function(e){return e.length===1?e:ld([Ba(e)],e.slice(0,-1).reverse(),!0)};function ox(e){return function(t){var n=t.length;if(n===0)return fd;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var e9=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ct.call(n,a)?n[a].push(o):n[a]=[o]}return n}},Y_=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},t9=function(e,t){return ax(e,function(){return t})},ax=function(e,t){return function(n){return Im(e,n)?ge:fe(K_(e,t(n[e]),n))}},ux=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function sx(e,t){return t===void 0?function(n){return sx(n,e)}:ux(e,t,function(n,r){return[n,r]})}var n9=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Em=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},J_=function(e){return function(t){var n=ai(t);return Vi(n)?m(n,Em(e),jc(xn(t))):t}},cx=function(e){return function(t){for(var n=hm(e(0,xn(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},Z_=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Vi(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Rm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,fd]:[m(t.slice(1,n),jc(xn(t))),t.slice(n)]}},lx=function(e){return Z_(Rm(e))},oi=function(e,t){return m(e,o0(t))},X_=function(e,t){return m(e,a0(t))},hd=function(e,t){return m(e,vx(t))},Q_=function(e,t){return m(e,Mm(t))},fx=function(e,t){return m(e,i0(t))},md=function(e,t,n){return m(e,u0(t,n))},vd=function(e){var t=s0(e);return function(n,r){return m(n,t(r))}},gd=function(e,t,n){return m(e,c0(t,n))},e0=function(e){var t=gx(e);return function(n,r){return m(n,t(r))}},dx=function(e,t){return m(e,mx(t))},t0=function(e,t,n){return m(e,xm(t,n))},n0=function(e){var t=l0(e);return function(n,r){return m(n,t(r))}},r0=function(e,t,n){return m(e,km(t,n))},px=function(e){var t=Fm(e);return function(n,r){return m(n,t(r))}},Ua=cd,hx=function(e){return function(t){return m(t,ix(e()))}},mx=hx,vx=function(e){return Mm(function(t){return m(e,o0(t))})},Mm=function(e){return cx(function(t,n){return e(n)})},i0=function(e){return function(t){for(var n=ai(t),r=[e(t)];Vi(n);)r.push(e(n)),n=ai(n);return r}},r9=i0(B),i9=Mm(B),o0=function(e){return a0(function(t,n){return e(n)})},a0=function(e){return function(t){for(var n=[e(0,xn(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},u0=function(e,t){return xm(e,function(n,r,i){return t(r,i)})},s0=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i){return e.concat(r,t(i))},t(n[0]))}}},c0=function(e,t){return km(e,function(n,r,i){return t(r,i)})},xm=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},l0=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i,o){return e.concat(r,t(o+1,i))},t(0,n[0]))}}},km=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},gx=function(e){var t=Fm(e);return function(n){return t(function(r,i){return n(i)})}},Am=function(e){return Fm(e)(Yn)},Fm=function(e){return function(t){return function(n){for(var r=e.map(t(0,xn(n)),Ua),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return m(o,Om(a))}}),t(i,n[i]));return r}}},Nm=hr,Mn="ReadonlyNonEmptyArray",yx=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},o9=function(){return{concat:pd}},bx=function(e){return Pr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},a9=function(e){var t=H_(e);return{concat:function(n,r){return t(r)(n)}}},f0={URI:Mn,map:oi},u9=Ue(f0),s9={URI:Mn,of:Ua},c9={URI:Mn,map:oi,mapWithIndex:X_},Pm={URI:Mn,map:oi,ap:hd},l9=It(Pm),f9=Ot(Pm),d9={URI:Mn,map:oi,ap:hd,of:Ua},d0={URI:Mn,map:oi,ap:hd,chain:Q_},p9=lt(d0),h9={URI:Mn,map:oi,ap:hd,of:Ua,chain:Q_},m9={URI:Mn,reduce:md,foldMap:vd,reduceRight:gd},v9={URI:Mn,reduce:md,foldMap:vd,reduceRight:gd,reduceWithIndex:t0,foldMapWithIndex:n0,reduceRightWithIndex:r0},g9={URI:Mn,map:oi,reduce:md,foldMap:vd,reduceRight:gd,traverse:e0,sequence:Am},y9={URI:Mn,map:oi,mapWithIndex:X_,reduce:md,foldMap:vd,reduceRight:gd,traverse:e0,sequence:Am,reduceWithIndex:t0,foldMapWithIndex:n0,reduceRightWithIndex:r0,traverseWithIndex:px},b9={URI:Mn,map:oi,alt:dx},_9={URI:Mn,map:oi,extend:fx,extract:Nm},$9=Ua(qt),S9=Tt(f0),T9=wt(d0),I9=Ct(Pm),xn=Nm,ai=Lc,Ba=function(e){return e[e.length-1]},Dc=function(e){return e.slice(0,-1)},_x=function(e){var t=$m(e);return function(n){return n.reduce(t.concat)}},$x=function(e){var t=Sm(e);return function(n){return n.reduce(t.concat)}},Wm=function(e){return function(t){return t.reduce(e.concat)}},O9=function(e){return function(t){return e(xn(t),ai(t))}},C9=function(e){return function(t){return e(Dc(t),Ba(t))}},Sx=function(e){return function(t){return ld([e(xn(t))],ai(t),!0)}},w9=function(e){return Sx(function(){return e})},Tx=function(e){return function(t){return m(Dc(t),Om(e(Ba(t))))}},E9=function(e){return Tx(function(){return e})},p0=function(e){var t=Wm(e);return function(n){return H(J_(n),t)}};function R9(e){var t=Y_(e),n=ox(e);return function(r){return Vi(r)?n(t(r)):fd}}function M9(e){return Ix(function(t,n){return e(n)})}var Ix=function(e){return function(t){return dd(t.filter(function(n,r){return e(r,n)}))}},x9=nx,k9=rx;function Ox(e,t){return t===void 0?jc(e):m(t,jc(e))}var Cx=function(e,t){return m(e,pd([t]))},A9=function(e,t){return function(n){return e<0||e>n.length?ge:fe(Cm(e,t,n))}},F9=Em,N9=Wm,P9={URI:Mn,of:Ua,map:oi,mapWithIndex:X_,ap:hd,chain:Q_,extend:fx,extract:Nm,reduce:md,foldMap:vd,reduceRight:gd,traverse:e0,sequence:Am,reduceWithIndex:t0,foldMapWithIndex:n0,reduceRightWithIndex:r0,traverseWithIndex:px,alt:dx};const W9=Object.freeze(Object.defineProperty({__proto__:null,Alt:b9,Applicative:d9,Apply:Pm,Chain:d0,Comonad:_9,Do:$9,Foldable:m9,FoldableWithIndex:v9,Functor:f0,FunctorWithIndex:c9,Monad:h9,Pointed:s9,Traversable:g9,TraversableWithIndex:y9,URI:Mn,alt:mx,altW:hx,ap:vx,apFirst:l9,apS:I9,apSecond:f9,append:Om,appendW:z_,bind:T9,bindTo:S9,chain:Mm,chainFirst:p9,chainWithIndex:cx,chop:Z_,chunksOf:lx,concat:pd,concatAll:Wm,concatW:ix,cons:Ox,duplicate:r9,empty:fd,extend:i0,extract:Nm,filter:M9,filterWithIndex:Ix,flap:u9,flatten:i9,fold:N9,foldMap:s0,foldMapWithIndex:l0,fromArray:X6,fromReadonlyArray:dd,getEq:bx,getSemigroup:o9,getShow:yx,getUnionSemigroup:a9,group:ox,groupBy:e9,groupSort:R9,head:xn,init:Dc,insertAt:A9,intercalate:p0,intersperse:J_,isNonEmpty:Vi,isOutOfBound:Im,last:Ba,makeBy:wm,map:o0,mapWithIndex:a0,matchLeft:O9,matchRight:C9,max:$x,min:_x,modifyAt:ax,modifyHead:Sx,modifyLast:Tx,of:Ua,prepend:jc,prependAll:Em,prependToAll:F9,prependW:q_,range:tx,readonlyNonEmptyArray:P9,reduce:u0,reduceRight:c0,reduceRightWithIndex:km,reduceWithIndex:xm,replicate:Z6,reverse:Q6,rotate:G_,sequence:Am,snoc:Cx,sort:Y_,sortBy:ex,splitAt:Rm,tail:ai,traverse:gx,traverseWithIndex:Fm,unappend:rx,uncons:x9,union:H_,uniq:V_,unprepend:nx,unsafeInsertAt:Cm,unsafeUpdateAt:K_,unsnoc:k9,unzip:n9,updateAt:t9,updateHead:w9,updateLast:E9,zip:sx,zipWith:ux},Symbol.toStringTag,{value:"Module"}));var wx={equals:function(e,t){return e===t}},Ex={concat:function(e,t){return e+t}},Rx="",L9={concat:Ex.concat,empty:Rx},V={equals:wx.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},j9={show:function(e){return JSON.stringify(e)}},D9=function(e){return typeof e=="string"},U9=function(e){return e.toUpperCase()},B9=function(e){return e.toLowerCase()},q9=function(e,t){return function(n){return n.replace(e,t)}},z9=function(e){return e.trim()},K9=function(e){return e.trimLeft()},V9=function(e){return e.trimRight()},H9=function(e,t){return function(n){return n.slice(e,t)}},G9=function(e){return e.length===0},Y9=function(e){return e.length},J9=function(e){return function(t){var n=t.split(e);return Vi(n)?n:[t]}},Z9=function(e,t){return function(n){return n.includes(e,t)}},X9=function(e,t){return function(n){return n.startsWith(e,t)}},Q9=function(e,t){return function(n){return n.endsWith(e,t)}};const eG=Object.freeze(Object.defineProperty({__proto__:null,Eq:wx,Monoid:L9,Ord:V,Semigroup:Ex,Show:j9,empty:Rx,endsWith:Q9,includes:Z9,isEmpty:G9,isString:D9,replace:q9,size:Y9,slice:H9,split:J9,startsWith:X9,toLowerCase:B9,toUpperCase:U9,trim:z9,trimLeft:K9,trimRight:V9},Symbol.toStringTag,{value:"Module"}));function ui(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function si(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function h0(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?fe(o):ge})})}}}}const tG=Object.freeze(Object.defineProperty({__proto__:null,filterE:h0,wiltDefault:ui,witherDefault:si},Symbol.toStringTag,{value:"Module"}));var nG=function(e){return Object.assign({},e)},rG=function(e){return Object.assign({},e)},Mx=function(e){return Object.keys(e).length},ci=function(e){for(var t in e)if(ct.call(e,t))return!1;return!0},Uc=function(e){return function(t){return Object.keys(t).sort(e.compare)}},iG=Uc(V);function Lm(e){if(typeof e=="function")return Lm(V)(e);var t=Uc(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var m0=Lm(V)(function(e,t){return[e,t]});function oG(e){return function(t){var n=m0(t),r=n.length;return e.unfold(0,function(i){return i<r?fe([n[i],i+1]):ge})}}var v0=function(e,t){return function(n){if(ct.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},ko=function(e,t){return ct.call(t,e)};function jm(e){return function(t){if(!ct.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var aG=function(e,t){return function(n){if(!ko(e,n))return ge;if(n[e]===t)return fe(n);var r=Object.assign({},n);return r[e]=t,fe(r)}},uG=function(e,t){return function(n){if(!ko(e,n))return ge;var r=t(n[e]);if(r===n[e])return fe(n);var i=Object.assign({},n);return i[e]=r,fe(i)}};function sG(e){var t=jm(e);return function(n){var r=Yu(e,n);return At(r)?ge:fe([r.value,t(n)])}}function Dm(e){return function(t,n){if(n===void 0){var r=Dm(e);return function(o){return r(o,t)}}for(var i in t)if(!ct.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function Yu(e,t){return t===void 0?function(n){return Yu(e,n)}:ct.call(t,e)?fe(t[e]):ge}var yd={};function Um(e){return function(t){var n={};for(var r in t)ct.call(t,r)&&(n[r]=e(r,t[r]));return n}}function g0(e){return Um(function(t,n){return e(n)})}function Bc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Bc(V).apply(void 0,e);var n=Uc(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=0;c<s;c++){var l=u[c];a=i(l,a,o[l])}return a}}}function qc(e){if("compare"in e){var t=Uc(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=t(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n.concat(o,r(c,i[c]))}return o}}}}return qc(V)(e)}function zc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return zc(V).apply(void 0,e);var n=Uc(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=s-1;c>=0;c--){var l=u[c];a=i(l,o[l],a)}return a}}}var xx=function(e,t){var n;return n={},n[e]=t,n};function kx(e){var t=_d(V)(e);return function(n){return function(r){return t(r,n)}}}function Bm(e){var t=Hi(V)(e);return function(n){return function(r){return t(r,n)}}}function Kc(e){return bd(V)(e)}var cG=function(e){var t=Bm(e);return function(n){return function(r){return e.map(m(r,t(n)),Ao)}}},lG=function(e){var t=Bm(e);return function(n){return function(r){return e.map(m(r,t(n)),Fo)}}};function qm(e){return function(t){var n={},r={};for(var i in t)if(ct.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right;break}}return Ee(n,r)}}function zm(e){return function(t){var n={},r={};for(var i in t)if(ct.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Ee(n,r)}}function Km(e){return function(t){var n={};for(var r in t)if(ct.call(t,r)){var i=e(r,t[r]);gt(i)&&(n[r]=i.value)}return n}}function Vm(e){return function(t){var n={},r=!1;for(var i in t)if(ct.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function Ax(e,t){var n=y0(e,t);return function(r){return n(r,B)}}function y0(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),u=a[0],s=a[1];return i[u]=ct.call(i,u)?e.concat(i[u],s):s,i})}}var fG=m0,dG=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function Fx(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function Nx(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function b0(e){return function(t,n){if(n===void 0){var r=b0(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var _0=function(e){return function(t){return function(n){if(ci(n))return t;if(ci(t))return n;var r={};for(var i in n)ko(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)ko(i,r)||(r[i]=t[i]);return r}}},$0=function(e){return function(t){return function(n){if(ci(n)||ci(t))return yd;var r={};for(var i in n)ko(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},S0=function(e){return function(t){if(ci(t))return e;if(ci(e))return t;var n={};for(var r in t)ko(r,e)||(n[r]=t[r]);for(var r in e)ko(r,t)||(n[r]=e[r]);return n}},mr=function(e,t){return m(e,g0(t))},Ju=function(e,t){return m(e,Um(t))},vr=function(e){var t=$d(e);return function(n,r,i){return m(n,t(r,i))}},gr=function(e){return function(t){var n=Sd(e)(t);return function(r,i){return m(r,n(i))}}},yr=function(e){var t=Td(e);return function(n,r,i){return m(n,t(r,i))}},Zu=function(e,t){return m(e,T0(t))},Xu=function(e,t){return m(e,I0(t))},Qu=function(e,t){return m(e,O0(t))},es=function(e,t){return m(e,C0(t))},ts=function(e){var t=Bc(e);return function(n,r,i){return m(n,t(r,i))}},ns=function(e){var t=qc(e);return function(n){var r=t(n);return function(i,o){return m(i,r(o))}}},rs=function(e){var t=zc(e);return function(n,r,i){return m(n,t(r,i))}},Hm=function(e,t){return m(e,qm(t))},Gm=function(e,t){return m(e,zm(t))},Ym=function(e,t){return m(e,Km(t))},Jm=function(e,t){return m(e,Vm(t))},Hi=function(e){var t=_d(e);return function(n){var r=t(n);return function(i,o){return r(i,H(Yn,o))}}},bd=function(e){var t=Hi(e);return function(n){var r=t(n);return function(i){return r(i,B)}}},_d=function(e){return function(t){var n=Uc(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(yd);for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){var h;return Object.assign({},d,(h={},h[f]=p,h))}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},T0=function(e){return Vm(function(t,n){return e(n)})},I0=function(e){return Km(function(t,n){return e(n)})},O0=function(e){return zm(function(t,n){return e(n)})},C0=function(e){return qm(function(t,n){return e(n)})};function $d(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Bc(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return $d(V).apply(void 0,e)}function Sd(e){if("compare"in e){var t=qc(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return Sd(V)(e)}function Td(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=zc(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return Td(V).apply(void 0,e)}var Ao=function(e){var t={};for(var n in e)if(ct.call(e,n)){var r=e[n];gt(r)&&(t[n]=r.value)}return t},Fo=function(e){var t={},n={};for(var r in e)if(ct.call(e,r)){var i=e[r];Bt(i)?t[r]=i.left:n[r]=i.right}return Ee(t,n)},tn="ReadonlyRecord";function Zm(e){return"compare"in e?function(t){return{show:function(n){var r=Lm(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:Zm(V)(e)}function Px(e){var t=Dm(e);return Pr(function(n,r){return t(n)(r)&&t(r)(n)})}function Wx(e){return{concat:function(t,n){if(ci(t))return n;if(ci(n))return t;var r=Object.assign({},t);for(var i in n)ct.call(n,i)&&(r[i]=ct.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:yd}}var Lx={URI:tn,map:mr},pG=Ue(Lx),hG={URI:tn,map:mr,mapWithIndex:Ju},mG=function(e){return{URI:tn,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e)}},vG=function(e){return{URI:tn,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e),reduceWithIndex:ts(e),foldMapWithIndex:ns(e),reduceRightWithIndex:rs(e)}},Id={URI:tn,compact:Ao,separate:Fo},gG={URI:tn,map:mr,compact:Ao,separate:Fo,filter:Zu,filterMap:Xu,partition:Qu,partitionMap:es},yG={URI:tn,map:mr,mapWithIndex:Ju,compact:Ao,separate:Fo,filter:Zu,filterMap:Xu,partition:Qu,partitionMap:es,filterMapWithIndex:Ym,filterWithIndex:Jm,partitionMapWithIndex:Hm,partitionWithIndex:Gm},jx=function(e){return{URI:tn,map:mr,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e),traverse:Hi(e),sequence:bd(e)}},bG=function(e){return{URI:tn,map:mr,mapWithIndex:Ju,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e),reduceWithIndex:ts(e),foldMapWithIndex:ns(e),reduceRightWithIndex:rs(e),traverse:Hi(e),sequence:bd(e),traverseWithIndex:_d(e)}},_G=function(e){var t=jx(e);return{URI:tn,map:mr,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e),traverse:t.traverse,sequence:t.sequence,compact:Ao,separate:Fo,filter:Zu,filterMap:Xu,partition:Qu,partitionMap:es,wither:si(t,Id),wilt:ui(t,Id)}},Dx=function(e){var t=_0(e);return{concat:function(n,r){return t(r)(n)}}},$G=function(e){return{concat:Dx(e).concat,empty:yd}},SG=function(e){var t=$0(e);return{concat:function(n,r){return t(r)(n)}}},TG=function(){return{concat:function(e,t){return S0(t)(e)}}},IG={URI:tn,reduce:vr(V),foldMap:gr(V),reduceRight:yr(V)},OG={URI:tn,reduce:vr(V),foldMap:gr(V),reduceRight:yr(V),reduceWithIndex:ts(V),foldMapWithIndex:ns(V),reduceRightWithIndex:rs(V)},w0={URI:tn,map:mr,reduce:vr(V),foldMap:gr(V),reduceRight:yr(V),traverse:Hi(V),sequence:Kc},CG={URI:tn,map:mr,mapWithIndex:Ju,reduce:vr(V),foldMap:gr(V),reduceRight:yr(V),reduceWithIndex:ts(V),foldMapWithIndex:ns(V),reduceRightWithIndex:rs(V),traverse:Hi(V),sequence:Kc,traverseWithIndex:_d(V)},Ux=si(w0,Id),Bx=ui(w0,Id),wG={URI:tn,map:mr,reduce:vr(V),foldMap:gr(V),reduceRight:yr(V),traverse:Hi(V),sequence:Kc,compact:Ao,separate:Fo,filter:Zu,filterMap:Xu,partition:Qu,partitionMap:es,wither:Ux,wilt:Bx},E0=v0;function qx(e,t){return ct.call(t===void 0?this:t,e)}var EG={URI:tn,map:mr,reduce:vr(V),foldMap:gr(V),reduceRight:yr(V),traverse:Hi(V),sequence:Kc,compact:Ao,separate:Fo,filter:Zu,filterMap:Xu,partition:Qu,partitionMap:es,mapWithIndex:Ju,reduceWithIndex:ts(V),foldMapWithIndex:ns(V),reduceRightWithIndex:rs(V),filterMapWithIndex:Ym,filterWithIndex:Jm,partitionMapWithIndex:Hm,partitionWithIndex:Gm,traverseWithIndex:_d(V),wither:Ux,wilt:Bx};const RG=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Id,Filterable:gG,FilterableWithIndex:yG,Foldable:IG,FoldableWithIndex:OG,Functor:Lx,FunctorWithIndex:hG,Traversable:w0,TraversableWithIndex:CG,URI:tn,Witherable:wG,_filter:Zu,_filterMap:Xu,_filterMapWithIndex:Ym,_filterWithIndex:Jm,_foldMap:gr,_foldMapWithIndex:ns,_map:mr,_mapWithIndex:Ju,_partition:Qu,_partitionMap:es,_partitionMapWithIndex:Hm,_partitionWithIndex:Gm,_reduce:vr,_reduceRight:yr,_reduceRightWithIndex:rs,_reduceWithIndex:ts,_sequence:bd,_traverse:Hi,collect:Lm,compact:Ao,deleteAt:jm,difference:S0,elem:b0,empty:yd,every:Fx,filter:T0,filterMap:I0,filterMapWithIndex:Km,filterWithIndex:Vm,flap:pG,foldMap:Sd,foldMapWithIndex:qc,fromEntries:dG,fromFoldable:Ax,fromFoldableMap:y0,fromRecord:nG,getDifferenceMagma:TG,getEq:Px,getFoldable:mG,getFoldableWithIndex:vG,getIntersectionSemigroup:SG,getMonoid:Wx,getShow:Zm,getTraversable:jx,getTraversableWithIndex:bG,getUnionMonoid:$G,getUnionSemigroup:Dx,getWitherable:_G,has:ko,hasOwnProperty:qx,insertAt:E0,intersection:$0,isEmpty:ci,isSubrecord:Dm,keys:iG,lookup:Yu,map:g0,mapWithIndex:Um,modifyAt:uG,partition:O0,partitionMap:C0,partitionMapWithIndex:qm,partitionWithIndex:zm,pop:sG,readonlyRecord:EG,reduce:$d,reduceRight:Td,reduceRightWithIndex:zc,reduceWithIndex:Bc,separate:Fo,sequence:Kc,singleton:xx,size:Mx,some:Nx,toEntries:fG,toReadonlyArray:m0,toRecord:rG,toUnfoldable:oG,traverse:Bm,traverseWithIndex:kx,union:_0,updateAt:aG,upsertAt:v0,wilt:lG,wither:cG},Symbol.toStringTag,{value:"Module"})),R0=j.createContext(void 0);function Od(){const e=j.useContext(R0);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}var Qe={},G={},MG={get exports(){return G},set exports(e){G=e}};(function(e){var t,n,r,i,o,a,u,s,c,l,f,d,p,h,v,g,b,S,O,y,C,I,M,R,U,q,N,Z,ee;(function(J){var ve=typeof de=="object"?de:typeof self=="object"?self:typeof this=="object"?this:{};J(Ie(ve,Ie(e.exports)));function Ie(k,A){return k!==ve&&(typeof Object.create=="function"?Object.defineProperty(k,"__esModule",{value:!0}):k.__esModule=!0),function(T,$){return k[T]=A?A(T,$):$}}})(function(J){var ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,A){k.__proto__=A}||function(k,A){for(var T in A)Object.prototype.hasOwnProperty.call(A,T)&&(k[T]=A[T])};t=function(k,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");ve(k,A);function T(){this.constructor=k}k.prototype=A===null?Object.create(A):(T.prototype=A.prototype,new T)},n=Object.assign||function(k){for(var A,T=1,$=arguments.length;T<$;T++){A=arguments[T];for(var x in A)Object.prototype.hasOwnProperty.call(A,x)&&(k[x]=A[x])}return k},r=function(k,A){var T={};for(var $ in k)Object.prototype.hasOwnProperty.call(k,$)&&A.indexOf($)<0&&(T[$]=k[$]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,$=Object.getOwnPropertySymbols(k);x<$.length;x++)A.indexOf($[x])<0&&Object.prototype.propertyIsEnumerable.call(k,$[x])&&(T[$[x]]=k[$[x]]);return T},i=function(k,A,T,$){var x=arguments.length,L=x<3?A:$===null?$=Object.getOwnPropertyDescriptor(A,T):$,X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(k,A,T,$);else for(var ne=k.length-1;ne>=0;ne--)(X=k[ne])&&(L=(x<3?X(L):x>3?X(A,T,L):X(A,T))||L);return x>3&&L&&Object.defineProperty(A,T,L),L},o=function(k,A){return function(T,$){A(T,$,k)}},a=function(k,A,T,$,x,L){function X(dr){if(dr!==void 0&&typeof dr!="function")throw new TypeError("Function expected");return dr}for(var ne=$.kind,xe=ne==="getter"?"get":ne==="setter"?"set":"value",se=!A&&k?$.static?k:k.prototype:null,Ae=A||(se?Object.getOwnPropertyDescriptor(se,$.name):{}),ze,He=!1,ut=T.length-1;ut>=0;ut--){var Ut={};for(var Qt in $)Ut[Qt]=Qt==="access"?{}:$[Qt];for(var Qt in $.access)Ut.access[Qt]=$.access[Qt];Ut.addInitializer=function(dr){if(He)throw new TypeError("Cannot add initializers after decoration has completed");L.push(X(dr||null))};var gn=(0,T[ut])(ne==="accessor"?{get:Ae.get,set:Ae.set}:Ae[xe],Ut);if(ne==="accessor"){if(gn===void 0)continue;if(gn===null||typeof gn!="object")throw new TypeError("Object expected");(ze=X(gn.get))&&(Ae.get=ze),(ze=X(gn.set))&&(Ae.set=ze),(ze=X(gn.init))&&x.push(ze)}else(ze=X(gn))&&(ne==="field"?x.push(ze):Ae[xe]=ze)}se&&Object.defineProperty(se,$.name,Ae),He=!0},u=function(k,A,T){for(var $=arguments.length>2,x=0;x<A.length;x++)T=$?A[x].call(k,T):A[x].call(k);return $?T:void 0},s=function(k){return typeof k=="symbol"?k:"".concat(k)},c=function(k,A,T){return typeof A=="symbol"&&(A=A.description?"[".concat(A.description,"]"):""),Object.defineProperty(k,"name",{configurable:!0,value:T?"".concat(T," ",A):A})},l=function(k,A){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(k,A)},f=function(k,A,T,$){function x(L){return L instanceof T?L:new T(function(X){X(L)})}return new(T||(T=Promise))(function(L,X){function ne(Ae){try{se($.next(Ae))}catch(ze){X(ze)}}function xe(Ae){try{se($.throw(Ae))}catch(ze){X(ze)}}function se(Ae){Ae.done?L(Ae.value):x(Ae.value).then(ne,xe)}se(($=$.apply(k,A||[])).next())})},d=function(k,A){var T={label:0,sent:function(){if(L[0]&1)throw L[1];return L[1]},trys:[],ops:[]},$,x,L,X;return X={next:ne(0),throw:ne(1),return:ne(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function ne(se){return function(Ae){return xe([se,Ae])}}function xe(se){if($)throw new TypeError("Generator is already executing.");for(;X&&(X=0,se[0]&&(T=0)),T;)try{if($=1,x&&(L=se[0]&2?x.return:se[0]?x.throw||((L=x.return)&&L.call(x),0):x.next)&&!(L=L.call(x,se[1])).done)return L;switch(x=0,L&&(se=[se[0]&2,L.value]),se[0]){case 0:case 1:L=se;break;case 4:return T.label++,{value:se[1],done:!1};case 5:T.label++,x=se[1],se=[0];continue;case 7:se=T.ops.pop(),T.trys.pop();continue;default:if(L=T.trys,!(L=L.length>0&&L[L.length-1])&&(se[0]===6||se[0]===2)){T=0;continue}if(se[0]===3&&(!L||se[1]>L[0]&&se[1]<L[3])){T.label=se[1];break}if(se[0]===6&&T.label<L[1]){T.label=L[1],L=se;break}if(L&&T.label<L[2]){T.label=L[2],T.ops.push(se);break}L[2]&&T.ops.pop(),T.trys.pop();continue}se=A.call(k,T)}catch(Ae){se=[6,Ae],x=0}finally{$=L=0}if(se[0]&5)throw se[1];return{value:se[0]?se[1]:void 0,done:!0}}},p=function(k,A){for(var T in k)T!=="default"&&!Object.prototype.hasOwnProperty.call(A,T)&&ee(A,k,T)},ee=Object.create?function(k,A,T,$){$===void 0&&($=T);var x=Object.getOwnPropertyDescriptor(A,T);(!x||("get"in x?!A.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return A[T]}}),Object.defineProperty(k,$,x)}:function(k,A,T,$){$===void 0&&($=T),k[$]=A[T]},h=function(k){var A=typeof Symbol=="function"&&Symbol.iterator,T=A&&k[A],$=0;if(T)return T.call(k);if(k&&typeof k.length=="number")return{next:function(){return k&&$>=k.length&&(k=void 0),{value:k&&k[$++],done:!k}}};throw new TypeError(A?"Object is not iterable.":"Symbol.iterator is not defined.")},v=function(k,A){var T=typeof Symbol=="function"&&k[Symbol.iterator];if(!T)return k;var $=T.call(k),x,L=[],X;try{for(;(A===void 0||A-- >0)&&!(x=$.next()).done;)L.push(x.value)}catch(ne){X={error:ne}}finally{try{x&&!x.done&&(T=$.return)&&T.call($)}finally{if(X)throw X.error}}return L},g=function(){for(var k=[],A=0;A<arguments.length;A++)k=k.concat(v(arguments[A]));return k},b=function(){for(var k=0,A=0,T=arguments.length;A<T;A++)k+=arguments[A].length;for(var $=Array(k),x=0,A=0;A<T;A++)for(var L=arguments[A],X=0,ne=L.length;X<ne;X++,x++)$[x]=L[X];return $},S=function(k,A,T){if(T||arguments.length===2)for(var $=0,x=A.length,L;$<x;$++)(L||!($ in A))&&(L||(L=Array.prototype.slice.call(A,0,$)),L[$]=A[$]);return k.concat(L||Array.prototype.slice.call(A))},O=function(k){return this instanceof O?(this.v=k,this):new O(k)},y=function(k,A,T){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var $=T.apply(k,A||[]),x,L=[];return x={},X("next"),X("throw"),X("return"),x[Symbol.asyncIterator]=function(){return this},x;function X(He){$[He]&&(x[He]=function(ut){return new Promise(function(Ut,Qt){L.push([He,ut,Ut,Qt])>1||ne(He,ut)})})}function ne(He,ut){try{xe($[He](ut))}catch(Ut){ze(L[0][3],Ut)}}function xe(He){He.value instanceof O?Promise.resolve(He.value.v).then(se,Ae):ze(L[0][2],He)}function se(He){ne("next",He)}function Ae(He){ne("throw",He)}function ze(He,ut){He(ut),L.shift(),L.length&&ne(L[0][0],L[0][1])}},C=function(k){var A,T;return A={},$("next"),$("throw",function(x){throw x}),$("return"),A[Symbol.iterator]=function(){return this},A;function $(x,L){A[x]=k[x]?function(X){return(T=!T)?{value:O(k[x](X)),done:!1}:L?L(X):X}:L}},I=function(k){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var A=k[Symbol.asyncIterator],T;return A?A.call(k):(k=typeof h=="function"?h(k):k[Symbol.iterator](),T={},$("next"),$("throw"),$("return"),T[Symbol.asyncIterator]=function(){return this},T);function $(L){T[L]=k[L]&&function(X){return new Promise(function(ne,xe){X=k[L](X),x(ne,xe,X.done,X.value)})}}function x(L,X,ne,xe){Promise.resolve(xe).then(function(se){L({value:se,done:ne})},X)}},M=function(k,A){return Object.defineProperty?Object.defineProperty(k,"raw",{value:A}):k.raw=A,k};var Ie=Object.create?function(k,A){Object.defineProperty(k,"default",{enumerable:!0,value:A})}:function(k,A){k.default=A};R=function(k){if(k&&k.__esModule)return k;var A={};if(k!=null)for(var T in k)T!=="default"&&Object.prototype.hasOwnProperty.call(k,T)&&ee(A,k,T);return Ie(A,k),A},U=function(k){return k&&k.__esModule?k:{default:k}},q=function(k,A,T,$){if(T==="a"&&!$)throw new TypeError("Private accessor was defined without a getter");if(typeof A=="function"?k!==A||!$:!A.has(k))throw new TypeError("Cannot read private member from an object whose class did not declare it");return T==="m"?$:T==="a"?$.call(k):$?$.value:A.get(k)},N=function(k,A,T,$,x){if($==="m")throw new TypeError("Private method is not writable");if($==="a"&&!x)throw new TypeError("Private accessor was defined without a setter");if(typeof A=="function"?k!==A||!x:!A.has(k))throw new TypeError("Cannot write private member to an object whose class did not declare it");return $==="a"?x.call(k,T):x?x.value=T:A.set(k,T),T},Z=function(k,A){if(A===null||typeof A!="object"&&typeof A!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof k=="function"?A===k:k.has(A)},J("__extends",t),J("__assign",n),J("__rest",r),J("__decorate",i),J("__param",o),J("__esDecorate",a),J("__runInitializers",u),J("__propKey",s),J("__setFunctionName",c),J("__metadata",l),J("__awaiter",f),J("__generator",d),J("__exportStar",p),J("__createBinding",ee),J("__values",h),J("__read",v),J("__spread",g),J("__spreadArrays",b),J("__spreadArray",S),J("__await",O),J("__asyncGenerator",y),J("__asyncDelegator",C),J("__asyncValues",I),J("__makeTemplateObject",M),J("__importStar",R),J("__importDefault",U),J("__classPrivateFieldGet",q),J("__classPrivateFieldSet",N),J("__classPrivateFieldIn",Z)})})(MG);var Vc={};function zx(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const xG=Object.freeze(Object.defineProperty({__proto__:null,altAll:zx},Symbol.toStringTag,{value:"Module"}));function kG(e){return zx(e)(e.zero())}const AG=Object.freeze(Object.defineProperty({__proto__:null,altAll:kG},Symbol.toStringTag,{value:"Module"}));function Wr(e){var t=zt(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Kx(e,t){var n=Wc(e,t).map,r=xo(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return m(i,r(o))}}}const FG=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:Kx,getApplicativeMonoid:Wr},Symbol.toStringTag,{value:"Module"}));function Gi(e){return function(t){return function(n){return e.fromEither(At(n)?Mo(t()):Da(n.value))}}}function qa(e){return function(t,n){return function(r){return e.fromEither(t(r)?Da(r):Mo(n(r)))}}}function Yi(e){var t=Gi(e);return function(n){var r=t(n);return function(i){return H(i,r)}}}function is(e,t){var n=Yi(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function br(e){return function(t){return H(t,e.fromEither)}}function No(e,t){var n=br(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Po(e,t){return H(br(e),lt(t))}function as(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Da(o):Mo(r(o)))})}}}const NG=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:No,chainFirstEitherK:Po,chainOptionK:is,filterOrElse:as,fromEitherK:br,fromOption:Gi,fromOptionK:Yi,fromPredicate:qa},Symbol.toStringTag,{value:"Module"}));var Cd=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Wo=function(e){return e.length>0},Xm=function(e,t){return e<0||e>=t.length},M0=function(e){return function(t){return Cd([e],t,!0)}},Hc=M0,x0=function(e){return function(t){return Cd(Cd([],t,!0),[e],!1)}},wd=x0,k0=function(e,t,n){if(Wo(n)){var r=Ed(n);return r.splice(e,0,t),r}return[t]},A0=function(e,t,n){var r=Ed(n);return r[e]=t,r},F0=function(e){return function(t){if(t.length===1)return Gc(t);for(var n=[Lr(t)],r=fi(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},Vx=function(e){if(Wo(e)){var t=N_();return L0(e.reduce(t.concat,t.empty))}return Gc},N0=function(e){var t=F0(e);return function(n){return function(r){return t(m(r,ev(n)))}}},P0=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Xm(Math.abs(r),t)||r===0)return Gc(t);if(r<0){var i=nv(-r)(t),o=i[0],a=i[1];return m(a,ev(o))}else return P0(r-n)(t)}},Ed=hm,W0=function(e){return Wo(e)?fe(e):ge},Qm=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},PG=function(e){return Qm(function(){return e})},Hx=function(e,t){return e<=t?Qm(function(n){return e+n})(t-e+1):[e]},Gx=function(e){return[Lr(e),fi(e)]},Yx=function(e){return[Jc(e),Yc(e)]};function Jx(e){return function(t){return t.concat(e)}}function ev(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var WG=function(e){return Cd([Yc(e)],e.slice(0,-1).reverse(),!0)};function Zx(e){return function(t){var n=t.length;if(n===0)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var LG=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ct.call(n,a)?n[a].push(o):n[a]=[o]}return n}},L0=function(e){return function(t){return t.slice().sort(e.compare)}},jG=function(e,t){return function(n){return e<0||e>n.length?ge:fe(k0(e,t,n))}},DG=function(e,t){return Xx(e,function(){return t})},Xx=function(e,t){return function(n){return Xm(e,n)?ge:fe(A0(e,t(n[e]),n))}},Gc=Ed,za=function(e){return[e]},Qx=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function ek(e,t){return t===void 0?function(n){return ek(n,e)}:Qx(e,t,function(n,r){return[n,r]})}var UG=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},tv=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},tk=function(e){return function(t){var n=fi(t);return Wo(n)?m(n,tv(e),Hc(Lr(t))):Gc(t)}},nk=l0,rk=s0,ik=function(e){return function(t){for(var n=Ed(e(0,Lr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},j0=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Wo(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},nv=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[Gc(t),[]]:[m(t.slice(1,n),Hc(Lr(t))),t.slice(n)]}},ok=function(e){return j0(nv(e))},li=function(e,t){return m(e,H0(t))},D0=function(e,t){return m(e,G0(t))},Rd=function(e,t){return m(e,fk(t))},U0=function(e,t){return m(e,rv(t))},ak=function(e,t){return m(e,V0(t))},Md=function(e,t,n){return m(e,dk(t,n))},xd=function(e){var t=rk(e);return function(n,r){return m(n,t(r))}},kd=function(e,t,n){return m(e,hk(t,n))},B0=function(e){var t=vk(e);return function(n,r){return m(n,t(r))}},uk=function(e,t){return m(e,lk(t))},q0=function(e,t,n){return m(e,pk(t,n))},z0=function(e){var t=nk(e);return function(n,r){return m(n,t(r))}},K0=function(e,t,n){return m(e,mk(t,n))},sk=function(e){var t=ov(e);return function(n,r){return m(n,t(r))}},ck=function(e){return function(t){return m(t,Jx(e()))}},lk=ck,fk=function(e){return rv(function(t){return m(e,H0(t))})},rv=function(e){return ik(function(t,n){return e(n)})},V0=function(e){return function(t){for(var n=fi(t),r=[e(t)];Wo(n);)r.push(e(n)),n=fi(n);return r}},BG=V0(B),qG=rv(B),H0=function(e){return G0(function(t,n){return e(n)})},G0=function(e){return function(t){for(var n=[e(0,Lr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},dk=u0,pk=xm,hk=c0,mk=km,vk=function(e){var t=ov(e);return function(n){return t(function(r,i){return n(i)})}},iv=function(e){return ov(e)(function(t,n){return n})},ov=function(e){return function(t){return function(n){for(var r=e.map(t(0,Lr(n)),za),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return m(o,wd(a))}}),t(i,n[i]));return r}}},Y0=xn,kn="NonEmptyArray",zG=yx,KG=function(){return{concat:ev}},VG=bx,HG=function(e){var t=N0(e);return{concat:function(n,r){return t(r)(n)}}},J0={URI:kn,map:li},GG=Ue(J0),YG={URI:kn,of:za},JG={URI:kn,map:li,mapWithIndex:D0},av={URI:kn,map:li,ap:Rd},ZG=It(av),XG=Ot(av),QG={URI:kn,map:li,ap:Rd,of:za},Z0={URI:kn,map:li,ap:Rd,chain:U0},eY=lt(Z0),tY={URI:kn,map:li,ap:Rd,of:za,chain:U0},nY={URI:kn,reduce:Md,foldMap:xd,reduceRight:kd},rY={URI:kn,reduce:Md,foldMap:xd,reduceRight:kd,reduceWithIndex:q0,foldMapWithIndex:z0,reduceRightWithIndex:K0},iY={URI:kn,map:li,reduce:Md,foldMap:xd,reduceRight:kd,traverse:B0,sequence:iv},oY={URI:kn,map:li,mapWithIndex:D0,reduce:Md,foldMap:xd,reduceRight:kd,traverse:B0,sequence:iv,reduceWithIndex:q0,foldMapWithIndex:z0,reduceRightWithIndex:K0,traverseWithIndex:sk},aY={URI:kn,map:li,alt:uk},uY={URI:kn,map:li,extend:ak,extract:Y0},sY=za(qt),cY=Tt(J0),lY=wt(Z0),fY=Ct(av),Lr=xn,fi=function(e){return e.slice(1)},Yc=Ba,Jc=function(e){return e.slice(0,-1)},dY=_x,pY=$x,hY=function(e){return function(t){return t.reduce(e.concat)}},mY=function(e){return function(t){return e(Lr(t),fi(t))}},vY=function(e){return function(t){return e(Jc(t),Yc(t))}},gk=function(e){return function(t){return Cd([e(Lr(t))],fi(t),!0)}},gY=function(e){return gk(function(){return e})},yk=function(e){return function(t){return m(Jc(t),wd(e(Yc(t))))}},yY=function(e){return yk(function(){return e})},bY=p0;function _Y(e){var t=L0(e),n=Zx(e);return function(r){return Wo(r)?n(t(r)):[]}}function $Y(e){return bk(function(t,n){return e(n)})}var bk=function(e){return function(t){return W0(t.filter(function(n,r){return e(r,n)}))}},SY=Gx,TY=Yx;function _k(e,t){return t===void 0?Hc(e):m(t,Hc(e))}var $k=function(e,t){return m(e,wd(t))},IY=tv,OY=Wm,CY={URI:kn,of:za,map:li,mapWithIndex:D0,ap:Rd,chain:U0,extend:ak,extract:Y0,reduce:Md,foldMap:xd,reduceRight:kd,traverse:B0,sequence:iv,reduceWithIndex:q0,foldMapWithIndex:z0,reduceRightWithIndex:K0,traverseWithIndex:sk,alt:uk};const wY=Object.freeze(Object.defineProperty({__proto__:null,Alt:aY,Applicative:QG,Apply:av,Chain:Z0,Comonad:uY,Do:sY,Foldable:nY,FoldableWithIndex:rY,Functor:J0,FunctorWithIndex:JG,Monad:tY,Pointed:YG,Traversable:iY,TraversableWithIndex:oY,URI:kn,alt:lk,altW:ck,ap:fk,apFirst:ZG,apS:fY,apSecond:XG,append:wd,appendW:x0,bind:lY,bindTo:cY,chain:rv,chainFirst:eY,chainWithIndex:ik,chop:j0,chunksOf:ok,concat:ev,concatAll:hY,concatW:Jx,cons:_k,copy:Gc,duplicate:BG,extend:V0,extract:Y0,filter:$Y,filterWithIndex:bk,flap:GG,flatten:qG,fold:OY,foldMap:rk,foldMapWithIndex:nk,fromArray:W0,fromReadonlyNonEmptyArray:Ed,getEq:VG,getSemigroup:KG,getShow:zG,getUnionSemigroup:HG,group:Zx,groupBy:LG,groupSort:_Y,head:Lr,init:Jc,insertAt:jG,intercalate:bY,intersperse:tk,isNonEmpty:Wo,isOutOfBound:Xm,last:Yc,makeBy:Qm,map:H0,mapWithIndex:G0,matchLeft:mY,matchRight:vY,max:pY,min:dY,modifyAt:Xx,modifyHead:gk,modifyLast:yk,nonEmptyArray:CY,of:za,prepend:Hc,prependAll:tv,prependToAll:IY,prependW:M0,range:Hx,reduce:dk,reduceRight:hk,reduceRightWithIndex:mk,reduceWithIndex:pk,replicate:PG,reverse:WG,rotate:P0,sequence:iv,snoc:$k,sort:L0,sortBy:Vx,splitAt:nv,tail:fi,traverse:vk,traverseWithIndex:ov,unappend:Yx,uncons:SY,union:N0,uniq:F0,unprepend:Gx,unsafeInsertAt:k0,unsafeUpdateAt:A0,unsnoc:TY,unzip:UG,updateAt:DG,updateHead:gY,updateLast:yY,zip:ek,zipWith:Qx},Symbol.toStringTag,{value:"Module"}));var EY=function(e){return typeof e=="number"},X0={equals:function(e,t){return e===t}},uv={equals:X0.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},RY={equals:X0.equals,compare:uv.compare,top:1/0,bottom:-1/0},MY={show:function(e){return JSON.stringify(e)}},Sk={concat:function(e,t){return e-t}},Q0={concat:function(e,t){return e+t}},e$={concat:function(e,t){return e*t}},xY={concat:Q0.concat,empty:0},kY={concat:e$.concat,empty:1},AY={add:Q0.concat,zero:0,mul:e$.concat,one:1,sub:Sk.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const FY=Object.freeze(Object.defineProperty({__proto__:null,Bounded:RY,Eq:X0,Field:AY,MagmaSub:Sk,MonoidProduct:kY,MonoidSum:xY,Ord:uv,SemigroupProduct:e$,SemigroupSum:Q0,Show:MY,isNumber:EY},Symbol.toStringTag,{value:"Module"}));function Zc(e,t){return function(n){return n?t.of(void 0):e.zero()}}const NY=Object.freeze(Object.defineProperty({__proto__:null,guard:Zc},Symbol.toStringTag,{value:"Module"}));var PY=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Ji=function(e){return e.length===0},Et=Vi,WY=jc,LY=q_,sv=Om,jY=z_,Tk=function(e,t){return e<=0?_t:wm(t)(e)},DY=function(e,t){return Tk(e,function(){return t})};function UY(e){return function(t){return e(t)?[t]:_t}}var Ik=function(e){return At(e)?_t:[e.value]},Ok=function(e){return Bt(e)?_t:[e.right]},Ck=function(e,t){return function(n){return Et(n)?t(n):e()}},wk=Ck,Ek=function(e,t){return function(n){return Et(n)?t(xn(n),ai(n)):e()}},Rk=Ek,BY=Rk,Mk=function(e,t){return function(n){return Et(n)?t(Dc(n),Ba(n)):e()}},xk=Mk,qY=xk,kk=function(e){return function(t){if(Ji(t))return _t;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},zY=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},KY=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},VY=function(e){return e.length},Xc=Im;function us(e,t){return t===void 0?function(n){return us(e,n)}:Xc(e,t)?ge:fe(t[e])}var Ak=function(e){return Et(e)?fe(xn(e)):ge},t$=function(e){return Et(e)?fe(Ba(e)):ge},HY=function(e){return Et(e)?fe(ai(e)):ge},GY=function(e){return Et(e)?fe(Dc(e)):ge},YY=function(e){return function(t){return Xc(e,t)?t:e===0?_t:t.slice(0,e)}},JY=function(e){return function(t){return Xc(e,t)?t:e===0?_t:t.slice(-e)}};function ZY(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}var a=n.length;return a===t.length?t:a===0?_t:n}}var Fk=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function XY(e){return function(t){var n=n$(Fk(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var QY=function(e){return function(t){return e<=0||Ji(t)?t:e>=t.length?_t:t.slice(e,t.length)}},eJ=function(e){return function(t){return e<=0||Ji(t)?t:e>=t.length?_t:t.slice(0,t.length-e)}};function tJ(e){return function(t){var n=Fk(t,e);return n===0?t:n===t.length?_t:t.slice(n)}}var cv=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return fe(n);return ge}};function lv(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return fe(t[n]);return ge}}var Nk=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(gt(r))return r}return ge}};function Pk(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return fe(t[n]);return ge}}var Wk=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(gt(r))return r}return ge}},Lk=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return fe(n);return ge}},nJ=function(e,t){return function(n){return e<0||e>n.length?ge:fe(Cm(e,t,n))}},rJ=function(e,t){return jk(e,function(){return t})},iJ=function(e){return function(t){return Xc(e,t)?ge:fe(pA(e,t))}},jk=function(e,t){return function(n){return Xc(e,n)?ge:fe(Sv(e,t(n[e]),n))}},oJ=function(e){return e.length<=1?e:e.slice().reverse()},aJ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},uJ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},sJ=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},Dk=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function Uk(e,t){return t===void 0?function(n){return Uk(n,e)}:Dk(e,t,function(n,r){return[n,r]})}var cJ=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Bk=function(e){var t=Em(e);return function(n){return Et(n)?t(n):n}},lJ=function(e){var t=J_(e);return function(n){return Et(n)?t(n):n}},fJ=function(e){var t=G_(e);return function(n){return Et(n)?t(n):n}};function Ad(e){return function(t,n){if(n===void 0){var r=Ad(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var dJ=function(e){var t=V_(e);return function(n){return Et(n)?t(n):n}},pJ=function(e){var t=ex(e);return function(n){return Et(n)?t(n):n}},hJ=function(e){var t=Z_(e);return function(n){return Et(n)?t(n):_t}},n$=function(e){return function(t){return e>=1&&Et(t)?Rm(e)(t):Ji(t)?[t,_t]:[_t,t]}},mJ=function(e){var t=lx(e);return function(n){return Et(n)?t(n):_t}},vJ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Ik(e.apply(void 0,t))}};function gJ(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Et(o)?m(xn(o),Nd(function(a){return r(m(i,sv(a)),ai(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:_t};return r(_t,e)}var qk=function(e){return function(t){return Ji(t)?e:Ji(e)?t:t.concat(e)}},yJ=qk;function r$(e){var t=H_(e);return function(n,r){if(r===void 0){var i=r$(e);return function(o){return i(o,n)}}return Et(n)&&Et(r)?t(r)(n):Et(n)?n:r}}function i$(e){var t=Ad(e);return function(n,r){if(r===void 0){var i=i$(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function o$(e){var t=Ad(e);return function(n,r){if(r===void 0){var i=o$(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var nn=function(e,t){return m(e,gv(t))},fv=function(e,t){return m(e,Qk(t))},Ka=function(e,t){return m(e,Xk(t))},Fd=function(e,t){return m(e,Nd(t))},dv=function(e,t){return m(e,di(t))},pv=function(e,t){return m(e,h$(t))},hv=function(e,t){return m(e,eA(t))},mv=function(e,t){return m(e,tA(t))},zk=function(e,t){return m(e,m$(t))},Kk=function(e,t){return m(e,v$(t))},a$=function(e,t){return m(e,Zk(t))},ss=function(e,t,n){return m(e,bv(t,n))},Qc=function(e){var t=y$(e);return function(n,r){return m(n,t(r))}},el=function(e,t,n){return m(e,b$(t,n))},u$=function(e,t,n){return m(e,Pd(t,n))},s$=function(e){var t=yv(e);return function(n,r){return m(n,t(r))}},c$=function(e,t,n){return m(e,_v(t,n))},Vk=function(e,t){return m(e,p$(t))},Hk=function(e,t){return m(e,nA(t))},Gk=function(e,t){return m(e,g$(t))},vv=function(e){var t=rA(e);return function(n,r){return m(n,t(r))}},Yk=function(e){var t=_$(e);return function(n,r){return m(n,t(r))}},l$=function(e,t){return m(e,C$(t))},f$=function(e,t){return m(e,w$(t))},cs=Ua,tl=function(){return _t},Jk=function(e){return function(t){return t.concat(e())}},Zk=Jk,Xk=function(e){return Nd(function(t){return m(e,gv(t))})},Nd=function(e){return function(t){return m(t,kk(function(n,r){return e(r)}))}},d$=Nd(B),gv=function(e){return function(t){return t.map(function(n){return e(n)})}},Qk=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},nl=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Ee(t,n)},di=function(e){return function(t){return t.filter(e)}},p$=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);gt(i)&&n.push(i.value)}return n}},h$=function(e){return p$(function(t,n){return e(n)})},rl=h$(B),eA=function(e){return m$(function(t,n){return e(n)})},m$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Ee(n,r)}},tA=function(e){return v$(function(t,n){return e(n)})},v$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Ee(n,r)}},nA=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},g$=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},bJ=g$(B),yv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},bv=function(e,t){return Pd(e,function(n,r,i){return t(r,i)})},y$=function(e){var t=yv(e);return function(n){return t(function(r,i){return n(i)})}},Pd=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},b$=function(e,t){return _v(e,function(n,r,i){return t(r,i)})},_v=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},rA=function(e){var t=_$(e);return function(n){return t(function(r,i){return n(i)})}},Wd=function(e){return function(t){return ss(t,e.of(tl()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return m(i,sv(o))}}),r)})}},_$=function(e){return function(t){return Pd(e.of(tl()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return m(o,sv(a))}}),t(n,i))})}},_J=function(e){var t=E$(e);return function(n){return function(r){return t(r,n)}}},$J=function(e){var t=R$(e);return function(n){return function(r){return t(r,n)}}},$$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(gt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},ft="ReadonlyArray",iA=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},oA=function(){return{concat:function(e,t){return Ji(e)?t:Ji(t)?e:e.concat(t)}}},SJ=function(){return{concat:oA().concat,empty:_t}},aA=function(e){return Pr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},uA=function(e){return Gu(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var u=e.compare(t[a],n[a]);if(u!==0)return u}return uv.compare(r,i)})},sA=function(e){var t=r$(e);return{concat:function(n,r){return t(r)(n)}}},TJ=function(e){return{concat:sA(e).concat,empty:_t}},IJ=function(e){var t=i$(e);return{concat:function(n,r){return t(r)(n)}}},OJ=function(e){var t=o$(e);return{concat:function(n,r){return t(r)(n)}}},S$={URI:ft,map:nn},CJ=Ue(S$),cA={URI:ft,of:cs},wJ={URI:ft,map:nn,mapWithIndex:fv},$v={URI:ft,map:nn,ap:Ka},EJ=It($v),RJ=Ot($v),MJ={URI:ft,map:nn,ap:Ka,of:cs},T$={URI:ft,map:nn,ap:Ka,chain:Fd},xJ={URI:ft,map:nn,ap:Ka,of:cs,chain:Fd},kJ=lt(T$),AJ={URI:ft,unfold:$$},FJ={URI:ft,map:nn,alt:a$},lA={URI:ft,zero:tl},NJ=Zc(lA,cA),PJ={URI:ft,map:nn,ap:Ka,of:cs,alt:a$,zero:tl},WJ={URI:ft,map:nn,extend:Gk},I$={URI:ft,compact:rl,separate:nl},LJ={URI:ft,map:nn,compact:rl,separate:nl,filter:dv,filterMap:pv,partition:hv,partitionMap:mv},jJ={URI:ft,map:nn,mapWithIndex:fv,compact:rl,separate:nl,filter:dv,filterMap:pv,partition:hv,partitionMap:mv,partitionMapWithIndex:Kk,partitionWithIndex:zk,filterMapWithIndex:Vk,filterWithIndex:Hk},DJ={URI:ft,reduce:ss,foldMap:Qc,reduceRight:el},UJ={URI:ft,reduce:ss,foldMap:Qc,reduceRight:el,reduceWithIndex:u$,foldMapWithIndex:s$,reduceRightWithIndex:c$},O$={URI:ft,map:nn,reduce:ss,foldMap:Qc,reduceRight:el,traverse:vv,sequence:Wd},BJ={URI:ft,map:nn,mapWithIndex:fv,reduce:ss,foldMap:Qc,reduceRight:el,reduceWithIndex:u$,foldMapWithIndex:s$,reduceRightWithIndex:c$,traverse:vv,sequence:Wd,traverseWithIndex:Yk},C$=function(e){return function(t){for(var n=PY([],e(t),!0),r=[];n.length>0;){var i=n.shift();Bt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},qJ={URI:ft,map:nn,ap:Ka,chain:Fd,chainRec:l$},w$=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Bt(c)?e(c.left).forEach(function(l){return r.push(l)}):i.push(c.right)}for(var a=0,u=n;a<u.length;a++){var s=u[a];o(s)}for(;r.length>0;)o(r.shift());return i}},zJ={URI:ft,map:nn,ap:Ka,chain:Fd,chainRec:f$},E$=si(O$,I$),R$=ui(O$,I$),fA={URI:ft,map:nn,compact:rl,separate:nl,filter:dv,filterMap:pv,partition:hv,partitionMap:mv,reduce:ss,foldMap:Qc,reduceRight:el,traverse:vv,sequence:Wd,wither:E$,wilt:R$},KJ=h0(fA),dA={URI:ft,fromEither:Ok},VJ=br(dA),HJ=Cm,Sv=function(e,t,n){return Et(n)?K_(e,t,n):n},pA=function(e,t){var n=t.slice();return n.splice(e,1),n},GJ=function(e){return e.slice()},YJ=function(e){return Ji(e)?_t:e.slice()},_t=fd;function hA(e){return function(t){return t.every(e)}}var mA=function(e){return function(t){return t.some(e)}},JJ=mA,vA=function(e){var t=p0(e);return function(n){return wk(function(){return e.empty},t(n))}},ZJ=cs(qt),XJ=Tt(S$),QJ=wt(T$),e7=Ct($v),t7=tx,n7=Ox,r7=Cx,i7=Bk,o7={URI:ft,compact:rl,separate:nl,map:nn,ap:Ka,of:cs,chain:Fd,filter:dv,filterMap:pv,partition:hv,partitionMap:mv,mapWithIndex:fv,partitionMapWithIndex:Kk,partitionWithIndex:zk,filterMapWithIndex:Vk,filterWithIndex:Hk,alt:a$,zero:tl,unfold:$$,reduce:ss,foldMap:Qc,reduceRight:el,traverse:vv,sequence:Wd,reduceWithIndex:u$,foldMapWithIndex:s$,reduceRightWithIndex:c$,traverseWithIndex:Yk,extend:Gk,wither:E$,wilt:R$};const a7=Object.freeze(Object.defineProperty({__proto__:null,Alt:FJ,Alternative:PJ,Applicative:MJ,Apply:$v,Chain:T$,ChainRecBreadthFirst:zJ,ChainRecDepthFirst:qJ,Compactable:I$,Do:ZJ,Extend:WJ,Filterable:LJ,FilterableWithIndex:jJ,Foldable:DJ,FoldableWithIndex:UJ,FromEither:dA,Functor:S$,FunctorWithIndex:wJ,Monad:xJ,Pointed:cA,Traversable:O$,TraversableWithIndex:BJ,URI:ft,Unfoldable:AJ,Witherable:fA,Zero:lA,_chainRecBreadthFirst:f$,_chainRecDepthFirst:l$,alt:Zk,altW:Jk,ap:Xk,apFirst:EJ,apS:e7,apSecond:RJ,append:sv,appendW:jY,bind:QJ,bindTo:XJ,chain:Nd,chainFirst:kJ,chainRecBreadthFirst:w$,chainRecDepthFirst:C$,chainWithIndex:kk,chop:hJ,chunksOf:mJ,compact:rl,comprehension:gJ,concat:yJ,concatW:qk,cons:n7,deleteAt:iJ,difference:o$,dropLeft:QY,dropLeftWhile:tJ,dropRight:eJ,duplicate:bJ,elem:Ad,empty:_t,every:hA,exists:JJ,extend:g$,filter:di,filterE:KJ,filterMap:h$,filterMapWithIndex:p$,filterWithIndex:nA,findFirst:lv,findFirstMap:Nk,findIndex:cv,findLast:Pk,findLastIndex:Lk,findLastMap:Wk,flap:CJ,flatten:d$,foldLeft:BY,foldMap:y$,foldMapWithIndex:yv,foldRight:qY,fromArray:YJ,fromEither:Ok,fromEitherK:VJ,fromOption:Ik,fromOptionK:vJ,fromPredicate:UY,getDifferenceMagma:OJ,getEq:aA,getIntersectionSemigroup:IJ,getMonoid:SJ,getOrd:uA,getSemigroup:oA,getShow:iA,getUnionMonoid:TJ,getUnionSemigroup:sA,guard:NJ,head:Ak,init:GY,insertAt:nJ,intercalate:vA,intersection:i$,intersperse:lJ,isEmpty:Ji,isNonEmpty:Et,isOutOfBound:Xc,last:t$,lefts:uJ,lookup:us,makeBy:Tk,map:gv,mapWithIndex:Qk,match:wk,matchLeft:Rk,matchLeftW:Ek,matchRight:xk,matchRightW:Mk,matchW:Ck,modifyAt:jk,of:cs,partition:eA,partitionMap:tA,partitionMapWithIndex:v$,partitionWithIndex:m$,prepend:WY,prependAll:Bk,prependToAll:i7,prependW:LY,range:t7,readonlyArray:o7,reduce:bv,reduceRight:b$,reduceRightWithIndex:_v,reduceWithIndex:Pd,replicate:DY,reverse:oJ,rights:aJ,rotate:fJ,scanLeft:zY,scanRight:KY,separate:nl,sequence:Wd,size:VY,snoc:r7,some:mA,sort:sJ,sortBy:pJ,spanLeft:XY,splitAt:n$,tail:HY,takeLeft:YY,takeLeftWhile:ZY,takeRight:JY,toArray:GJ,traverse:rA,traverseWithIndex:_$,unfold:$$,union:r$,uniq:dJ,unsafeDeleteAt:pA,unsafeInsertAt:HJ,unsafeUpdateAt:Sv,unzip:cJ,updateAt:rJ,wilt:$J,wither:_J,zero:tl,zip:Uk,zipWith:Dk},Symbol.toStringTag,{value:"Module"}));var Va=function(e){return e.length===0},Ft=Wo,u7=Hc,s7=M0,Tv=wd,c7=x0,gA=function(e,t){return e<=0?[]:Qm(t)(e)},l7=function(e,t){return gA(e,function(){return t})};function f7(e){return function(t){return e(t)?[t]:[]}}var yA=function(e){return At(e)?[]:[e.value]},bA=function(e){return Bt(e)?[]:[e.right]},_A=function(e,t){return function(n){return Ft(n)?t(n):e()}},d7=_A,$A=function(e,t){return function(n){return Ft(n)?t(Lr(n),fi(n)):e()}},SA=$A,p7=SA,TA=function(e,t){return function(n){return Ft(n)?t(Jc(n),Yc(n)):e()}},IA=TA,h7=IA,OA=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},m7=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},v7=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},g7=function(e){return e.length},Ld=Xm,y7=us,b7=Ak,_7=t$,$7=function(e){return Ft(e)?fe(fi(e)):ge},S7=function(e){return Ft(e)?fe(Jc(e)):ge},T7=function(e){return function(t){return Ld(e,t)?bn(t):t.slice(0,e)}},I7=function(e){return function(t){return Ld(e,t)?bn(t):e===0?[]:t.slice(-e)}};function O7(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}return n}}var CA=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function C7(e){return function(t){var n=xA(CA(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var w7=function(e){return function(t){return e<=0||Va(t)?bn(t):e>=t.length?[]:t.slice(e,t.length)}},E7=function(e){return function(t){return e<=0||Va(t)?bn(t):e>=t.length?[]:t.slice(0,t.length-e)}};function R7(e){return function(t){return t.slice(CA(t,e))}}var M7=cv;function x7(e){return lv(e)}var k7=Nk;function A7(e){return Pk(e)}var F7=Wk,N7=Lk,bn=function(e){return e.slice()},P7=function(e,t){return function(n){return e<0||e>n.length?ge:fe(aF(e,t,n))}},W7=function(e,t){return wA(e,function(){return t})},L7=function(e){return function(t){return Ld(e,t)?ge:fe(sF(e,t))}},wA=function(e,t){return function(n){return Ld(e,n)?ge:fe(uF(e,t(n[e]),n))}},j7=function(e){return Va(e)?[]:e.slice().reverse()},D7=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},U7=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},B7=function(e){return function(t){return t.length<=1?bn(t):t.slice().sort(e.compare)}},EA=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function RA(e,t){return t===void 0?function(n){return RA(n,e)}:EA(e,t,function(n,r){return[n,r]})}var q7=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},MA=function(e){var t=tv(e);return function(n){return Ft(n)?t(n):[]}},z7=function(e){var t=tk(e);return function(n){return Ft(n)?t(n):bn(n)}},K7=function(e){var t=P0(e);return function(n){return Ft(n)?t(n):bn(n)}},M$=Ad,V7=function(e){var t=F0(e);return function(n){return Ft(n)?t(n):bn(n)}},H7=function(e){var t=Vx(e);return function(n){return Ft(n)?t(n):bn(n)}},G7=function(e){var t=j0(e);return function(n){return Ft(n)?t(n):[]}},xA=function(e){return function(t){return e>=1&&Ft(t)?nv(e)(t):Va(t)?[bn(t),[]]:[[],bn(t)]}},Y7=function(e){var t=ok(e);return function(n){return Ft(n)?t(n):[]}},J7=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return yA(e.apply(void 0,t))}};function Z7(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Ft(o)?m(Lr(o),Dd(function(a){return r(m(i,Tv(a)),fi(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var kA=function(e){return function(t){return Va(t)?bn(e):Va(e)?bn(t):t.concat(e)}},X7=kA;function x$(e){var t=N0(e);return function(n,r){if(r===void 0){var i=x$(e);return function(o){return i(o,n)}}return Ft(n)&&Ft(r)?t(r)(n):Ft(n)?bn(n):bn(r)}}function k$(e){var t=M$(e);return function(n,r){if(r===void 0){var i=k$(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function A$(e){var t=M$(e);return function(n,r){if(r===void 0){var i=A$(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var rn=function(e,t){return m(e,L$(t))},Iv=function(e,t){return m(e,DA(t))},Ha=function(e,t){return m(e,jA(t))},jd=function(e,t){return m(e,Dd(t))},Ov=function(e,t){return m(e,UA(t))},Cv=function(e,t){return m(e,U$(t))},wv=function(e,t){return m(e,BA(t))},Ev=function(e,t){return m(e,qA(t))},AA=function(e,t){return m(e,B$(t))},FA=function(e,t){return m(e,q$(t))},F$=function(e,t){return m(e,KA(t))},ls=function(e,t,n){return m(e,YA(t,n))},il=function(e){var t=HA(e);return function(n,r){return m(n,t(r))}},ol=function(e,t,n){return m(e,JA(t,n))},N$=function(e,t,n){return m(e,K$(t,n))},P$=function(e){var t=GA(e);return function(n,r){return m(n,t(r))}},W$=function(e,t,n){return m(e,ZA(t,n))},NA=function(e,t){return m(e,D$(t))},PA=function(e,t){return m(e,VA(t))},WA=function(e,t){return m(e,z$(t))},Rv=function(e){var t=Mv(e);return function(n,r){return m(n,t(r))}},LA=function(e){var t=V$(e);return function(n,r){return m(n,t(r))}},Q7=l$,e8=f$,Ga=za,al=function(){return[]},L$=function(e){return function(t){return t.map(function(n){return e(n)})}},jA=function(e){return Dd(function(t){return m(e,L$(t))})},Dd=function(e){return function(t){return m(t,OA(function(n,r){return e(r)}))}},j$=Dd(B),DA=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},D$=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);gt(i)&&n.push(i.value)}return n}},U$=function(e){return D$(function(t,n){return e(n)})},ul=U$(B),sl=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Ee(t,n)},UA=function(e){return function(t){return t.filter(e)}},BA=function(e){return B$(function(t,n){return e(n)})},B$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Ee(n,r)}},qA=function(e){return q$(function(t,n){return e(n)})},q$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Ee(n,r)}},zA=function(e){return function(t){return t.concat(e())}},KA=zA,VA=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},z$=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},t8=z$(B),HA=y$,GA=yv,YA=bv,K$=Pd,JA=b$,ZA=_v,Mv=function(e){var t=V$(e);return function(n){return t(function(r,i){return n(i)})}},Ud=function(e){return function(t){return ls(t,e.of(al()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return m(i,Tv(o))}}),r)})}},V$=function(e){return function(t){return K$(e.of(al()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return m(o,Tv(a))}}),t(n,i))})}},n8=function(e){var t=Q$(e);return function(n){return function(r){return t(r,n)}}},r8=function(e){var t=eS(e);return function(n){return function(r){return t(r,n)}}},H$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(gt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},dt="Array",i8=iA,XA=function(){return{concat:function(e,t){return e.concat(t)}}},G$=function(){return{concat:XA().concat,empty:[]}},QA=aA,o8=uA,eF=function(e){var t=x$(e);return{concat:function(n,r){return t(r)(n)}}},a8=function(e){return{concat:eF(e).concat,empty:[]}},u8=function(e){var t=k$(e);return{concat:function(n,r){return t(r)(n)}}},s8=function(e){var t=A$(e);return{concat:function(n,r){return t(r)(n)}}},Y$={URI:dt,map:rn},c8=Ue(Y$),tF={URI:dt,of:Ga},l8={URI:dt,map:rn,mapWithIndex:Iv},xv={URI:dt,map:rn,ap:Ha},f8=It(xv),d8=Ot(xv),p8={URI:dt,map:rn,ap:Ha,of:Ga},J$={URI:dt,map:rn,ap:Ha,chain:jd},h8=lt(J$),m8={URI:dt,map:rn,ap:Ha,of:Ga,chain:jd},v8={URI:dt,unfold:H$},g8={URI:dt,map:rn,alt:F$},nF={URI:dt,zero:al},y8=Zc(nF,tF),b8={URI:dt,map:rn,ap:Ha,of:Ga,alt:F$,zero:al},_8={URI:dt,map:rn,extend:WA},Z$={URI:dt,compact:ul,separate:sl},$8={URI:dt,map:rn,compact:ul,separate:sl,filter:Ov,filterMap:Cv,partition:wv,partitionMap:Ev},S8={URI:dt,map:rn,mapWithIndex:Iv,compact:ul,separate:sl,filter:Ov,filterMap:Cv,partition:wv,partitionMap:Ev,partitionMapWithIndex:FA,partitionWithIndex:AA,filterMapWithIndex:NA,filterWithIndex:PA},rF={URI:dt,reduce:ls,foldMap:il,reduceRight:ol},T8={URI:dt,reduce:ls,foldMap:il,reduceRight:ol,reduceWithIndex:N$,foldMapWithIndex:P$,reduceRightWithIndex:W$},X$={URI:dt,map:rn,reduce:ls,foldMap:il,reduceRight:ol,traverse:Rv,sequence:Ud},I8={URI:dt,map:rn,mapWithIndex:Iv,reduce:ls,foldMap:il,reduceRight:ol,reduceWithIndex:N$,foldMapWithIndex:P$,reduceRightWithIndex:W$,traverse:Rv,sequence:Ud,traverseWithIndex:LA},Q$=si(X$,Z$),eS=ui(X$,Z$),iF={URI:dt,map:rn,compact:ul,separate:sl,filter:Ov,filterMap:Cv,partition:wv,partitionMap:Ev,reduce:ls,foldMap:il,reduceRight:ol,traverse:Rv,sequence:Ud,wither:Q$,wilt:eS},O8=C$,C8={URI:dt,map:rn,ap:Ha,chain:jd,chainRec:Q7},w8=w$,E8={URI:dt,map:rn,ap:Ha,chain:jd,chainRec:e8},R8=h0(iF),oF={URI:dt,fromEither:bA},M8=br(oF),aF=k0,uF=function(e,t,n){return Ft(n)?A0(e,t,n):[]},sF=function(e,t){var n=t.slice();return n.splice(e,1),n},x8=hA,cF=function(e){return function(t){return t.some(e)}},k8=cF,A8=vA,F8=Ga(qt),N8=Tt(Y$),P8=wt(J$),W8=Ct(xv),L8=Hx,j8=[],D8=_k,U8=$k,B8=MA,q8={URI:dt,compact:ul,separate:sl,map:rn,ap:Ha,of:Ga,chain:jd,filter:Ov,filterMap:Cv,partition:wv,partitionMap:Ev,mapWithIndex:Iv,partitionMapWithIndex:FA,partitionWithIndex:AA,filterMapWithIndex:NA,filterWithIndex:PA,alt:F$,zero:al,unfold:H$,reduce:ls,foldMap:il,reduceRight:ol,traverse:Rv,sequence:Ud,reduceWithIndex:N$,foldMapWithIndex:P$,reduceRightWithIndex:W$,traverseWithIndex:LA,extend:WA,wither:Q$,wilt:eS};const z8=Object.freeze(Object.defineProperty({__proto__:null,Alt:g8,Alternative:b8,Applicative:p8,Apply:xv,Chain:J$,ChainRecBreadthFirst:E8,ChainRecDepthFirst:C8,Compactable:Z$,Do:F8,Extend:_8,Filterable:$8,FilterableWithIndex:S8,Foldable:rF,FoldableWithIndex:T8,FromEither:oF,Functor:Y$,FunctorWithIndex:l8,Monad:m8,Pointed:tF,Traversable:X$,TraversableWithIndex:I8,URI:dt,Unfoldable:v8,Witherable:iF,Zero:nF,alt:KA,altW:zA,ap:jA,apFirst:f8,apS:W8,apSecond:d8,append:Tv,appendW:c7,array:q8,bind:P8,bindTo:N8,chain:Dd,chainFirst:h8,chainRecBreadthFirst:w8,chainRecDepthFirst:O8,chainWithIndex:OA,chop:G7,chunksOf:Y7,compact:ul,comprehension:Z7,concat:X7,concatW:kA,cons:D8,copy:bn,deleteAt:L7,difference:A$,dropLeft:w7,dropLeftWhile:R7,dropRight:E7,duplicate:t8,elem:M$,empty:j8,every:x8,exists:k8,extend:z$,filter:UA,filterE:R8,filterMap:U$,filterMapWithIndex:D$,filterWithIndex:VA,findFirst:x7,findFirstMap:k7,findIndex:M7,findLast:A7,findLastIndex:N7,findLastMap:F7,flap:c8,flatten:j$,foldLeft:p7,foldMap:HA,foldMapWithIndex:GA,foldRight:h7,fromEither:bA,fromEitherK:M8,fromOption:yA,fromOptionK:J7,fromPredicate:f7,getDifferenceMagma:s8,getEq:QA,getIntersectionSemigroup:u8,getMonoid:G$,getOrd:o8,getSemigroup:XA,getShow:i8,getUnionMonoid:a8,getUnionSemigroup:eF,guard:y8,head:b7,init:S7,insertAt:P7,intercalate:A8,intersection:k$,intersperse:z7,isEmpty:Va,isNonEmpty:Ft,isOutOfBound:Ld,last:_7,lefts:U7,lookup:y7,makeBy:gA,map:L$,mapWithIndex:DA,match:d7,matchLeft:SA,matchLeftW:$A,matchRight:IA,matchRightW:TA,matchW:_A,modifyAt:wA,of:Ga,partition:BA,partitionMap:qA,partitionMapWithIndex:q$,partitionWithIndex:B$,prepend:u7,prependAll:MA,prependToAll:B8,prependW:s7,range:L8,reduce:YA,reduceRight:JA,reduceRightWithIndex:ZA,reduceWithIndex:K$,replicate:l7,reverse:j7,rights:D7,rotate:K7,scanLeft:m7,scanRight:v7,separate:sl,sequence:Ud,size:g7,snoc:U8,some:cF,sort:B7,sortBy:H7,spanLeft:C7,splitAt:xA,tail:$7,takeLeft:T7,takeLeftWhile:O7,takeRight:I7,traverse:Mv,traverseWithIndex:V$,unfold:H$,union:x$,uniq:V7,unsafeDeleteAt:sF,unsafeInsertAt:aF,unsafeUpdateAt:uF,unzip:q7,updateAt:W7,wilt:r8,wither:n8,zero:al,zip:RA,zipWith:EA},Symbol.toStringTag,{value:"Module"})),K8=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var V8=function(e){return typeof e=="boolean"},lF=function(e,t){return function(n){return n?t():e()}},fF=lF,dF=fF,H8=dF,pF={equals:function(e,t){return e===t}},G8={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},hF={concat:function(e,t){return e&&t}},mF={concat:function(e,t){return e||t}},Y8={concat:hF.concat,empty:!0},J8={concat:mF.concat,empty:!1},Z8={equals:pF.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},X8={show:function(e){return JSON.stringify(e)}};const Q8=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:G8,Eq:pF,MonoidAll:Y8,MonoidAny:J8,Ord:Z8,SemigroupAll:hF,SemigroupAny:mF,Show:X8,fold:H8,foldW:fF,isBoolean:V8,match:dF,matchW:lF},Symbol.toStringTag,{value:"Module"}));var vF=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}},eZ={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},tZ=vF,nZ={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},rZ=yM;const iZ=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:nZ,booleanAlgebraVoid:eZ,getDualBooleanAlgebra:tZ,getFunctionBooleanAlgebra:rZ,reverse:vF},Symbol.toStringTag,{value:"Module"}));var oZ=function(e){return qM(e)(e.bottom,e.top)},aZ=function(e){var t=F_(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},uZ={equals:_m.equals,compare:_m.compare,top:1/0,bottom:-1/0};const sZ=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:uZ,clamp:oZ,reverse:aZ},Symbol.toStringTag,{value:"Module"}));function gF(e){return{meet:ym(e),join:bm(e)}}const cZ=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:gF},Symbol.toStringTag,{value:"Module"}));function lZ(e){var t=gF(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const fZ=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:lZ},Symbol.toStringTag,{value:"Module"})),dZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),hZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),mZ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var tS=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const vZ=Object.freeze(Object.defineProperty({__proto__:null,tailRec:tS},Symbol.toStringTag,{value:"Module"}));function nS(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function yF(e,t){var n=nS(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},B),n(r,i))}}function gZ(e){return nS(e,e)}function yZ(e){return yF(e,e)}const bZ=Object.freeze(Object.defineProperty({__proto__:null,fanIn:yF,fanin:yZ,split:nS,splitChoice:gZ},Symbol.toStringTag,{value:"Module"})),_Z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var $Z=function(e,t){return m(e,bF(t))},bF=function(e){return function(t){return H(e,t)}},_F="Predicate",$F=function(){return{concat:function(e,t){return m(e,TF(t))}}},SZ=function(){return{concat:$F().concat,empty:$M}},SF=function(){return{concat:function(e,t){return m(e,IF(t))}}},TZ=function(){return{concat:SF().concat,empty:E_}},IZ={URI:_F,contramap:$Z},Bd=function(e){return function(t){return!e(t)}},TF=function(e){return function(t){return function(n){return t(n)||e(n)}}},IF=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const OZ=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:IZ,URI:_F,and:IF,contramap:bF,getMonoidAll:TZ,getMonoidAny:SZ,getSemigroupAll:SF,getSemigroupAny:$F,not:Bd,or:TF},Symbol.toStringTag,{value:"Module"}));var nt=ge,yt=fe;function kv(e){return function(t){return e(t)?yt(t):nt}}var Av=function(e){return e._tag==="Right"?nt:yt(e.left)},qd=function(e){return e._tag==="Left"?nt:yt(e.right)},_r=function(e,t){return m(e,Zi(t))},fs=function(e,t){return m(e,EF(t))},Fv=function(e,t){return m(e,Kd(t))},Nv=function(e,t,n){return m(e,MF(t,n))},Pv=function(e){var t=xF(e);return function(n,r){return m(n,t(r))}},Wv=function(e,t,n){return m(e,kF(t,n))},rS=function(e){var t=DF(e);return function(n,r){return m(n,t(r))}},iS=function(e,t){return m(e,FF(t))},zd=function(e,t){return m(e,PF(t))},oS=function(e,t){return m(e,WF(t))},OF=function(e,t){return m(e,cS(t))},aS=function(e,t){return m(e,LF(t))},uS=function(e,t){return m(e,jF(t))},Lt="Option",CZ=function(e){return{show:function(t){return We(t)?"none":"some(".concat(e.show(t.value),")")}}},CF=function(e){return{equals:function(t,n){return t===n||(We(t)?We(n):We(n)?!1:e.equals(t.value,n.value))}}},wZ=function(e){return{equals:CF(e).equals,compare:function(t,n){return t===n?0:Uv(t)?Uv(n)?e.compare(t.value,n.value):1:-1}}},sS=function(e){return{concat:function(t,n){return We(t)?n:We(n)?t:yt(e.concat(t.value,n.value))},empty:nt}},Zi=function(e){return function(t){return We(t)?nt:yt(e(t.value))}},cl={URI:Lt,map:_r},Lo=yt,wF={URI:Lt,of:Lo},EF=function(e){return function(t){return We(t)||We(e)?nt:yt(t.value(e.value))}},ll={URI:Lt,map:_r,ap:fs},RF={URI:Lt,map:_r,ap:fs,of:Lo},Kd=function(e){return function(t){return We(t)?nt:e(t.value)}},Vd={URI:Lt,map:_r,ap:fs,chain:Fv},EZ={URI:Lt,map:_r,ap:fs,of:Lo,chain:Fv},MF=function(e,t){return function(n){return We(n)?e:t(e,n.value)}},xF=function(e){return function(t){return function(n){return We(n)?e.empty:t(n.value)}}},kF=function(e,t){return function(n){return We(n)?e:t(n.value,e)}},RZ={URI:Lt,reduce:Nv,foldMap:Pv,reduceRight:Wv},AF=function(e){return function(t){return We(t)?e():t}},FF=AF,MZ={URI:Lt,map:_r,alt:iS},Lv=function(){return nt},NF={URI:Lt,zero:Lv},xZ=Zc(NF,wF),kZ={URI:Lt,map:_r,ap:fs,of:Lo,alt:iS,zero:Lv},cS=function(e){return function(t){return We(t)?nt:yt(e(t))}},AZ={URI:Lt,map:_r,extend:OF},fl=Kd(B),FZ=Ee(nt,nt),dl=function(e){return We(e)?FZ:Ee(Av(e.value),qd(e.value))},ds={URI:Lt,compact:fl,separate:dl},PF=function(e){return function(t){return We(t)?nt:e(t.value)?t:nt}},WF=function(e){return function(t){return We(t)?nt:e(t.value)}},LF=function(e){return function(t){return Ee(zd(t,Bd(e)),zd(t,e))}},jF=function(e){return H(Zi(e),dl)},jo={URI:Lt,map:_r,compact:fl,separate:dl,filter:zd,filterMap:oS,partition:aS,partitionMap:uS},DF=function(e){return function(t){return function(n){return We(n)?e.of(nt):e.map(t(n.value),yt)}}},jv=function(e){return function(t){return We(t)?e.of(nt):e.map(t.value,yt)}},lS={URI:Lt,map:_r,reduce:Nv,foldMap:Pv,reduceRight:Wv,traverse:rS,sequence:jv},fS=si(lS,ds),dS=ui(lS,ds),NZ=function(e){var t=fS(e);return function(n){return function(r){return t(r,n)}}},PZ=function(e){var t=dS(e);return function(n){return function(r){return t(r,n)}}},WZ={URI:Lt,map:_r,reduce:Nv,foldMap:Pv,reduceRight:Wv,traverse:rS,sequence:jv,compact:fl,separate:dl,filter:zd,filterMap:oS,partition:aS,partitionMap:uS,wither:fS,wilt:dS},pS=function(){return nt},LZ={URI:Lt,map:_r,ap:fs,of:Lo,chain:Fv,throwError:pS},pl=qd,Dv={URI:Lt,fromEither:pl},Uv=gt,We=function(e){return e._tag==="None"},hS=function(e,t){return function(n){return We(n)?e():t(n.value)}},jZ=hS,Do=hS,Uo=Do,mS=function(e){return function(t){return We(t)?e():t.value}},vS=mS,DZ=Ue(cl),UZ=It(ll),BZ=Ot(ll),qZ=fl,zZ=lt(Vd),KZ=cS(B),VZ=br(Dv),HZ=No(Dv,Vd),GZ=Po(Dv,Vd),ps=function(e){return e==null?nt:yt(e)},UF=function(e){try{return yt(e())}catch{return nt}},YZ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return UF(function(){return e.apply(void 0,t)})}},JZ=function(e){return H(e,ps)},BF=function(e){return function(t){return We(t)?nt:ps(e(t.value))}},gS=Do(SM,B),qF=Do(R_,B);function zF(e){return function(t,n){if(n===void 0){var r=zF(e);return function(i){return r(t,i)}}return We(n)?!1:e.equals(t,n.value)}}var ZZ=function(e){return function(t){return We(t)?!1:e(t.value)}},XZ=Lo(qt),QZ=Tt(cl),eX=wt(Vd),tX=Ct(ll),KF=Lo(en),Bv=function(e){return function(t){var n=e(0,hr(t));if(We(n))return nt;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(We(o))return nt;r.push(o.value)}return yt(r)}},yS=function(e){var t=Bv(e);return function(n){return mt(n)?t(n):KF}},nX=yS,VF=function(e){return yS(function(t,n){return e(n)})},rX=VF(B);function iX(e){return function(t){return Uv(e(t))}}var oX=BF,HF={URI:Lt,map:_r,of:Lo,ap:fs,chain:Fv,reduce:Nv,foldMap:Pv,reduceRight:Wv,traverse:rS,sequence:jv,zero:Lv,alt:iS,extend:OF,compact:fl,separate:dl,filter:zd,filterMap:oS,partition:aS,partitionMap:uS,wither:fS,wilt:dS,throwError:pS},aX=zt(ll),uX=Wr(RF),GF=function(){return sS(U_())},sX=function(){return sS(Tm())};const cX=Object.freeze(Object.defineProperty({__proto__:null,Alt:MZ,Alternative:kZ,ApT:KF,Applicative:RF,Apply:ll,Chain:Vd,Compactable:ds,Do:XZ,Extend:AZ,Filterable:jo,Foldable:RZ,FromEither:Dv,Functor:cl,Monad:EZ,MonadThrow:LZ,Pointed:wF,Traversable:lS,URI:Lt,Witherable:WZ,Zero:NF,alt:FF,altW:AF,ap:EF,apFirst:UZ,apS:tX,apSecond:BZ,bind:eX,bindTo:QZ,chain:Kd,chainEitherK:HZ,chainFirst:zZ,chainFirstEitherK:GZ,chainNullableK:BF,compact:fl,duplicate:KZ,elem:zF,exists:ZZ,extend:cS,filter:PF,filterMap:WF,flap:DZ,flatten:qZ,fold:Uo,foldMap:xF,foldW:jZ,fromEither:pl,fromEitherK:VZ,fromNullable:ps,fromNullableK:JZ,fromPredicate:kv,getApplyMonoid:uX,getApplySemigroup:aX,getEq:CF,getFirstMonoid:GF,getLastMonoid:sX,getLeft:Av,getMonoid:sS,getOrElse:vS,getOrElseW:mS,getOrd:wZ,getRefinement:iX,getRight:qd,getShow:CZ,guard:xZ,isNone:We,isSome:Uv,map:Zi,mapNullable:oX,match:Do,matchW:hS,none:nt,of:Lo,option:HF,partition:LF,partitionMap:jF,reduce:MF,reduceRight:kF,separate:dl,sequence:jv,sequenceArray:rX,some:yt,throwError:pS,toNullable:gS,toUndefined:qF,traverse:DF,traverseArray:VF,traverseArrayWithIndex:nX,traverseReadonlyArrayWithIndex:yS,traverseReadonlyNonEmptyArrayWithIndex:Bv,tryCatch:UF,tryCatchK:YZ,wilt:PZ,wither:NZ,zero:Lv},Symbol.toStringTag,{value:"Module"}));function Xi(e,t){return function(n){return e.map(n,t.compact)}}function Bo(e,t,n){var r=Xi(e,t),i=Pc(e,n);return function(o){return Ee(r(m(o,i(Av))),r(m(o,i(qd))))}}function lX(e,t){var n=Wc(e,t).map;return{map:n,compact:Xi(e,t),separate:Bo(e,t,t)}}const fX=Object.freeze(Object.defineProperty({__proto__:null,compact:Xi,getCompactableComposition:lX,separate:Bo},Symbol.toStringTag,{value:"Module"}));var dX=function(e){return function(){return console.log(e)}},pX=function(e){return function(){return console.warn(e)}},hX=function(e){return function(){return console.error(e)}},mX=function(e){return function(){return console.info(e)}};const vX=Object.freeze(Object.defineProperty({__proto__:null,error:hX,info:mX,log:dX,warn:pX},Symbol.toStringTag,{value:"Module"}));var hl=Fc;function gX(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var yX=B,bX=B,_X=B,$X=B,SX=B,TX=B,IX=B,OX=B,CX=B;function YF(e){return{URI:hs,_E:void 0,map:bS,ap:function(t,n){return hl(e.concat(t,n))}}}function JF(e){var t=YF(e);return{URI:hs,_E:void 0,map:t.map,ap:t.ap,of:function(){return hl(e.empty)}}}var ZF=function(e,t){return m(e,eN())},bS=function(e,t){return m(e,tN())},XF=function(e,t,n){return m(e,nN(t))},QF=function(e,t){return m(e,rN(t))},eN=function(){return Fc},tN=function(){return Fc},nN=function(e){return function(t){return hl(e(t))}},rN=function(e){return function(t){return hl(e(t))}},hs="Const",iN={URI:hs,map:bS},wX=Ue(iN),EX={URI:hs,contramap:ZF},RX={URI:hs,bimap:XF,mapLeft:QF},MX={URI:hs,map:bS,contramap:ZF,bimap:XF,mapLeft:QF};const xX=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:RX,Contravariant:EX,Functor:iN,URI:hs,bimap:nN,const_:MX,contramap:eN,flap:wX,getApplicative:JF,getApply:YF,getBooleanAlgebra:CX,getBounded:_X,getEq:yX,getHeytingAlgebra:OX,getMonoid:SX,getOrd:bX,getRing:IX,getSemigroup:$X,getSemiring:TX,getShow:gX,make:hl,map:tN,mapLeft:rN},Symbol.toStringTag,{value:"Module"})),kX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var AX={equals:function(e,t){return e.valueOf()===t.valueOf()}},FX={equals:function(e,t){return e.getDate()===t.getDate()}},NX={equals:function(e,t){return e.getMonth()===t.getMonth()}},PX={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},WX=m(uv,gm(function(e){return e.valueOf()})),LX=function(){return new Date},jX=function(){return new Date().getTime()};const DX=Object.freeze(Object.defineProperty({__proto__:null,Eq:AX,Ord:WX,create:LX,eqDate:FX,eqMonth:NX,eqYear:PX,now:jX},Symbol.toStringTag,{value:"Module"}));var $t=Mo,Ke=Da,_n=function(e,t){return m(e,gs(t))},ms=function(e,t){return m(e,sN(t))},ml=function(e,t){return m(e,jr(t))},Hd=function(e,t,n){return m(e,lN(t,n))},Gd=function(e){return function(t,n){var r=fN(e);return m(t,r(n))}},Yd=function(e,t,n){return m(e,dN(t,n))},qv=function(e){var t=pN(e);return function(n,r){return m(n,t(r))}},_S=function(e,t,n){return m(e,CS(t,n))},$S=function(e,t){return m(e,Qd(t))},oN=function(e,t){return m(e,mN(t))},SS=function(e,t){return m(e,wS(t))},TS=function(e,t){return tS(t(e),function(n){return ue(n)?Ke($t(n.left)):ue(n.right)?$t(t(n.right.left)):Ke(Ke(n.right.right))})},St="Either",UX=function(e,t){return{show:function(n){return ue(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},BX=function(e,t){return{equals:function(n,r){return n===r||(ue(n)?ue(r)&&e.equals(n.left,r.left):ES(r)&&t.equals(n.right,r.right))}}},Jd=function(e){return{concat:function(t,n){return ue(n)?t:ue(t)?n:Ke(e.concat(t.right,n.right))}}},vs=function(e){var t=$t(e.empty);return{URI:St,_E:void 0,compact:function(n){return ue(n)?n:n.right._tag==="None"?t:Ke(n.right.value)},separate:function(n){return ue(n)?Ee(n,n):ue(n.right)?Ee(Ke(n.right.left),t):Ee(t,Ke(n.right.right))}}},vl=function(e){var t=$t(e.empty),n=vs(e),r=n.compact,i=n.separate,o=function(u,s){return ue(u)||s(u.right)?u:t},a=function(u,s){return ue(u)?Ee(u,u):s(u.right)?Ee(t,Ke(u.right)):Ee(Ke(u.right),t)};return{URI:St,_E:void 0,map:_n,compact:r,separate:i,filter:o,filterMap:function(u,s){if(ue(u))return u;var c=s(u.right);return c._tag==="None"?t:Ke(c.value)},partition:a,partitionMap:function(u,s){if(ue(u))return Ee(u,u);var c=s(u.right);return ue(c)?Ee(Ke(c.left),t):Ee(t,Ke(c.right))}}},qX=function(e){var t=vl(e),n=vs(e);return{URI:St,_E:void 0,map:_n,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:qv,sequence:Xd,reduce:Hd,foldMap:Gd,reduceRight:Yd,wither:si(OS,n),wilt:ui(OS,n)}},Ya=function(e){return{URI:St,_E:void 0,map:_n,ap:function(t,n){return ue(t)?ue(n)?$t(e.concat(t.left,n.left)):t:ue(n)?n:Ke(t.right(n.right))},of:Qi}},aN=function(e){return{URI:St,_E:void 0,map:_n,alt:function(t,n){if(ES(t))return t;var r=n();return ue(r)?$t(e.concat(t.left,r.left)):r}}},gs=function(e){return function(t){return ue(t)?t:Ke(e(t.right))}},Ja={URI:St,map:_n},Qi=Ke,zX={URI:St,of:Qi},uN=function(e){return function(t){return ue(t)?t:ue(e)?e:Ke(t.right(e.right))}},sN=uN,gl={URI:St,map:_n,ap:ms},cN={URI:St,map:_n,ap:ms,of:Qi},IS=function(e){return function(t){return ue(t)?t:e(t.right)}},jr=IS,Zd={URI:St,map:_n,ap:ms,chain:ml},KX={URI:St,map:_n,ap:ms,of:Qi,chain:ml},lN=function(e,t){return function(n){return ue(n)?e:t(e,n.right)}},fN=function(e){return function(t){return function(n){return ue(n)?e.empty:t(n.right)}}},dN=function(e,t){return function(n){return ue(n)?e:t(n.right,e)}},VX={URI:St,reduce:Hd,foldMap:Gd,reduceRight:Yd},pN=function(e){return function(t){return function(n){return ue(n)?e.of($t(n.left)):e.map(t(n.right),Ke)}}},Xd=function(e){return function(t){return ue(t)?e.of($t(t.left)):e.map(t.right,Ke)}},OS={URI:St,map:_n,reduce:Hd,foldMap:Gd,reduceRight:Yd,traverse:qv,sequence:Xd},CS=function(e,t){return function(n){return ue(n)?$t(e(n.left)):Ke(t(n.right))}},Qd=function(e){return function(t){return ue(t)?$t(e(t.left)):t}},HX={URI:St,bimap:_S,mapLeft:$S},hN=function(e){return function(t){return ue(t)?e():t}},mN=hN,GX={URI:St,map:_n,alt:oN},wS=function(e){return function(t){return ue(t)?t:Ke(e(t))}},YX={URI:St,map:_n,extend:SS},JX={URI:St,map:_n,ap:ms,chain:ml,chainRec:TS},zv=$t,ZX={URI:St,map:_n,ap:ms,of:Qi,chain:ml,throwError:zv},yl={URI:St,fromEither:B},XX=qa(yl),vN=Gi(yl),ue=Bt,ES=M_,RS=function(e,t){return function(n){return ue(n)?e(n.left):t(n.right)}},gN=RS,Za=RS,MS=Za,xS=function(e){return function(t){return ue(t)?e(t.left):t.right}},QX=xS,eQ=Ue(Ja),yN=It(gl),tQ=yN,bN=Ot(gl),nQ=bN,_N=lt(Zd),rQ=_N,$N=IS(B),iQ=$N,oQ=wS(B),aQ=Yi(yl),uQ=is(yl,Zd),SN=as(yl,Zd),sQ=SN,TN=function(e){return ue(e)?Ke(e.left):$t(e.right)},IN=function(e){return function(t){return ue(t)?e(t.left):t}},ON=IN,kS=function(e){return function(t){return t==null?$t(e):Ke(t)}},ys=function(e,t){try{return Ke(e())}catch(n){return $t(t(n))}},cQ=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return ys(function(){return e.apply(void 0,n)},t)}},CN=function(e){var t=kS(e);return function(n){return H(n,t)}},lQ=function(e){var t=CN(e);return function(n){return jr(t(n))}},wN=gN(B,B);function fQ(e){return e instanceof Error?e:new Error(String(e))}function EN(e){return function(t,n){if(n===void 0){var r=EN(e);return function(i){return r(t,i)}}return ue(n)?!1:e.equals(t,n.right)}}var dQ=function(e){return function(t){return ue(t)?!1:e(t.right)}},pQ=Qi(qt),hQ=Tt(Ja),RN=wt(Zd),mQ=RN,MN=Ct(gl),vQ=MN,xN=Qi(en),ep=function(e){return function(t){var n=e(0,hr(t));if(ue(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(ue(o))return o;r.push(o.right)}return Ke(r)}},AS=function(e){var t=ep(e);return function(n){return mt(n)?t(n):xN}},gQ=AS,kN=function(e){return AS(function(t,n){return e(n)})},yQ=kN(B);function bQ(e,t){return ys(function(){return JSON.parse(e)},t)}var _Q=function(e,t){return ys(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},$Q={URI:St,map:_n,of:Qi,ap:ms,chain:ml,reduce:Hd,foldMap:Gd,reduceRight:Yd,traverse:qv,sequence:Xd,bimap:_S,mapLeft:$S,alt:oN,extend:SS,chainRec:TS,throwError:zv},SQ=zt(gl),TQ=Wr(cN),IQ=function(e,t){return zt(Ya(e))(t)},OQ=function(e,t){return Wr(Ya(e))(t)};function CQ(e){var t=Ya(e).ap,n=aN(e).alt;return{URI:St,_E:void 0,map:_n,of:Qi,chain:ml,bimap:_S,mapLeft:$S,reduce:Hd,foldMap:Gd,reduceRight:Yd,extend:SS,traverse:qv,sequence:Xd,chainRec:TS,throwError:zv,ap:t,alt:n}}const AN=Object.freeze(Object.defineProperty({__proto__:null,Alt:GX,ApT:xN,Applicative:cN,Apply:gl,Bifunctor:HX,Chain:Zd,ChainRec:JX,Do:pQ,Extend:YX,Foldable:VX,FromEither:yl,Functor:Ja,Monad:KX,MonadThrow:ZX,Pointed:zX,Traversable:OS,URI:St,alt:mN,altW:hN,ap:sN,apFirst:yN,apFirstW:tQ,apS:MN,apSW:vQ,apSecond:bN,apSecondW:nQ,apW:uN,bimap:CS,bind:RN,bindTo:hQ,bindW:mQ,chain:jr,chainFirst:_N,chainFirstW:rQ,chainNullableK:lQ,chainOptionK:uQ,chainW:IS,duplicate:oQ,either:$Q,elem:EN,exists:dQ,extend:wS,filterOrElse:SN,filterOrElseW:sQ,flap:eQ,flatten:iQ,flattenW:$N,fold:MS,foldMap:fN,foldW:gN,fromNullable:kS,fromNullableK:CN,fromOption:vN,fromOptionK:aQ,fromPredicate:XX,getAltValidation:aN,getApplicativeValidation:Ya,getApplyMonoid:TQ,getApplySemigroup:SQ,getCompactable:vs,getEq:BX,getFilterable:vl,getOrElse:QX,getOrElseW:xS,getSemigroup:Jd,getShow:UX,getValidation:CQ,getValidationMonoid:OQ,getValidationSemigroup:IQ,getWitherable:qX,isLeft:ue,isRight:ES,left:$t,map:gs,mapLeft:Qd,match:Za,matchW:RS,of:Qi,orElse:ON,orElseW:IN,parseJSON:bQ,reduce:lN,reduceRight:dN,right:Ke,sequence:Xd,sequenceArray:yQ,stringifyJSON:_Q,swap:TN,throwError:zv,toError:fQ,toUnion:wN,traverse:pN,traverseArray:kN,traverseArrayWithIndex:gQ,traverseReadonlyArrayWithIndex:AS,traverseReadonlyNonEmptyArrayWithIndex:ep,tryCatch:ys,tryCatchK:cQ},Symbol.toStringTag,{value:"Module"}));function bs(e){return H(Ke,e.of)}function bl(e){return H($t,e.of)}function _l(e){return function(t){return e.map(t,Ke)}}function $l(e){return function(t){return e.map(t,$t)}}function Kv(e){return function(t){return H(kS(t),e.of)}}function Vv(e){var t=Kv(e);return function(n){var r=t(n);return function(i){return H(i,r)}}}function FS(e){var t=_s(e),n=Vv(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function Sl(e){return Pc(e,Ja)}function Tl(e){return xo(e,gl)}function _s(e){return function(t){return function(n){return e.chain(n,function(r){return ue(r)?e.of(r):t(r.right)})}}}function Il(e){return function(t){return function(n){return e.chain(n,function(r){return ue(r)?t():e.of(r)})}}}function Ol(e){return function(t,n){return function(r){return e.map(r,CS(t,n))}}}function Cl(e){return function(t){return function(n){return e.map(n,Qd(t))}}}function tp(e,t){return function(n){return function(r){return e.chain(r,Za(function(i){return e.map(n(),Qd(function(o){return t.concat(i,o)}))},bs(e)))}}}function np(e){return function(t,n){return function(r){return e.map(r,Za(t,n))}}}function wl(e){return function(t,n){return function(r){return e.chain(r,Za(t,n))}}}function El(e){return function(t){return function(n){return e.chain(n,Za(t,e.of))}}}function $s(e){return function(t){return function(n){return e.chain(n,function(r){return ue(r)?t(r.left):e.of(r)})}}}function rp(e){var t=$s(e);return function(n){return t(function(r){return e.map(n(r),function(i){return ue(i)?i:$t(r)})})}}function ip(e){return function(t){return function(n){return e.chain(n,Za(function(r){return e.map(t(r),$t)},function(r){return e.of(Ke(r))}))}}}function Rl(e){return function(t){return e.map(t,TN)}}function op(e){return function(t){return e.map(t,wN)}}function wQ(e){var t=Tl(e),n=Sl(e),r=_s(e),i=Il(e),o=Ol(e),a=Cl(e),u=wl(e),s=El(e),c=$s(e);return{map:function(l,f){return m(l,n(f))},ap:function(l,f){return m(l,t(f))},of:bs(e),chain:function(l,f){return m(l,r(f))},alt:function(l,f){return m(l,i(f))},bimap:function(l,f,d){return m(l,o(f,d))},mapLeft:function(l,f){return m(l,a(f))},fold:function(l,f,d){return m(l,u(f,d))},getOrElse:function(l,f){return m(l,s(f))},orElse:function(l,f){return m(l,c(f))},swap:Rl(e),rightM:_l(e),leftM:$l(e),left:bl(e)}}const EQ=Object.freeze(Object.defineProperty({__proto__:null,alt:Il,altValidation:tp,ap:Tl,bimap:Ol,chain:_s,chainNullableK:FS,fromNullable:Kv,fromNullableK:Vv,getEitherM:wQ,getOrElse:El,left:bl,leftF:$l,map:Sl,mapLeft:Cl,match:np,matchE:wl,orElse:$s,orElseFirst:rp,orLeft:ip,right:bs,rightF:_l,swap:Rl,toUnion:op},Symbol.toStringTag,{value:"Module"}));var RQ="Endomorphism",FN=function(){return{concat:function(e,t){return H(e,t)}}},NN=function(){return{concat:FN().concat,empty:B}};const MQ=Object.freeze(Object.defineProperty({__proto__:null,URI:RQ,getMonoid:NN,getSemigroup:FN},Symbol.toStringTag,{value:"Module"})),xQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function PN(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}function kQ(e,t){var n=t.zero,r=PN(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}var AQ={add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const FQ=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:AQ,gcd:PN,lcm:kQ},Symbol.toStringTag,{value:"Module"}));function qo(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function zo(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function Xa(e,t){var n=qo(e,t);return function(r){var i=n(Bd(r)),o=n(r);return function(a){return Ee(i(a),o(a))}}}function Qa(e,t){var n=zo(e,t);return function(r){return function(i){return Ee(m(i,n(function(o){return Av(r(o))})),m(i,n(function(o){return qd(r(o))})))}}}function NQ(e,t){var n=Wc(e,t).map,r=Xi(e,t),i=Bo(e,t,t),o=qo(e,t),a=zo(e,t),u=Xa(e,t),s=Qa(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return m(c,o(l))},filterMap:function(c,l){return m(c,a(l))},partition:function(c,l){return m(c,u(l))},partitionMap:function(c,l){return m(c,s(l))}}}const PQ=Object.freeze(Object.defineProperty({__proto__:null,filter:qo,filterMap:zo,getFilterableComposition:NQ,partition:Xa,partitionMap:Qa},Symbol.toStringTag,{value:"Module"})),WQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function WN(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function LN(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function jN(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function LQ(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(o,a){return e.chain(o,function(u){return r(u,a)})})}}}function jQ(e,t){return function(n,r){var i=function(o,a){var u=o.init,s=o.acc;return u?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(s,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function DN(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function DQ(e,t){var n=function(i,o){return e.ap(e.map(i,Gn),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function UQ(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(o,a){return e.chain(o,function(u){return i(u,a)})})}}var BQ=DN;function NS(e,t){var n=WN(e,t),r=LN(e,t),i=jN(e,t);return{reduce:function(o,a,u){return m(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return m(u,a(s))}},reduceRight:function(o,a,u){return m(o,i(a,u))}}}const qQ=Object.freeze(Object.defineProperty({__proto__:null,foldM:UQ,foldMap:LN,getFoldableComposition:NS,intercalate:jQ,reduce:WN,reduceM:LQ,reduceRight:jN,toArray:BQ,toReadonlyArray:DN,traverse_:DQ},Symbol.toStringTag,{value:"Module"}));function UN(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,u){return t.reduceWithIndex(u,a,function(s,c,l){return r([o,s],c,l)})})}}}function BN(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(o){return function(a){return r(a,function(u,s){return i(s,function(c,l){return o([u,c],l)})})}}}}function qN(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,u){return t.reduceRightWithIndex(a,u,function(s,c,l){return r([o,s],c,l)})})}}}function zQ(e,t){var n=NS(e,t),r=UN(e,t),i=BN(e,t),o=qN(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return m(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return m(s,u(c))}},reduceRightWithIndex:function(a,u,s){return m(a,o(u,s))}}}const KQ=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:BN,getFoldableWithIndexComposition:zQ,reduceRightWithIndex:qN,reduceWithIndex:UN},Symbol.toStringTag,{value:"Module"}));function eo(e){return function(t){return H(t,e.fromIO)}}function Ko(e,t){return function(n){var r=H(n,e.fromIO);return function(i){return t.chain(i,r)}}}function Vo(e,t){var n=lt(t);return function(r){return n(H(r,e.fromIO))}}const VQ=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:Vo,chainIOK:Ko,fromIOK:eo},Symbol.toStringTag,{value:"Module"}));var zN=function(){return B},HQ=B,ap=function(e){return function(t){return function(n){return t(e(n))}}},up=function(e){return function(t){return e(t)(t)}},GQ=up,Ho=function(e,t){return m(e,Ss(t))},sp=function(e,t){return m(e,HN(t))},PS=function(e,t){return m(e,GN(t))},KN=function(e,t){return m(e,JN(t))},Hv=function(e,t,n){return m(e,ZN(t,n))},Ss=function(e){return function(t){return function(n){return e(t(n))}}},VN=function(e){return function(t){return function(n){return t(n)(e(n))}}},HN=VN,to=Gn,WS=function(e){return function(t){return function(n){return e(t(n))(n)}}},GN=WS,YN=WS(B),YQ=YN,JN=function(e){return function(t){return H(e,t)}},ZN=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},LS=function(){return B},jS=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},DS=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},US=function(e){return MS(function(t){return Mo(e(t))},Ke)},BS=function(e){return MS($t,function(t){return Da(e(t))})},Dr="Reader",on={URI:Dr,map:Ho},JQ=Ue(on),qS={URI:Dr,of:to},Go={URI:Dr,map:Ho,ap:sp},XN=It(Go),ZQ=XN,QN=Ot(Go),XQ=QN,eP={URI:Dr,map:Ho,ap:sp,of:to},zS={URI:Dr,map:Ho,ap:sp,chain:PS},Yo={URI:Dr,map:Ho,of:to,ap:sp,chain:PS},tP=lt(zS),QQ=tP,eee={URI:Dr,map:Ho,promap:Hv},tee={URI:Dr,compose:KN,id:LS},nee={URI:Dr,map:Ho,promap:Hv,first:jS,second:DS},ree={URI:Dr,map:Ho,promap:Hv,left:US,right:BS},iee=Tt(on),nP=wt(zS),oee=nP,aee=to(qt),rP=Ct(Go),uee=rP,iP=to(en),Ts=function(e){return function(t){return function(n){for(var r=[e(0,hr(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},KS=function(e){var t=Ts(e);return function(n){return mt(n)?t(n):iP}},see=KS,oP=function(e){return KS(function(t,n){return e(n)})},cee=oP(B),lee={URI:Dr,map:Ho,of:to,ap:sp,chain:PS,promap:Hv,compose:KN,id:LS,first:jS,second:DS,left:US,right:BS},fee=zt(Go),dee=Wr(eP);const pee=Object.freeze(Object.defineProperty({__proto__:null,ApT:iP,Applicative:eP,Apply:Go,Category:tee,Chain:zS,Choice:ree,Do:aee,Functor:on,Monad:Yo,Pointed:qS,Profunctor:eee,Strong:nee,URI:Dr,ap:HN,apFirst:XN,apFirstW:ZQ,apS:rP,apSW:uee,apSecond:QN,apSecondW:XQ,apW:VN,ask:zN,asks:HQ,asksReader:GQ,asksReaderW:up,bind:nP,bindTo:iee,bindW:oee,chain:GN,chainFirst:tP,chainFirstW:QQ,chainW:WS,compose:JN,first:jS,flap:JQ,flatten:YQ,flattenW:YN,getMonoid:dee,getSemigroup:fee,id:LS,left:US,local:ap,map:Ss,of:to,promap:ZN,reader:lee,right:BS,second:DS,sequenceArray:cee,traverseArray:oP,traverseArrayWithIndex:see,traverseReadonlyArrayWithIndex:KS,traverseReadonlyNonEmptyArrayWithIndex:Ts},Symbol.toStringTag,{value:"Module"}));function cp(e){return function(){return e.fromReader(zN())}}function lp(e){return e.fromReader}function Is(e){return function(t){return H(t,e.fromReader)}}function fp(e,t){var n=Is(e);return function(r){return function(i){return t.chain(i,n(r))}}}function dp(e,t){return H(Is(e),lt(t))}const hee=Object.freeze(Object.defineProperty({__proto__:null,ask:cp,asks:lp,chainFirstReaderK:dp,chainReaderK:fp,fromReaderK:Is},Symbol.toStringTag,{value:"Module"}));var aP=function(){return function(e){return[e,e]}},uP=function(e){return function(){return[void 0,e]}},sP=function(e){return function(t){return[void 0,e(t)]}},cP=function(e){return function(t){return[e(t),t]}},pp=function(e,t){return m(e,fP(t))},Gv=function(e,t){return m(e,dP(t))},lP=function(e,t){return m(e,VS(t))},fP=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},dP=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),u=a[0],s=a[1];return[i(u),s]}}},hp=function(e){return function(t){return[e,t]}},VS=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},mee=VS(B),eu="State",HS={URI:eu,map:pp},vee=Ue(HS),gee={URI:eu,of:hp},Yv={URI:eu,map:pp,ap:Gv},yee=It(Yv),bee=Ot(Yv),_ee={URI:eu,map:pp,ap:Gv,of:hp},GS={URI:eu,map:pp,ap:Gv,chain:lP},pP={URI:eu,map:pp,ap:Gv,of:hp,chain:lP},$ee=lt(GS),See={URI:eu,fromState:B},Tee=function(e){return function(t){return t(e)[0]}},Iee=function(e){return function(t){return t(e)[1]}},Oee=Tt(HS),Cee=wt(GS),wee=Ct(Yv),hP=function(e){return function(t){return function(n){for(var r=e(0,hr(t))(n),i=r[0],o=r[1],a=[i],u=o,s=1;s<t.length;s++){var c=e(s,t[s])(u),l=c[0],f=c[1];a.push(l),u=f}return[a,u]}}},YS=function(e){var t=hP(e);return function(n){return mt(n)?t(n):hp(en)}},Eee=YS,mP=function(e){return YS(function(t,n){return e(n)})},Ree=mP(B),Mee=function(e,t){return e(t)[0]},xee=function(e,t){return e(t)[1]},kee=pP;const Aee=Object.freeze(Object.defineProperty({__proto__:null,Applicative:_ee,Apply:Yv,Chain:GS,FromState:See,Functor:HS,Monad:pP,Pointed:gee,URI:eu,ap:dP,apFirst:yee,apS:wee,apSecond:bee,bind:Cee,bindTo:Oee,chain:VS,chainFirst:$ee,evalState:Mee,evaluate:Tee,execState:xee,execute:Iee,flap:vee,flatten:mee,get:aP,gets:cP,map:fP,modify:sP,of:hp,put:uP,sequenceArray:Ree,state:kee,traverseArray:mP,traverseArrayWithIndex:Eee,traverseReadonlyArrayWithIndex:YS,traverseReadonlyNonEmptyArrayWithIndex:hP},Symbol.toStringTag,{value:"Module"}));function vP(e){return function(){return e.fromState(aP())}}function gP(e){return function(t){return e.fromState(uP(t))}}function yP(e){return H(sP,e.fromState)}function bP(e){return H(cP,e.fromState)}function JS(e){return function(t){return H(t,e.fromState)}}function _P(e,t){var n=JS(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Fee=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:_P,fromStateK:JS,get:vP,gets:bP,modify:yP,put:gP},Symbol.toStringTag,{value:"Module"}));function Os(e){return function(t){return H(t,e.fromTask)}}function Ml(e,t){return function(n){var r=H(n,e.fromTask);return function(i){return t.chain(i,r)}}}function xl(e,t){var n=lt(t);return function(r){return n(H(r,e.fromTask))}}const Nee=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:xl,chainTaskK:Ml,fromTaskK:Os},Symbol.toStringTag,{value:"Module"}));function $P(e){return function(t){return H(t,e.fromThese)}}const Pee=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:$P},Symbol.toStringTag,{value:"Module"}));function SP(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(i,o){return t.mapWithIndex(o,function(a,u){return n([i,a],u)})})}}}function Wee(e,t){var n=Wc(e,t).map,r=SP(e,t);return{map:n,mapWithIndex:function(i,o){return m(i,r(o))}}}const Lee=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:Wee,mapWithIndex:SP},Symbol.toStringTag,{value:"Module"})),jee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Dee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Uee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var no=function(e,t){return m(e,wP(t))},kl=function(e,t){return m(e,EP(t))},Jv=function(e,t){return m(e,eT(t))},ZS=function(e,t,n){return m(e,RP(t,n))},XS=function(e){return function(t,n){return m(t,MP()(n))}},QS=function(e,t,n){return m(e,xP(t,n))},TP=function(e,t){return m(e,FP())},IP=function(e,t){return m(e,tT(t))},OP=function(e){var t=kP(e);return function(n,r){return m(n,t(r))}},CP=tS,wP=function(e){return function(t){return e(t)}},EP=function(e){return function(t){return t(e)}},Al=B,eT=function(e){return function(t){return e(t)}},tT=function(e){return function(t){return e(t)}},nT=B,Bee=tT(B),qee=eT(B),RP=function(e,t){return function(n){return t(e,n)}},MP=function(){return function(e){return function(t){return e(t)}}},xP=function(e,t){return function(n){return t(n,e)}},kP=function(e){return function(t){return function(n){return e.map(t(n),B)}}},rT=function(e){return function(t){return e.map(t,B)}},AP=function(){return B},FP=AP,$r="Identity",zee=B,Kee=B,iT={URI:$r,map:no},Vee=Ue(iT),Hee={URI:$r,of:Al},Zv={URI:$r,map:no,ap:kl},Gee=It(Zv),Yee=Ot(Zv),Jee={URI:$r,map:no,ap:kl,of:Al},oT={URI:$r,map:no,ap:kl,chain:Jv},Zee={URI:$r,map:no,ap:kl,of:Al,chain:Jv},Xee=lt(oT),Qee={URI:$r,reduce:ZS,foldMap:XS,reduceRight:QS},ete={URI:$r,map:no,reduce:ZS,foldMap:XS,reduceRight:QS,traverse:OP,sequence:rT},tte={URI:$r,map:no,alt:TP},nte={URI:$r,map:no,extend:IP,extract:nT},rte={URI:$r,map:no,ap:kl,chain:Jv,chainRec:CP},ite=Al(qt),ote=Tt(iT),ate=wt(oT),ute=Ct(Zv),ste={URI:$r,map:no,ap:kl,of:Al,chain:Jv,reduce:ZS,foldMap:XS,reduceRight:QS,traverse:OP,sequence:rT,alt:TP,extract:nT,extend:IP,chainRec:CP};const cte=Object.freeze(Object.defineProperty({__proto__:null,Alt:tte,Applicative:Jee,Apply:Zv,Chain:oT,ChainRec:rte,Comonad:nte,Do:ite,Foldable:Qee,Functor:iT,Monad:Zee,Pointed:Hee,Traversable:ete,URI:$r,alt:FP,altW:AP,ap:EP,apFirst:Gee,apS:ute,apSecond:Yee,bind:ate,bindTo:ote,chain:eT,chainFirst:Xee,duplicate:Bee,extend:tT,extract:nT,flap:Vee,flatten:qee,foldMap:MP,getEq:Kee,getShow:zee,identity:ste,map:wP,of:Al,reduce:RP,reduceRight:xP,sequence:rT,traverse:kP},Symbol.toStringTag,{value:"Module"})),lte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Jo=function(e,t){return function(){return t(e())}},tu=function(e,t){return function(){return e()(t())}},Fl=function(e,t){return function(){return t(e())()}},NP=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},ro=function(e){return function(t){return Jo(t,e)}},fte=function(e){return function(t){return tu(t,e)}},pi=Gn,aT=function(e){return function(t){return Fl(t,e)}},dte=aT(B),hi="IO",ot={URI:hi,map:Jo},pte=Ue(ot),io={URI:hi,of:pi},Zo={URI:hi,map:Jo,ap:tu},hte=It(Zo),mte=Ot(Zo),PP={URI:hi,map:Jo,ap:tu,of:pi},Xv={URI:hi,map:Jo,ap:tu,chain:Fl},Jn={URI:hi,map:Jo,ap:tu,of:pi,chain:Fl},vte=lt(Xv),uT=B,gte={URI:hi,map:Jo,ap:tu,of:pi,chain:Fl,fromIO:uT},yte={URI:hi,map:Jo,ap:tu,chain:Fl,chainRec:NP},bte={URI:hi,fromIO:B},_te=pi(qt),$te=Tt(ot),Ste=wt(Xv),Tte=Ct(Zo),WP=pi(en),Qv=function(e){return function(t){return function(){for(var n=[e(0,hr(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},sT=function(e){var t=Qv(e);return function(n){return mt(n)?t(n):WP}},Ite=sT,LP=function(e){return sT(function(t,n){return e(n)})},Ote=LP(B),Cte={URI:hi,map:Jo,of:pi,ap:tu,chain:Fl,fromIO:uT,chainRec:NP},wte=zt(Zo),Ete=Wr(PP);const Rte=Object.freeze(Object.defineProperty({__proto__:null,ApT:WP,Applicative:PP,Apply:Zo,Chain:Xv,ChainRec:yte,Do:_te,FromIO:bte,Functor:ot,Monad:Jn,MonadIO:gte,Pointed:io,URI:hi,ap:fte,apFirst:hte,apS:Tte,apSecond:mte,bind:Ste,bindTo:$te,chain:aT,chainFirst:vte,flap:pte,flatten:dte,fromIO:uT,getMonoid:Ete,getSemigroup:wte,io:Cte,map:ro,of:pi,sequenceArray:Ote,traverseArray:LP,traverseArrayWithIndex:Ite,traverseReadonlyArrayWithIndex:sT,traverseReadonlyNonEmptyArrayWithIndex:Qv},Symbol.toStringTag,{value:"Module"}));var jP=bl(io),DP=bs(io),UP=_l(ot),Mte=$l(ot),BP=pi,mp=UP,qP=np(ot),xte=qP,cT=wl(Jn),kte=cT,zP=cT,Ate=zP,KP=El(Jn),Fte=KP,VP=function(e,t){return function(){return ys(e,t)}},Nte=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return VP(function(){return e.apply(void 0,n)},t)}},Pte=op(ot),HP=$s(Jn),Wte=HP,lT=rp(Jn),Lte=lT,jte=function(e){return lT(iW(e))},Dte=ip(Jn),Ute=Rl(ot),Zn=function(e,t){return m(e,pT(t))},Cs=function(e,t){return m(e,hT(t))},Bte=function(e,t){return m(e,eg(function(n){return m(t,pT(n))}))},Nl=function(e,t){return m(e,eg(t))},fT=function(e,t,n){return m(e,YP(t,n))},dT=function(e,t){return m(e,JP(t))},GP=function(e,t){return m(e,mT(t))},pT=Sl(ot),YP=Ol(ot),JP=Cl(ot),hT=Tl(Zo),qte=hT,Ur=DP,eg=_s(Jn),tg=eg,ZP=tg(B),zte=ZP,mT=Il(Jn),Kte=mT,ng=jP,Nt="IOEither";function XP(e){var t=xo(Zo,Ya(e));return{URI:Nt,_E:void 0,map:Zn,ap:function(n,r){return m(n,t(r))},of:Ur}}function QP(e){var t=tp(Jn,e);return{URI:Nt,_E:void 0,map:Zn,alt:function(n,r){return m(n,t(r))}}}var eW=function(e){var t=vs(e);return{URI:Nt,_E:void 0,compact:Xi(ot,t),separate:Bo(ot,t,Ja)}};function Vte(e){var t=vl(e),n=eW(e),r=qo(ot,t),i=zo(ot,t),o=Xa(ot,t),a=Qa(ot,t);return{URI:Nt,_E:void 0,map:Zn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}var vT={URI:Nt,map:Zn},Hte=Ue(vT),Gte={URI:Nt,of:Ur},Yte={URI:Nt,bimap:fT,mapLeft:dT},vp={URI:Nt,map:Zn,ap:Cs},tW=It(vp),Jte=tW,nW=Ot(vp),Zte=nW,gT={URI:Nt,map:Zn,ap:Cs,of:Ur},Xte={URI:Nt,map:Zn,ap:Bte,of:Ur},Xo={URI:Nt,map:Zn,ap:Cs,chain:Nl},Qte={URI:Nt,map:Zn,ap:Cs,of:Ur,chain:Nl},rW=lt(Xo),ene=rW,tne={URI:Nt,map:Zn,alt:GP},nne={URI:Nt,map:Zn,ap:Cs,of:Ur,chain:Nl,fromIO:mp},rne={URI:Nt,map:Zn,ap:Cs,of:Ur,chain:Nl,throwError:ng},rg={URI:Nt,fromIO:mp},iW=eo(rg),ine=Ko(rg,Xo),one=Vo(rg,Xo),Qo={URI:Nt,fromEither:BP},ane=Gi(Qo),une=Yi(Qo),sne=is(Qo,Xo),oW=No(Qo,Xo),cne=oW,aW=Po(Qo,Xo),lne=aW,fne=qa(Qo),uW=as(Qo,Xo),dne=uW,pne=br(Qo),hne=function(e,t,n){return sW(e,t,n)},sW=function(e,t,n){return m(e,tg(function(r){return m(t(r),aT(function(i){return m(n(r,i),tg(function(){return pi(i)}))}))}))},mne=Ur(qt),vne=Tt(vT),cW=wt(Xo),gne=cW,lW=Ct(vp),yne=lW,yT=Ur(en),fW=function(e){return H(Qv(e),ro(ep(Yn)))},bT=function(e){var t=fW(e);return function(n){return mt(n)?t(n):yT}},dW=function(e){return function(t){return function(){var n=e(0,hr(t))();if(Bt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Bt(o))return o;r.push(o.right)}return Da(r)}}},_T=function(e){var t=dW(e);return function(n){return mt(n)?t(n):yT}},bne=bT,pW=function(e){return bT(function(t,n){return e(n)})},_ne=pW(B),$ne=_T,hW=function(e){return _T(function(t,n){return e(n)})},Sne=hW(B),Tne=gT,Ine={URI:Nt,bimap:fT,mapLeft:dT,map:Zn,of:Ur,ap:Cs,chain:Nl,alt:GP,fromIO:mp,throwError:ng},One=zt(vp),Cne=Wr(gT),wne=function(e){return zt(Zo)(Jd(e))};function Ene(e){var t=XP(e),n=QP(e);return{URI:Nt,_E:void 0,map:Zn,ap:t.ap,of:Ur,chain:Nl,bimap:fT,mapLeft:dT,alt:n.alt,fromIO:mp,throwError:ng}}const Rne=Object.freeze(Object.defineProperty({__proto__:null,Alt:tne,ApT:yT,Applicative:Tne,ApplicativePar:gT,ApplicativeSeq:Xte,ApplyPar:vp,Bifunctor:Yte,Chain:Xo,Do:mne,FromEither:Qo,FromIO:rg,Functor:vT,Monad:Qte,MonadIO:nne,MonadThrow:rne,Pointed:Gte,URI:Nt,alt:mT,altW:Kte,ap:hT,apFirst:tW,apFirstW:Jte,apS:lW,apSW:yne,apSecond:nW,apSecondW:Zte,apW:qte,bimap:YP,bind:cW,bindTo:vne,bindW:gne,bracket:hne,bracketW:sW,chain:eg,chainEitherK:oW,chainEitherKW:cne,chainFirst:rW,chainFirstEitherK:aW,chainFirstEitherKW:lne,chainFirstIOK:one,chainFirstW:ene,chainIOK:ine,chainOptionK:sne,chainW:tg,filterOrElse:uW,filterOrElseW:dne,flap:Hte,flatten:zte,flattenW:ZP,fold:kte,foldW:Ate,fromEither:BP,fromEitherK:pne,fromIO:mp,fromIOK:iW,fromOption:ane,fromOptionK:une,fromPredicate:fne,getAltIOValidation:QP,getApplicativeIOValidation:XP,getApplyMonoid:Cne,getApplySemigroup:One,getCompactable:eW,getFilterable:Vte,getIOValidation:Ene,getOrElse:KP,getOrElseW:Fte,getSemigroup:wne,ioEither:Ine,left:jP,leftIO:Mte,map:pT,mapLeft:JP,match:qP,matchE:cT,matchEW:zP,matchW:xte,of:Ur,orElse:HP,orElseFirst:lT,orElseFirstIOK:jte,orElseFirstW:Lte,orElseW:Wte,orLeft:Dte,right:DP,rightIO:UP,sequenceArray:_ne,sequenceSeqArray:Sne,swap:Ute,throwError:ng,toUnion:Pte,traverseArray:pW,traverseArrayWithIndex:bne,traverseReadonlyArrayWithIndex:bT,traverseReadonlyArrayWithIndexSeq:_T,traverseReadonlyNonEmptyArrayWithIndex:fW,traverseReadonlyNonEmptyArrayWithIndexSeq:dW,traverseSeqArray:hW,traverseSeqArrayWithIndex:$ne,tryCatch:VP,tryCatchK:Nte},Symbol.toStringTag,{value:"Module"}));function gp(e){return H(yt,e.of)}function yp(e){return Gn(e.of(nt))}function ig(e){return function(t){return e.map(t,yt)}}function og(e){return H(ps,e.of)}function ag(e){var t=og(e);return function(n){return H(n,t)}}function $T(e){var t=Pl(e),n=ag(e);return function(r){return t(n(r))}}function ug(e){return function(t){return H(t,e.of)}}function ST(e){var t=Pl(e),n=ug(e);return function(r){return t(n(r))}}function TT(e){return function(t){return function(n){return e.of(kv(t)(n))}}}function IT(e){return H(pl,e.of)}function OT(e){return function(t,n){return function(r){return e.map(r,Do(t,n))}}}function sg(e){return function(t,n){return function(r){return e.chain(r,Do(t,n))}}}function cg(e){return function(t){return function(n){return e.chain(n,Do(t,e.of))}}}function lg(e){return Pc(e,cl)}function fg(e){return xo(e,ll)}function Pl(e){var t=yp(e);return function(n){return function(r){return e.chain(r,Do(function(){return t()},n))}}}function dg(e){var t=gp(e);return function(n){return function(r){return e.chain(r,Do(n,t))}}}function Mne(e){var t=fg(e),n=lg(e),r=Pl(e),i=dg(e),o=sg(e),a=cg(e),u=yp(e);return{map:function(s,c){return m(s,n(c))},ap:function(s,c){return m(s,t(c))},of:gp(e),chain:function(s,c){return m(s,r(c))},alt:function(s,c){return m(s,i(c))},fold:function(s,c,l){return m(s,o(c,l))},getOrElse:function(s,c){return m(s,a(c))},fromM:ig(e),none:function(){return u()}}}const xne=Object.freeze(Object.defineProperty({__proto__:null,alt:dg,ap:fg,chain:Pl,chainNullableK:$T,chainOptionK:ST,fromEither:IT,fromF:ig,fromNullable:og,fromNullableK:ag,fromOptionK:ug,fromPredicate:TT,getOptionM:Mne,getOrElse:cg,map:lg,match:OT,matchE:sg,some:gp,zero:yp},Symbol.toStringTag,{value:"Module"}));var mW=gp(io),kne=TT(io),Ane=pi,vW=IT(io),CT=ig(ot),Fne=ro(pl),gW=OT(ot),Nne=gW,wT=sg(Xv),Pne=wT,Wne=wT,yW=cg(Jn),Lne=yW,jne=ro(qF),Dne=ro(gS),Une=og(io),Bne=ag(io),qne=$T(Jn),zne=ug(io),Kne=ST(Jn),bW=lg(ot),_W=fg(Zo),nu=mW,ET=Pl(Jn),Vne=ET(B),RT=dg(Jn),Hne=RT,pg=yp(io),Gne=pg(),MT=Xi(ot,ds),xT=Bo(ot,ds,cl),$W=qo(ot,jo),SW=zo(ot,jo),TW=Xa(ot,jo),IW=Qa(ot,jo),ea=function(e,t){return m(e,bW(t))},Wl=function(e,t){return m(e,_W(t))},kT=function(e,t){return m(e,ET(t))},OW=function(e,t){return m(e,RT(t))},Yne=function(e,t){return m(e,$W(t))},Jne=function(e,t){return m(e,SW(t))},Zne=function(e,t){return m(e,TW(t))},Xne=function(e,t){return m(e,IW(t))},Xn="IOOption",AT={URI:Xn,map:ea},Qne=Ue(AT),CW={URI:Xn,of:nu},hg={URI:Xn,map:ea,ap:Wl},ere=It(hg),tre=Ot(hg),nre={URI:Xn,map:ea,ap:Wl,of:nu},ws={URI:Xn,map:ea,ap:Wl,chain:kT},rre=lt(ws),ire={URI:Xn,map:ea,alt:OW},wW={URI:Xn,zero:pg},ore=Zc(wW,CW),are={URI:Xn,map:ea,ap:Wl,of:nu,alt:OW,zero:pg},ure={URI:Xn,map:ea,ap:Wl,of:nu,chain:kT},sre={URI:Xn,map:ea,ap:Wl,of:nu,chain:kT,fromIO:CT},cre={URI:Xn,compact:MT,separate:xT},lre={URI:Xn,map:ea,compact:MT,separate:xT,filter:Yne,filterMap:Jne,partition:Zne,partitionMap:Xne},mg={URI:Xn,fromIO:CT},fre=eo(mg),dre=Ko(mg,ws),pre=Vo(mg,ws),vg={URI:Xn,fromEither:vW},hre=br(vg),mre=No(vg,ws),vre=Po(vg,ws),gre=nu(qt),yre=Tt(AT),bre=wt(ws),_re=Ct(hg),EW=nu(en),RW=function(e){return H(Qv(e),ro(Bv(Yn)))},$re=function(e){var t=RW(e);return function(n){return mt(n)?t(n):EW}};const Sre=Object.freeze(Object.defineProperty({__proto__:null,Alt:ire,Alternative:are,ApT:EW,Applicative:nre,Apply:hg,Chain:ws,Compactable:cre,Do:gre,Filterable:lre,FromEither:vg,FromIO:mg,Functor:AT,Monad:ure,MonadIO:sre,Pointed:CW,Zero:wW,alt:RT,altW:Hne,ap:_W,apFirst:ere,apS:_re,apSecond:tre,bind:bre,bindTo:yre,chain:ET,chainEitherK:mre,chainFirst:rre,chainFirstEitherK:vre,chainFirstIOK:pre,chainIOK:dre,chainNullableK:qne,chainOptionK:Kne,compact:MT,filter:$W,filterMap:SW,flap:Qne,flatten:Vne,fold:Pne,fromEither:vW,fromEitherK:hre,fromIO:CT,fromIOEither:Fne,fromIOK:fre,fromNullable:Une,fromNullableK:Bne,fromOption:Ane,fromOptionK:zne,fromPredicate:kne,getOrElse:yW,getOrElseW:Lne,guard:ore,map:bW,match:gW,matchE:wT,matchEW:Wne,matchW:Nne,none:Gne,of:nu,partition:TW,partitionMap:IW,separate:xT,some:mW,toNullable:Dne,toUndefined:jne,traverseReadonlyArrayWithIndex:$re,traverseReadonlyNonEmptyArrayWithIndex:RW,zero:pg},Symbol.toStringTag,{value:"Module"}));var MW=function(){function e(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return e.prototype.write=function(t){var n=this;return function(){n.value=t}},e.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},e}();function Tre(e){return function(){return new MW(e)}}const Ire=Object.freeze(Object.defineProperty({__proto__:null,IORef:MW,newIORef:Tre},Symbol.toStringTag,{value:"Module"})),Ore=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Cre=function(e){return ys(function(){return JSON.parse(e)},B)},wre=function(e){return ys(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},B)};const Ere=Object.freeze(Object.defineProperty({__proto__:null,parse:Cre,stringify:wre},Symbol.toStringTag,{value:"Module"})),Rre=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Mre=function(e){return new Map(e)};function xre(e){return new Map(e)}function xW(e,t){return{show:function(n){var r=[];return n.forEach(function(i,o){r.push("[".concat(e.show(o),", ").concat(t.show(i),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var kW=function(e){return e.size},oo=function(e){return e.size===0};function gg(e){var t=Es(e);return function(n,r){if(r===void 0){var i=gg(e);return function(o){return i(n,o)}}return gt(t(n,r))}}function FT(e){return function(t,n){if(n===void 0){var r=FT(e);return function(u){return r(t,u)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var Ll=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},kre=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function AW(e){var t=Ll(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}var FW=function(e){return AW(e)(function(t,n){return[t,n]})};function Are(e,t){var n=FW(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?fe([i[a],a+1]):ge})}}var NW=function(e){var t=ta(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(At(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},PW=function(e){var t=ta(e);return function(n){return function(r){var i=t(n,r);if(gt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Fre=function(e){var t=WW(e);return function(n,r){return t(n,function(){return r})}},WW=function(e){var t=ta(e);return function(n,r){return function(i){var o=t(n,i);if(At(o))return ge;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return fe(i);var l=new Map(i);return l.set(u,c),fe(l)}}};function Nre(e){var t=Es(e),n=PW(e);return function(r){var i=n(r);return function(o){return m(t(r,o),Zi(function(a){return[a,i(o)]}))}}}function ta(e){return function(t,n){if(n===void 0){var r=ta(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return fe([u,s])}return ge}}function Es(e){var t=ta(e);return function(n,r){if(r===void 0){var i=Es(e);return function(o){return i(n,o)}}return m(t(n,r),Zi(function(o){o[0];var a=o[1];return a}))}}function yg(e,t){var n=ta(e);return function(r,i){if(i===void 0){var o=yg(e,t);return function(d){return o(d,r)}}for(var a=r.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,i);if(At(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var bg=new Map;function LW(e,t){var n=yg(e,t);return Pr(function(r,i){return n(r,i)&&n(i,r)})}function Pre(e,t){var n=ta(e);return{concat:function(r,i){if(oo(r))return i;if(oo(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);gt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:bg}}var Wre=function(e,t){return new Map([[e,t]])};function Lre(e,t,n){return function(r){var i=ta(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return gt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var jl=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},jW=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Bt(c)?n.set(u,c.left):r.set(u,c.right)}return Ee(n,r)}};function DW(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Ee(n,r)}}var UW=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);gt(s)&&n.set(a,s.value)}return n}};function BW(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var na=function(e,t){return jl(e,function(n,r){return t(r)})},bp=function(e,t){return qW(e,function(n,r){return t(r)})},_p=function(e,t){return zW(e,function(n,r){return t(r)})},$p=function(e,t){return KW(e,function(n,r){return t(r)})},Sp=function(e,t){return VW(e,function(n,r){return t(r)})},qW=function(e,t){return m(e,BW(t))},zW=function(e,t){return m(e,UW(t))},KW=function(e,t){return m(e,DW(t))},VW=function(e,t){return m(e,jW(t))},Dl=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];gt(a)&&t.set(o,a.value)}return t},jre=function(e){return function(t){return bp(t,e)}},Dre=function(e){return function(t){return _p(t,e)}},Ure=function(e){return function(t){return na(t,e)}},Bre=function(e){return function(t){return jl(t,e)}},qre=function(e){return function(t){return $p(t,e)}},zre=function(e){return function(t){return Sp(t,e)}},Ul=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Bt(u)?t.set(a,u.left):n.set(a,u.right)}return Ee(t,n)},Br="ReadonlyMap",HW=function(e,t){var n=UT(e,t);return{concat:function(r,i){return n(i)(r)}}},Kre=function(e,t){return{concat:HW(e,t).concat,empty:bg}},Vre=function(e,t){var n=BT(e,t);return{concat:function(r,i){return n(i)(r)}}},Hre=function(e){return function(){var t=qT(e);return{concat:function(n,r){return t(r)(n)}}}};function Gre(){return{URI:Br,_E:void 0,map:na,mapWithIndex:jl,compact:Dl,separate:Ul,filter:bp,filterMap:_p,partition:$p,partitionMap:Sp,partitionMapWithIndex:VW,partitionWithIndex:KW,filterMapWithIndex:zW,filterWithIndex:qW}}var GW={URI:Br,map:na},Yre=Ue(GW),Jre=function(){return{URI:Br,_E:void 0,map:na,mapWithIndex:jl}},NT={URI:Br,compact:Dl,separate:Ul},Zre={URI:Br,map:na,compact:Dl,separate:Ul,filter:bp,filterMap:_p,partition:$p,partitionMap:Sp},PT=function(e){var t=$g(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},WT=function(e){var t=Sg(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},LT=function(e){var t=Tg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},_g=function(e){var t=PT(e),n=WT(e),r=LT(e);return{URI:Br,_E:void 0,reduce:function(i,o,a){return m(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return m(a,o(u))}},reduceRight:function(i,o,a){return m(i,r(o,a))}}},$g=function(e){var t=Ll(e);return function(n,r){return function(i){for(var o=n,a=0,u=t(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},Sg=function(e){var t=Ll(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=0,u=t(i);a<u.length;a++){var s=u[a];o=n.concat(o,r(s,i.get(s)))}return o}}}},Tg=function(e){var t=Ll(e);return function(n,r){return function(i){for(var o=n,a=t(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},jT=function(e){var t=_g(e),n=$g(e),r=Sg(e),i=Tg(e);return{URI:Br,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return m(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return m(u,a(s))}},reduceRightWithIndex:function(o,a,u){return m(o,i(a,u))}}},Xre=function(e){var t=DT(e),n=_g(e);return{URI:Br,_E:void 0,map:na,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},DT=function(e){var t=jT(e),n=Ll(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],g=u.get(v);c=a.ap(a.map(c,function(b){return function(S){return b.set(v,S)}}),s(v,g))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,Yn)}};return{URI:Br,_E:void 0,map:na,mapWithIndex:jl,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}};function Qre(e){var t=DT(e);return{URI:Br,_E:void 0,map:na,compact:Dl,separate:Ul,filter:bp,filterMap:_p,partition:$p,partitionMap:Sp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:jl,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ui(t,NT),wither:si(t,NT)}}var UT=function(e,t){var n=Es(e);return function(r){return function(i){if(oo(i))return r;if(oo(r))return i;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);gt(f)?o.set(c,t.concat(l,f.value)):o.set(c,l)}for(var d=r.entries();!(u=d.next()).done;){var p=u.value,c=p[0],l=p[1],f=n(c)(o);At(f)&&o.set(c,l)}return o}}},BT=function(e,t){var n=Es(e);return function(r){return function(i){if(oo(i)||oo(r))return bg;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);gt(f)&&o.set(c,t.concat(l,f.value))}return o}}},qT=function(e){var t=gg(e);return function(n){return function(r){if(oo(r))return n;if(oo(n))return r;for(var i=new Map,o=r.entries(),a;!(a=o.next()).done;){var u=a.value,s=u[0],c=u[1];t(s)(n)||i.set(s,c)}for(var l=n.entries();!(a=l.next()).done;){var f=a.value,s=f[0],c=f[1];t(s)(r)||i.set(s,c)}return i}}},eie=NW,tie={URI:Br,map:na,compact:Dl,separate:Ul,filter:bp,filterMap:_p,partition:$p,partitionMap:Sp};const nie=Object.freeze(Object.defineProperty({__proto__:null,Compactable:NT,Filterable:Zre,Functor:GW,URI:Br,collect:AW,compact:Dl,deleteAt:PW,difference:qT,elem:FT,empty:bg,filter:jre,filterMap:Dre,filterMapWithIndex:UW,filterWithIndex:BW,flap:Yre,foldMap:WT,foldMapWithIndex:Sg,fromFoldable:Lre,fromMap:Mre,getDifferenceMagma:Hre,getEq:LW,getFilterableWithIndex:Gre,getFoldable:_g,getFoldableWithIndex:jT,getFunctorWithIndex:Jre,getIntersectionSemigroup:Vre,getMonoid:Pre,getShow:xW,getTraversable:Xre,getTraversableWithIndex:DT,getUnionMonoid:Kre,getUnionSemigroup:HW,getWitherable:Qre,insertAt:eie,intersection:BT,isEmpty:oo,isSubmap:yg,keys:Ll,lookup:Es,lookupWithKey:ta,map:Ure,mapWithIndex:Bre,member:gg,modifyAt:WW,partition:qre,partitionMap:zre,partitionMapWithIndex:jW,partitionWithIndex:DW,pop:Nre,readonlyMap:tie,reduce:PT,reduceRight:LT,reduceRightWithIndex:Tg,reduceWithIndex:$g,separate:Ul,singleton:Wre,size:kW,toMap:xre,toReadonlyArray:FW,toUnfoldable:Are,union:UT,updateAt:Fre,upsertAt:NW,values:kre},Symbol.toStringTag,{value:"Module"}));var Bl=globalThis&&globalThis.__assign||function(){return Bl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Bl.apply(this,arguments)},rie=xW,iie=kW,ra=oo,oie=gg,aie=FT,zT=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},uie=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function YW(e){var t=zT(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}function JW(e){return YW(e)(function(t,n){return[t,n]})}function sie(e,t){var n=JW(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?fe([i[a],a+1]):ge})}}var ZW=function(e){var t=Rs(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(At(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},XW=function(e){var t=Rs(e);return function(n){return function(r){var i=t(n,r);if(gt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},cie=function(e){var t=QW(e);return function(n,r){return t(n,function(){return r})}},QW=function(e){var t=Rs(e);return function(n,r){return function(i){var o=t(n,i);if(At(o))return ge;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),fe(a)}}};function lie(e){var t=eL(e),n=XW(e);return function(r){var i=n(r);return function(o){return m(t(r,o),Zi(function(a){return[a,i(o)]}))}}}function Rs(e){return function(t,n){if(n===void 0){var r=Rs(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return fe([u,s])}return ge}}var eL=Es,fie=yg,die=LW;function pie(e,t){var n=Rs(e);return{concat:function(r,i){if(ra(r))return i;if(ra(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);gt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var hie=function(e,t){return new Map([[e,t]])};function mie(e,t,n){return function(r){var i=Rs(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return gt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Tp=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},tL=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Bt(c)?n.set(u,c.left):r.set(u,c.right)}return Ee(n,r)}};function nL(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Ee(n,r)}}var rL=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);gt(s)&&n.set(a,s.value)}return n}};function iL(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var ql=function(e,t){return Tp(e,function(n,r){return t(r)})},Ig=function(e,t){return oL(e,function(n,r){return t(r)})},Og=function(e,t){return aL(e,function(n,r){return t(r)})},Cg=function(e,t){return uL(e,function(n,r){return t(r)})},wg=function(e,t){return sL(e,function(n,r){return t(r)})},oL=function(e,t){return m(e,iL(t))},aL=function(e,t){return m(e,rL(t))},uL=function(e,t){return m(e,nL(t))},sL=function(e,t){return m(e,tL(t))},Ip=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];gt(a)&&t.set(o,a.value)}return t},vie=function(e){return function(t){return Ig(t,e)}},gie=function(e){return function(t){return Og(t,e)}},yie=function(e){return function(t){return ql(t,e)}},bie=function(e){return function(t){return Tp(t,e)}},_ie=function(e){return function(t){return Cg(t,e)}},$ie=function(e){return function(t){return wg(t,e)}},Op=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Bt(u)?t.set(a,u.left):n.set(a,u.right)}return Ee(t,n)},ia="Map",cL=function(e,t){var n=hL(e,t);return{concat:function(r,i){return n(i)(r)}}},Sie=function(e,t){return{concat:cL(e,t).concat,empty:new Map}},Tie=function(e,t){var n=mL(e,t);return{concat:function(r,i){return n(i)(r)}}},Iie=function(e){return function(){var t=vL(e);return{concat:function(n,r){return t(r)(n)}}}};function Oie(){return{URI:ia,_E:void 0,map:ql,mapWithIndex:Tp,compact:Ip,separate:Op,filter:Ig,filterMap:Og,partition:Cg,partitionMap:wg,partitionMapWithIndex:sL,partitionWithIndex:uL,filterMapWithIndex:aL,filterWithIndex:oL}}function Cie(e){var t=fL(e);return{URI:ia,_E:void 0,map:ql,compact:Ip,separate:Op,filter:Ig,filterMap:Og,partition:Cg,partitionMap:wg,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Tp,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ui(t,KT),wither:si(t,KT)}}var wie=PT,Eie=WT,Rie=LT,Mie=function(e){return Bl(Bl({},_g(e)),{URI:ia})},xie=$g,kie=Sg,Aie=Tg,lL=function(e){return Bl(Bl({},jT(e)),{URI:ia})},fL=function(e){var t=lL(e),n=zT(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],g=u.get(v);c=a.ap(a.map(c,function(b){return function(S){return b.set(v,S)}}),s(v,g))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,function(c,l){return l})}};return{URI:ia,_E:void 0,map:ql,mapWithIndex:Tp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},dL={URI:ia,map:ql},Fie=Ue(dL),KT={URI:ia,compact:Ip,separate:Op},pL={URI:ia,map:ql,compact:Ip,separate:Op,filter:Ig,filterMap:Og,partition:Cg,partitionMap:wg},Eg=function(e){return new Map(e)},hL=function(e,t){var n=UT(e,t);return function(r){return function(i){return ra(i)?Eg(r):ra(r)?Eg(i):n(r)(i)}}},mL=function(e,t){var n=BT(e,t);return function(r){return function(i){return ra(i)||ra(r)?new Map:n(r)(i)}}},vL=function(e){var t=qT(e);return function(n){return function(r){return ra(r)?Eg(n):ra(n)?Eg(r):t(n)(r)}}},Nie=new Map,Pie=ZW,Wie=pL;const Lie=Object.freeze(Object.defineProperty({__proto__:null,Compactable:KT,Filterable:pL,Functor:dL,URI:ia,collect:YW,compact:Ip,deleteAt:XW,difference:vL,elem:aie,empty:Nie,filter:vie,filterMap:gie,filterMapWithIndex:rL,filterWithIndex:iL,flap:Fie,foldMap:Eie,foldMapWithIndex:kie,fromFoldable:mie,getDifferenceMagma:Iie,getEq:die,getFilterableWithIndex:Oie,getFoldable:Mie,getFoldableWithIndex:lL,getIntersectionSemigroup:Tie,getMonoid:pie,getShow:rie,getTraversableWithIndex:fL,getUnionMonoid:Sie,getUnionSemigroup:cL,getWitherable:Cie,insertAt:Pie,intersection:mL,isEmpty:ra,isSubmap:fie,keys:zT,lookup:eL,lookupWithKey:Rs,map:yie,mapWithIndex:bie,map_:Wie,member:oie,modifyAt:QW,partition:_ie,partitionMap:$ie,partitionMapWithIndex:tL,partitionWithIndex:nL,pop:lie,reduce:wie,reduceRight:Rie,reduceRightWithIndex:Aie,reduceWithIndex:xie,separate:Op,singleton:hie,size:iie,toArray:JW,toUnfoldable:sie,union:hL,updateAt:cie,upsertAt:ZW,values:uie},Symbol.toStringTag,{value:"Module"})),jie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Die=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Uie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Bie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),qie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var gL=function(e){return{concat:$m(e).concat,empty:e.top}},yL=function(e){return{concat:Sm(e).concat,empty:e.bottom}},VT=function(e){return{concat:L_(e).concat,empty:e.empty}},bL=function(e){var t={};for(var n in e)ct.call(e,n)&&(t[n]=e[n].empty);return{concat:j_(e).concat,empty:t}},_L=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:D_.apply(QM,e).concat,empty:e.map(function(n){return n.empty})}},$L=function(e){return B_(e)(e.empty)},zie={concat:HM.concat,empty:void 0},Kie=_L,Vie=bL,Hie=VT,Gie=yL,Yie=gL,Jie=$L,SL={concat:GM.concat,empty:!0},TL={concat:YM.concat,empty:!1},Zie=bM,Xie=function(){return VT(NN())},Qie={concat:JM.concat,empty:""},eoe={concat:ZM.concat,empty:0},toe={concat:XM.concat,empty:1};const noe=Object.freeze(Object.defineProperty({__proto__:null,concatAll:$L,fold:Jie,getDualMonoid:Hie,getEndomorphismMonoid:Xie,getFunctionMonoid:Zie,getJoinMonoid:Gie,getMeetMonoid:Yie,getStructMonoid:Vie,getTupleMonoid:Kie,max:yL,min:gL,monoidAll:SL,monoidAny:TL,monoidProduct:toe,monoidString:Qie,monoidSum:eoe,monoidVoid:zie,reverse:VT,struct:bL,tuple:_L},Symbol.toStringTag,{value:"Module"})),roe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var IL=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},ioe=IL,OL=function(e){return e===-1?1:e===1?-1:0},CL={equals:function(e,t){return e===t}},HT={concat:function(e,t){return e!==0?e:t}},wL={concat:HT.concat,empty:0},ooe=function(e){return e<=-1?-1:e>=1?1:0},aoe=OL,uoe=HT,soe=CL,coe=wL;const loe=Object.freeze(Object.defineProperty({__proto__:null,Eq:CL,Monoid:wL,Semigroup:HT,eqOrdering:soe,invert:aoe,match:ioe,matchW:IL,monoidOrdering:coe,reverse:OL,semigroupOrdering:uoe,sign:ooe},Symbol.toStringTag,{value:"Module"}));var foe=function(e){return typeof e.map=="function"},doe=function(e){return typeof e.contramap=="function"},poe=function(e){return typeof e.mapWithIndex=="function"},hoe=function(e){return typeof e.ap=="function"},moe=function(e){return typeof e.chain=="function"},voe=function(e){return typeof e.bimap=="function"},goe=function(e){return typeof e.extend=="function"},yoe=function(e){return typeof e.reduce=="function"},boe=function(e){return typeof e.reduceWithIndex=="function"},_oe=function(e){return typeof e.alt=="function"},$oe=function(e){return typeof e.compact=="function"},Soe=function(e){return typeof e.filter=="function"},Toe=function(e){return typeof e.filterWithIndex=="function"},Ioe=function(e){return typeof e.promap=="function"},Ooe=function(e){return typeof e.compose=="function"},Coe=function(e){return typeof e.throwError=="function"};function woe(e){var t={};if(foe(e)){var n=function(T){return function($){return e.map($,T)}};t.map=n}if(doe(e)){var r=function(T){return function($){return e.contramap($,T)}};t.contramap=r}if(poe(e)){var i=function(T){return function($){return e.mapWithIndex($,T)}};t.mapWithIndex=i}if(hoe(e)){var o=function(T){return function($){return e.ap($,T)}},a=function(T){return function($){return e.ap(e.map($,function(x){return function(){return x}}),T)}};t.ap=o,t.apFirst=a,t.apSecond=function(T){return function($){return e.ap(e.map($,function(){return function(x){return x}}),T)}}}if(moe(e)){var u=function(T){return function($){return e.chain($,T)}},s=function(T){return function($){return e.chain($,function(x){return e.map(T(x),function(){return x})})}},c=function(T){return e.chain(T,B)};t.chain=u,t.chainFirst=s,t.flatten=c}if(voe(e)){var l=function(T,$){return function(x){return e.bimap(x,T,$)}},f=function(T){return function($){return e.mapLeft($,T)}};t.bimap=l,t.mapLeft=f}if(goe(e)){var d=function(T){return function($){return e.extend($,T)}},p=function(T){return e.extend(T,B)};t.extend=d,t.duplicate=p}if(yoe(e)){var h=function(T,$){return function(x){return e.reduce(x,T,$)}},v=function(T){var $=e.foldMap(T);return function(x){return function(L){return $(L,x)}}},g=function(T,$){return function(x){return e.reduceRight(x,T,$)}};t.reduce=h,t.foldMap=v,t.reduceRight=g}if(boe(e)){var b=function(T,$){return function(x){return e.reduceWithIndex(x,T,$)}},S=function(T){var $=e.foldMapWithIndex(T);return function(x){return function(L){return $(L,x)}}},O=function(T,$){return function(x){return e.reduceRightWithIndex(x,T,$)}};t.reduceWithIndex=b,t.foldMapWithIndex=S,t.reduceRightWithIndex=O}if(_oe(e)){var y=function(T){return function($){return e.alt($,T)}};t.alt=y}if($oe(e)&&(t.compact=e.compact,t.separate=e.separate),Soe(e)){var C=function(T){return function($){return e.filter($,T)}},I=function(T){return function($){return e.filterMap($,T)}},M=function(T){return function($){return e.partition($,T)}},R=function(T){return function($){return e.partitionMap($,T)}};t.filter=C,t.filterMap=I,t.partition=M,t.partitionMap=R}if(Toe(e)){var U=function(T){return function($){return e.filterWithIndex($,T)}},q=function(T){return function($){return e.filterMapWithIndex($,T)}},N=function(T){return function($){return e.partitionWithIndex($,T)}},Z=function(T){return function($){return e.partitionMapWithIndex($,T)}};t.filterWithIndex=U,t.filterMapWithIndex=q,t.partitionWithIndex=N,t.partitionMapWithIndex=Z}if(Ioe(e)){var ee=function(T,$){return function(x){return e.promap(x,T,$)}};t.promap=ee}if(Ooe(e)){var J=function(T){return function($){return e.compose($,T)}};t.compose=J}if(Coe(e)){var ve=function(T){return function($){return $._tag==="None"?e.throwError(T()):e.of($.value)}},Ie=function(T){return T._tag==="Left"?e.throwError(T.left):e.of(T.right)},k=function(T,$){return function(x){return T(x)?e.of(x):e.throwError($(x))}},A=function(T,$){return function(x){return e.chain(x,function(L){return T(L)?e.of(L):e.throwError($(L))})}};t.fromOption=ve,t.fromEither=Ie,t.fromPredicate=k,t.filterOrElse=A}return t}var le=m;const Eoe=Object.freeze(Object.defineProperty({__proto__:null,pipe:le,pipeable:woe},Symbol.toStringTag,{value:"Module"})),Roe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Moe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Rg=function(){return Math.random()};function EL(e,t){return m(Rg,ro(function(n){return Math.floor((t-e+1)*n+e)}))}function xoe(e,t){return m(Rg,ro(function(n){return(t-e)*n+e}))}var koe=m(Rg,ro(function(e){return e<.5})),Aoe=function(e){return m(EL(0,e.length-1),ro(function(t){return e[t]}))};const Foe=Object.freeze(Object.defineProperty({__proto__:null,random:Rg,randomBool:koe,randomElem:Aoe,randomInt:EL,randomRange:xoe},Symbol.toStringTag,{value:"Module"}));var GT=bl(qS),RL=bs(qS),ML=_l(on),Noe=$l(on),xL=to,kL=ML,AL=np(on),Poe=AL,YT=wl(Yo),Woe=YT,FL=YT,Loe=FL,NL=El(Yo),joe=NL,Doe=op(on),Uoe=ap,PL=up,Boe=PL,WL=$s(Yo),qoe=WL,LL=rp(Yo),zoe=LL,Koe=ip(Yo),Voe=Rl(on),qr=function(e,t){return m(e,DL(t))},JT=function(e,t,n){return m(e,UL(t,n))},ZT=function(e,t){return m(e,BL(t))},zl=function(e,t){return m(e,XT(t))},Cp=function(e,t){return m(e,QT(t))},jL=function(e,t){return m(e,eI(t))},DL=Sl(on),UL=Ol(on),BL=Cl(on),XT=Tl(Go),Hoe=XT,ao=RL,QT=_s(Yo),qL=QT,zL=qL(B),Goe=zL,eI=Il(Yo),Yoe=eI,tI=GT,Kt="ReaderEither",KL=function(e){var t=vs(e);return{URI:Kt,_E:void 0,compact:Xi(on,t),separate:Bo(on,t,Ja)}};function Joe(e){var t=vl(e),n=KL(e),r=qo(on,t),i=zo(on,t),o=Xa(on,t),a=Qa(on,t);return{URI:Kt,_E:void 0,map:qr,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}function VL(e){var t=xo(Go,Ya(e));return{URI:Kt,_E:void 0,map:qr,ap:function(n,r){return m(n,t(r))},of:ao}}function HL(e){var t=tp(Yo,e);return{URI:Kt,_E:void 0,map:qr,alt:function(n,r){return m(n,t(r))}}}var nI={URI:Kt,map:qr},Zoe=Ue(nI),Xoe={URI:Kt,of:ao},wp={URI:Kt,map:qr,ap:zl},GL=It(wp),Qoe=GL,YL=Ot(wp),eae=YL,JL={URI:Kt,map:qr,ap:zl,of:ao},oa={URI:Kt,map:qr,ap:zl,chain:Cp},tae={URI:Kt,map:qr,ap:zl,of:ao,chain:Cp},ZL=lt(oa),nae=ZL,rae={URI:Kt,bimap:JT,mapLeft:ZT},iae={URI:Kt,map:qr,alt:jL},Kl={URI:Kt,fromReader:kL},oae=cp(Kl),aae=lp(Kl),uae=Is(Kl),XL=fp(Kl,oa),sae=XL,QL=dp(Kl,oa),cae=QL,lae={URI:Kt,map:qr,ap:zl,of:ao,chain:Cp,throwError:tI},aa={URI:Kt,fromEither:xL},fae=Gi(aa),dae=Yi(aa),pae=is(aa,oa),ej=No(aa,oa),hae=ej,tj=Po(aa,oa),mae=tj,vae=qa(aa),nj=as(aa,oa),gae=nj,yae=br(aa),bae=ao(qt),_ae=Tt(nI),rj=wt(oa),$ae=rj,ij=Ct(wp),Sae=ij,oj=ao(en),aj=function(e){return H(Ts(e),Ss(ep(Yn)))},rI=function(e){var t=aj(e);return function(n){return mt(n)?t(n):oj}},Tae=rI,uj=function(e){return rI(function(t,n){return e(n)})},Iae=uj(B),Oae={URI:Kt,bimap:JT,mapLeft:ZT,map:qr,of:ao,ap:zl,chain:Cp,alt:jL,throwError:GT},Cae=zt(wp),wae=Wr(JL),Eae=function(e){return zt(Go)(Jd(e))};function Rae(e){var t=VL(e),n=HL(e);return{URI:Kt,_E:void 0,map:qr,ap:t.ap,of:ao,chain:Cp,bimap:JT,mapLeft:ZT,alt:n.alt,throwError:tI}}const Mae=Object.freeze(Object.defineProperty({__proto__:null,Alt:iae,ApT:oj,Applicative:JL,Apply:wp,Bifunctor:rae,Chain:oa,Do:bae,FromEither:aa,FromReader:Kl,Functor:nI,Monad:tae,MonadThrow:lae,Pointed:Xoe,URI:Kt,alt:eI,altW:Yoe,ap:XT,apFirst:GL,apFirstW:Qoe,apS:ij,apSW:Sae,apSecond:YL,apSecondW:eae,apW:Hoe,ask:oae,asks:aae,asksReaderEither:Boe,asksReaderEitherW:PL,bimap:UL,bind:rj,bindTo:_ae,bindW:$ae,chain:QT,chainEitherK:ej,chainEitherKW:hae,chainFirst:ZL,chainFirstEitherK:tj,chainFirstEitherKW:mae,chainFirstReaderK:QL,chainFirstReaderKW:cae,chainFirstW:nae,chainOptionK:pae,chainReaderK:XL,chainReaderKW:sae,chainW:qL,filterOrElse:nj,filterOrElseW:gae,flap:Zoe,flatten:Goe,flattenW:zL,fold:Woe,foldW:Loe,fromEither:xL,fromEitherK:yae,fromOption:fae,fromOptionK:dae,fromPredicate:vae,fromReader:kL,fromReaderK:uae,getAltReaderValidation:HL,getApplicativeReaderValidation:VL,getApplyMonoid:wae,getApplySemigroup:Cae,getCompactable:KL,getFilterable:Joe,getOrElse:NL,getOrElseW:joe,getReaderValidation:Rae,getSemigroup:Eae,left:GT,leftReader:Noe,local:Uoe,map:DL,mapLeft:BL,match:AL,matchE:YT,matchEW:FL,matchW:Poe,of:ao,orElse:WL,orElseFirst:LL,orElseFirstW:zoe,orElseW:qoe,orLeft:Koe,readerEither:Oae,right:RL,rightReader:ML,sequenceArray:Iae,swap:Voe,throwError:tI,toUnion:Doe,traverseArray:uj,traverseArrayWithIndex:Tae,traverseReadonlyArrayWithIndex:rI,traverseReadonlyNonEmptyArrayWithIndex:aj},Symbol.toStringTag,{value:"Module"}));function iI(e){return function(t){return function(){return e.of(t)}}}function oI(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function aI(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function uI(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function sI(e){return function(t){return H(t,e.of)}}function xae(e){return function(t){return H(t,e)}}function kae(e){var t=aI(e),n=oI(e),r=uI(e);return{map:function(i,o){return m(i,n(o))},ap:function(i,o){return m(i,t(o))},of:iI(e),chain:function(i,o){return m(i,r(o))},ask:function(){return e.of},asks:function(i){return H(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:sI(e),fromM:function(i){return function(){return i}}}}const Aae=Object.freeze(Object.defineProperty({__proto__:null,ap:aI,chain:uI,fromNaturalTransformation:xae,fromReader:sI,getReaderM:kae,map:oI,of:iI},Symbol.toStringTag,{value:"Module"}));var An=function(e){return function(){return Promise.resolve().then(e)}};function Fae(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var mi=function(e,t){return m(e,ru(t))},Ms=function(e,t){return m(e,sj(t))},cI=function(e,t){return m(e,Ep(function(n){return m(t,ru(n))}))},Vl=function(e,t){return m(e,Ep(t))},ru=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},sj=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},$n=function(e){return function(){return Promise.resolve(e)}},Ep=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},Nae=Ep(B),Fn="Task";function Pae(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:lj}}var Le={URI:Fn,map:mi},Wae=Ue(Le),an={URI:Fn,of:$n},xs={URI:Fn,map:mi,ap:Ms},Lae=It(xs),jae=Ot(xs),Rp={URI:Fn,map:mi,ap:Ms,of:$n},Mg={URI:Fn,map:mi,ap:cI},cj={URI:Fn,map:mi,ap:cI,of:$n},Hl={URI:Fn,map:mi,ap:Ms,chain:Vl},Vt={URI:Fn,map:mi,of:$n,ap:Ms,chain:Vl},Dae={URI:Fn,map:mi,of:$n,ap:Ms,chain:Vl,fromIO:An},Mp=B,Uae={URI:Fn,map:mi,of:$n,ap:Ms,chain:Vl,fromIO:An,fromTask:Mp},Bae=lt(Hl),xg={URI:Fn,fromIO:An},qae=eo(xg),zae=Ko(xg,Hl),Kae=Vo(xg,Hl),Vae={URI:Fn,fromIO:An,fromTask:Mp},lj=function(){return new Promise(function(e){})},Hae=$n(qt),Gae=Tt(Le),Yae=wt(Hl),Jae=Ct(xs),lI=$n(en),Gl=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},fI=function(e){var t=Gl(e);return function(n){return mt(n)?t(n):lI}},dI=function(e){return function(t){return function(){return Lc(t).reduce(function(n,r,i){return n.then(function(o){return Promise.resolve().then(e(i+1,r)).then(function(a){return o.push(a),o})})},Promise.resolve().then(e(0,hr(t))).then(cd))}}},pI=function(e){var t=dI(e);return function(n){return mt(n)?t(n):lI}},Zae=fI,fj=function(e){return fI(function(t,n){return e(n)})},Xae=fj(B),Qae=pI,dj=function(e){return pI(function(t,n){return e(n)})},eue=dj(B),tue={URI:Fn,map:mi,of:$n,ap:Ms,chain:Vl,fromIO:An,fromTask:Mp},nue={URI:Fn,map:mi,of:$n,ap:cI,chain:Vl,fromIO:An,fromTask:Mp},rue=zt(Mg),iue=Wr(cj);const oue=Object.freeze(Object.defineProperty({__proto__:null,ApT:lI,ApplicativePar:Rp,ApplicativeSeq:cj,ApplyPar:xs,ApplySeq:Mg,Chain:Hl,Do:Hae,FromIO:xg,FromTask:Vae,Functor:Le,Monad:Vt,MonadIO:Dae,MonadTask:Uae,Pointed:an,URI:Fn,ap:sj,apFirst:Lae,apS:Jae,apSecond:jae,bind:Yae,bindTo:Gae,chain:Ep,chainFirst:Bae,chainFirstIOK:Kae,chainIOK:zae,delay:Fae,flap:Wae,flatten:Nae,fromIO:An,fromIOK:qae,fromTask:Mp,getMonoid:iue,getRaceMonoid:Pae,getSemigroup:rue,map:ru,never:lj,of:$n,sequenceArray:Xae,sequenceSeqArray:eue,task:tue,taskSeq:nue,traverseArray:fj,traverseArrayWithIndex:Zae,traverseReadonlyArrayWithIndex:fI,traverseReadonlyArrayWithIndexSeq:pI,traverseReadonlyNonEmptyArrayWithIndex:Gl,traverseReadonlyNonEmptyArrayWithIndexSeq:dI,traverseSeqArray:dj,traverseSeqArrayWithIndex:Qae},Symbol.toStringTag,{value:"Module"}));var pj=sI(an),Yl=to,ks=H(An,Yl),aue=ap,hj=up,uue=hj,vi=function(e,t){return m(e,mI(t))},As=function(e,t){return m(e,vI(t))},hI=function(e,t){return m(e,kg(function(n){return m(t,mI(n))}))},Jl=function(e,t){return m(e,kg(t))},mI=oI(Le),vI=aI(xs),sue=vI,zr=iI(an),kg=uI(Vt),mj=kg,vj=mj(B),cue=vj,Sn="ReaderTask",un={URI:Sn,map:vi},lue=Ue(un),xp={URI:Sn,of:zr},kp={URI:Sn,map:vi,ap:As},fue=It(kp),due=Ot(kp),pue={URI:Sn,map:vi,ap:As,of:zr},gI={URI:Sn,map:vi,ap:hI},gj={URI:Sn,map:vi,ap:hI,of:zr},uo={URI:Sn,map:vi,ap:As,chain:Jl},ua={URI:Sn,map:vi,of:zr,ap:As,chain:Jl},hue={URI:Sn,map:vi,of:zr,ap:As,chain:Jl,fromIO:ks},mue={URI:Sn,map:vi,of:zr,ap:As,chain:Jl,fromIO:ks,fromTask:Yl},yj=lt(uo),vue=yj,Ag={URI:Sn,fromIO:ks},gue=eo(Ag),yue=Ko(Ag,uo),bue=Vo(Ag,uo),Zl={URI:Sn,fromReader:pj},_ue=cp(Zl),$ue=lp(Zl),Sue=Is(Zl),bj=fp(Zl,uo),Tue=bj,_j=dp(Zl,uo),Iue=_j,Fg={URI:Sn,fromIO:ks,fromTask:Yl},Oue=Os(Fg),Cue=Ml(Fg,uo),wue=xl(Fg,uo),Eue=zr(qt),Rue=Tt(un),$j=wt(uo),Mue=$j,Sj=Ct(kp),xue=Sj,yI=zr(en),Tj=function(e){return H(Ts(e),Ss(Gl(Yn)))},bI=function(e){var t=Tj(e);return function(n){return mt(n)?t(n):yI}},Ij=function(e){return H(Ts(e),Ss(dI(Yn)))},_I=function(e){var t=Ij(e);return function(n){return mt(n)?t(n):yI}},kue=bI,Oj=function(e){return bI(function(t,n){return e(n)})},Aue=Oj(B),Fue=_I,Cj=function(e){return _I(function(t,n){return e(n)})},Nue=Cj(B),Pue={URI:Sn,map:vi,of:zr,ap:As,chain:Jl,fromIO:ks,fromTask:Yl},Wue={URI:Sn,map:vi,of:zr,ap:hI,chain:Jl,fromIO:ks,fromTask:Yl},Lue=zt(gI),jue=Wr(gj);function Due(e,t){return e(t)()}const Uue=Object.freeze(Object.defineProperty({__proto__:null,ApT:yI,ApplicativePar:pue,ApplicativeSeq:gj,ApplyPar:kp,ApplySeq:gI,Chain:uo,Do:Eue,FromIO:Ag,FromReader:Zl,FromTask:Fg,Functor:un,Monad:ua,MonadIO:hue,MonadTask:mue,Pointed:xp,URI:Sn,ap:vI,apFirst:fue,apS:Sj,apSW:xue,apSecond:due,apW:sue,ask:_ue,asks:$ue,asksReaderTask:uue,asksReaderTaskW:hj,bind:$j,bindTo:Rue,bindW:Mue,chain:kg,chainFirst:yj,chainFirstIOK:bue,chainFirstReaderK:_j,chainFirstReaderKW:Iue,chainFirstTaskK:wue,chainFirstW:vue,chainIOK:yue,chainReaderK:bj,chainReaderKW:Tue,chainTaskK:Cue,chainW:mj,flap:lue,flatten:cue,flattenW:vj,fromIO:ks,fromIOK:gue,fromReader:pj,fromReaderK:Sue,fromTask:Yl,fromTaskK:Oue,getMonoid:jue,getSemigroup:Lue,local:aue,map:mI,of:zr,readerTask:Pue,readerTaskSeq:Wue,run:Due,sequenceArray:Aue,sequenceSeqArray:Nue,traverseArray:Oj,traverseArrayWithIndex:kue,traverseReadonlyArrayWithIndex:bI,traverseReadonlyArrayWithIndexSeq:_I,traverseReadonlyNonEmptyArrayWithIndex:Tj,traverseReadonlyNonEmptyArrayWithIndexSeq:Ij,traverseSeqArray:Cj,traverseSeqArrayWithIndex:Fue},Symbol.toStringTag,{value:"Module"}));var Bue=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},que=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},$I=bl(an),SI=bs(an),Ng=_l(Le),TI=$l(Le),II=H(An,Ng),wj=H(An,TI),iu=II,Xl=Ng,OI=$n,CI=An,Ej=function(e){return ru(vN(e))},Rj=np(Le),zue=Rj,wI=wl(Vt),Kue=wI,Mj=wI,Vue=Mj,xj=El(Vt),Hue=xj,kj=function(e,t){return function(){return Bue(void 0,void 0,void 0,function(){var n;return que(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Da)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Mo(t(n))];case 3:return[2]}})})}},Gue=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return kj(function(){return e.apply(void 0,n)},t)}},Yue=op(Le),Jue=Kv(an),Zue=Vv(an),Xue=FS(Vt),Aj=$s(Vt),Que=Aj,Pg=rp(Vt),ese=Pg,tse=function(e){return Pg(Zj(e))},nse=function(e){return Pg(Xj(e))},rse=ip(Vt),ise=Rl(Le),Fj=function(e){var t=Ej(e);return function(n){return H(n,t)}},Nj=function(e){return function(t){return function(n){return m(n,Ap(Fj(e)(t)))}}},ose=Nj,Pj=function(e){return H(e,CI)},Wj=function(e){return Fp(Pj(e))},ase=Wj,sn=function(e,t){return m(e,MI(t))},ou=function(e,t){return m(e,xI(t))},EI=function(e,t){return m(e,Ap(function(n){return m(t,MI(n))}))},au=function(e,t){return m(e,Ap(t))},Wg=function(e,t,n){return m(e,Lj(t,n))},Lg=function(e,t){return m(e,jj(t))},RI=function(e,t){return m(e,kI(t))},MI=Sl(Le),Lj=Ol(Le),jj=Cl(Le),xI=Tl(xs),use=xI,Ap=_s(Vt),Fp=Ap,Dj=Fp(B),sse=Dj,kI=Il(Vt),cse=kI,Qn=SI,Np=$I,vt="TaskEither";function AI(e,t){var n=xo(e,Ya(t));return{URI:vt,_E:void 0,map:sn,ap:function(r,i){return m(r,n(i))},of:Qn}}function Uj(e){var t=tp(Vt,e);return{URI:vt,_E:void 0,map:sn,alt:function(n,r){return m(n,t(r))}}}var Bj=function(e){var t=vs(e);return{URI:vt,_E:void 0,compact:Xi(Le,t),separate:Bo(Le,t,Ja)}};function lse(e){var t=vl(e),n=Bj(e),r=qo(Le,t),i=zo(Le,t),o=Xa(Le,t),a=Qa(Le,t);return{URI:vt,_E:void 0,map:sn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}var FI={URI:vt,map:sn},fse=Ue(FI),dse={URI:vt,of:Qn},jg={URI:vt,map:sn,ap:ou},qj=It(jg),pse=qj,zj=Ot(jg),hse=zj,mse={URI:vt,map:sn,ap:ou,of:Qn},Kj={URI:vt,map:sn,ap:EI},Vj={URI:vt,map:sn,ap:EI,of:Qn},gi={URI:vt,map:sn,ap:ou,chain:au},vse={URI:vt,map:sn,ap:ou,chain:au,of:Qn},gse={URI:vt,map:sn,ap:ou,chain:au,of:Qn,fromIO:iu},yse={URI:vt,map:sn,ap:ou,chain:au,of:Qn,fromIO:iu,fromTask:Xl},bse={URI:vt,map:sn,ap:ou,chain:au,of:Qn,throwError:Np},Hj=lt(gi),_se=Hj,$se={URI:vt,bimap:Wg,mapLeft:Lg},Sse={URI:vt,map:sn,alt:RI},sa={URI:vt,fromEither:OI},Tse=Gi(sa),Ise=Yi(sa),Ose=is(sa,gi),Gj=No(sa,gi),Cse=Gj,Yj=Po(sa,gi),wse=Yj,Ese=qa(sa),Jj=as(sa,gi),Rse=Jj,Mse=br(sa),Dg={URI:vt,fromIO:iu},Zj=eo(Dg),xse=Ko(Dg,gi),kse=Vo(Dg,gi),Ug={URI:vt,fromIO:iu,fromTask:Xl},Xj=Os(Ug),Ase=Ml(Ug,gi),Fse=xl(Ug,gi);function Nse(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){var r=function(i,o){return i!=null?n(Mo(i)):n(Da(o))};e.apply(null,t.concat(r))})}}}var Pse=function(e,t,n){return NI(e,t,n)},NI=function(e,t,n){return m(e,Fp(function(r){return m(t(r),Ep(function(i){return m(n(r,i),Fp(function(){return $n(i)}))}))}))},Wse=Qn(qt),Lse=Tt(FI),Qj=wt(gi),jse=Qj,eD=Ct(jg),Dse=eD,PI=Qn(en),WI=function(e){return H(Gl(e),ru(ep(Yn)))},LI=function(e){var t=WI(e);return function(n){return mt(n)?t(n):PI}},jI=function(e){return function(t){return function(){return Lc(t).reduce(function(n,r,i){return n.then(function(o){return Bt(o)?n:e(i+1,r)().then(function(a){return Bt(a)?a:(o.right.push(a.right),o)})})},e(0,hr(t))().then(gs(cd)))}}},DI=function(e){var t=jI(e);return function(n){return mt(n)?t(n):PI}},Use=LI,tD=function(e){return LI(function(t,n){return e(n)})},Bse=tD(B),qse=DI,nD=function(e){return DI(function(t,n){return e(n)})},zse=nD(B),Kse={URI:vt,bimap:Wg,mapLeft:Lg,map:sn,of:Qn,ap:ou,chain:au,alt:RI,fromIO:iu,fromTask:Xl,throwError:Np},Vse={URI:vt,bimap:Wg,mapLeft:Lg,map:sn,of:Qn,ap:EI,chain:au,alt:RI,fromIO:iu,fromTask:Xl,throwError:Np},Hse=zt(Kj),Gse=Wr(Vj),Yse=function(e){return zt(Mg)(Jd(e))};function Jse(e){var t=AI(Rp,e),n=Uj(e);return{URI:vt,_E:void 0,map:sn,ap:t.ap,of:Qn,chain:au,bimap:Wg,mapLeft:Lg,alt:n.alt,fromIO:iu,fromTask:Xl,throwError:Np}}const Zse=Object.freeze(Object.defineProperty({__proto__:null,Alt:Sse,ApT:PI,ApplicativePar:mse,ApplicativeSeq:Vj,ApplyPar:jg,ApplySeq:Kj,Bifunctor:$se,Chain:gi,Do:Wse,FromEither:sa,FromIO:Dg,FromTask:Ug,Functor:FI,Monad:vse,MonadIO:gse,MonadTask:yse,MonadThrow:bse,Pointed:dse,URI:vt,alt:kI,altW:cse,ap:xI,apFirst:qj,apFirstW:pse,apS:eD,apSW:Dse,apSecond:zj,apSecondW:hse,apW:use,bimap:Lj,bind:Qj,bindTo:Lse,bindW:jse,bracket:Pse,bracketW:NI,chain:Ap,chainEitherK:Gj,chainEitherKW:Cse,chainFirst:Hj,chainFirstEitherK:Yj,chainFirstEitherKW:wse,chainFirstIOK:kse,chainFirstTaskK:Fse,chainFirstW:_se,chainIOEitherK:ase,chainIOEitherKW:Wj,chainIOK:xse,chainNullableK:Xue,chainOptionK:Ose,chainTaskK:Ase,chainTaskOptionK:ose,chainTaskOptionKW:Nj,chainW:Fp,filterOrElse:Jj,filterOrElseW:Rse,flap:fse,flatten:sse,flattenW:Dj,fold:Kue,foldW:Vue,fromEither:OI,fromEitherK:Mse,fromIO:iu,fromIOEither:CI,fromIOEitherK:Pj,fromIOK:Zj,fromNullable:Jue,fromNullableK:Zue,fromOption:Tse,fromOptionK:Ise,fromPredicate:Ese,fromTask:Xl,fromTaskK:Xj,fromTaskOption:Ej,fromTaskOptionK:Fj,getAltTaskValidation:Uj,getApplicativeTaskValidation:AI,getApplyMonoid:Gse,getApplySemigroup:Hse,getCompactable:Bj,getFilterable:lse,getOrElse:xj,getOrElseW:Hue,getSemigroup:Yse,getTaskValidation:Jse,left:$I,leftIO:wj,leftTask:TI,map:MI,mapLeft:jj,match:Rj,matchE:wI,matchEW:Mj,matchW:zue,of:Qn,orElse:Aj,orElseFirst:Pg,orElseFirstIOK:tse,orElseFirstTaskK:nse,orElseFirstW:ese,orElseW:Que,orLeft:rse,right:SI,rightIO:II,rightTask:Ng,sequenceArray:Bse,sequenceSeqArray:zse,swap:ise,taskEither:Kse,taskEitherSeq:Vse,taskify:Nse,throwError:Np,toUnion:Yue,traverseArray:tD,traverseArrayWithIndex:Use,traverseReadonlyArrayWithIndex:LI,traverseReadonlyArrayWithIndexSeq:DI,traverseReadonlyNonEmptyArrayWithIndex:WI,traverseReadonlyNonEmptyArrayWithIndexSeq:jI,traverseSeqArray:nD,traverseSeqArrayWithIndex:qse,tryCatch:kj,tryCatchK:Gue},Symbol.toStringTag,{value:"Module"}));var uu=to,Bg=bl(xp),UI=bs(xp),BI=H(Ng,uu),rD=H(TI,uu),qI=function(e){return H(e,SI)},iD=function(e){return H(e,$I)},oD=_l(un),Xse=$l(un),zI=H(II,uu),aD=H(wj,uu),uD=zr,sD=qI,su=zI,Ql=BI,KI=H(CI,uu),VI=function(e){return H(e,OI)},cD=np(un),Qse=cD,HI=wl(uo),ece=HI,lD=HI,tce=lD,fD=El(ua),nce=fD,rce=op(un),ice=Kv(xp),oce=Vv(xp),ace=FS(ua),uce=ap,dD=up,sce=dD,pD=$s(ua),cce=pD,hD=rp(ua),lce=hD,fce=ip(ua),dce=Rl(un),mD=function(e){return H(e,KI)},vD=function(e){return ef(mD(e))},pce=vD,GI=function(e){return H(e,uu)},gD=function(e){return ef(GI(e))},hce=gD,yD=function(e){return Gg(GI(e))},mce=yD,YI=function(e){return H(e,VI)},bD=function(e){return ef(YI(e))},vce=bD,_D=function(e){return Gg(YI(e))},gce=_D,cn=function(e,t){return m(e,Pp(t))},cu=function(e,t){return m(e,e1(t))},JI=function(e,t){return m(e,Kg(function(n){return m(t,Pp(n))}))},lu=function(e,t){return m(e,Kg(t))},ZI=function(e,t){return m(e,Vg(t))},qg=function(e,t,n){return m(e,XI(t,n))},zg=function(e,t){return m(e,QI(t))},Pp=Sl(un),XI=Ol(un),QI=Cl(un),e1=Tl(kp),yce=e1,er=UI,Kg=_s(ua),ef=Kg,$D=ef(B),bce=$D,Vg=Il(ua),SD=Vg,Wp=Bg,pt="ReaderTaskEither",TD=function(e){var t=vs(e);return{URI:pt,_E:void 0,compact:Xi(un,t),separate:Bo(un,t,Ja)}};function _ce(e){var t=vl(e),n=TD(e),r=qo(un,t),i=zo(un,t),o=Xa(un,t),a=Qa(un,t);return{URI:pt,_E:void 0,map:cn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}function ID(e,t){var n=xo(Go,AI(e,t));return{URI:pt,_E:void 0,map:cn,ap:function(r,i){return m(r,n(i))},of:er}}function OD(e){var t=tp(ua,e);return{URI:pt,_E:void 0,map:cn,alt:function(n,r){return m(n,t(r))}}}var Fs={URI:pt,map:cn},$ce=Ue(Fs),t1={URI:pt,of:er},Hg={URI:pt,map:cn,ap:cu},CD=It(Hg),Sce=CD,wD=Ot(Hg),Tce=wD,Ice={URI:pt,map:cn,ap:cu,of:er},ED={URI:pt,map:cn,ap:JI},RD={URI:pt,map:cn,ap:JI,of:er},Nn={URI:pt,map:cn,ap:cu,chain:lu},Oce={URI:pt,map:cn,ap:cu,chain:lu,of:er},Cce={URI:pt,map:cn,ap:cu,chain:lu,of:er,fromIO:su},wce={URI:pt,map:cn,ap:cu,chain:lu,of:er,fromIO:su,fromTask:Ql},Ece={URI:pt,map:cn,ap:cu,chain:lu,of:er,throwError:Wp},MD=lt(Nn),Gg=MD,Rce={URI:pt,bimap:qg,mapLeft:zg},Mce={URI:pt,map:cn,alt:ZI},tf={URI:pt,fromReader:sD},xce=cp(tf),kce=lp(tf),Ace=Is(tf),xD=fp(tf,Nn),Fce=xD,kD=dp(tf,Nn),Nce=kD,n1=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return oD(e.apply(void 0,t))}},AD=function(e){return ef(n1(e))},Pce=AD,FD=function(e){return Gg(n1(e))},Wce=FD,ca={URI:pt,fromEither:uD},Lce=Gi(ca),jce=Yi(ca),Dce=is(ca,Nn),ND=No(ca,Nn),Uce=ND,PD=Po(ca,Nn),Bce=PD,qce=qa(ca),WD=as(ca,Nn),zce=WD,Kce=br(ca),Yg={URI:pt,fromIO:su},Vce=eo(Yg),Hce=Ko(Yg,Nn),Gce=Vo(Yg,Nn),Jg={URI:pt,fromIO:su,fromTask:Ql},Yce=Os(Jg),Jce=Ml(Jg,Nn),Zce=xl(Jg,Nn);function Xce(e,t,n){return LD(e,t,n)}function LD(e,t,n){return function(r){return NI(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var Qce=er(qt),ele=Tt(Fs),jD=wt(Nn),tle=jD,DD=Ct(Hg),nle=DD,r1=er(en),UD=function(e){return H(Ts(e),Ss(WI(Yn)))},i1=function(e){var t=UD(e);return function(n){return mt(n)?t(n):r1}},BD=function(e){return H(Ts(e),Ss(jI(Yn)))},o1=function(e){var t=BD(e);return function(n){return mt(n)?t(n):r1}},rle=i1,qD=function(e){return i1(function(t,n){return e(n)})},ile=qD(B),ole=o1,zD=function(e){return o1(function(t,n){return e(n)})},ale=zD(B),ule={URI:pt,map:cn,of:er,ap:cu,chain:lu,alt:ZI,bimap:qg,mapLeft:zg,fromIO:su,fromTask:Ql,throwError:Wp},sle={URI:pt,map:cn,of:er,ap:JI,chain:lu,alt:ZI,bimap:qg,mapLeft:zg,fromIO:su,fromTask:Ql,throwError:Wp},cle=zt(ED),lle=Wr(RD),fle=function(e){return zt(gI)(Jd(e))};function dle(e){var t=ID(Rp,e),n=OD(e);return{URI:pt,_E:void 0,map:cn,of:er,chain:lu,bimap:qg,mapLeft:zg,ap:t.ap,alt:n.alt,fromIO:su,fromTask:Ql,throwError:Wp}}function ple(e,t){return e(t)()}const hle=Object.freeze(Object.defineProperty({__proto__:null,Alt:Mce,ApT:r1,ApplicativePar:Ice,ApplicativeSeq:RD,ApplyPar:Hg,ApplySeq:ED,Bifunctor:Rce,Chain:Nn,Do:Qce,FromEither:ca,FromIO:Yg,FromReader:tf,FromTask:Jg,Functor:Fs,Monad:Oce,MonadIO:Cce,MonadTask:wce,MonadThrow:Ece,Pointed:t1,URI:pt,alt:Vg,altW:SD,ap:e1,apFirst:CD,apFirstW:Sce,apS:DD,apSW:nle,apSecond:wD,apSecondW:Tce,apW:yce,ask:xce,asks:kce,asksReaderTaskEither:sce,asksReaderTaskEitherW:dD,bimap:XI,bind:jD,bindTo:ele,bindW:tle,bracket:Xce,bracketW:LD,chain:Kg,chainEitherK:ND,chainEitherKW:Uce,chainFirst:MD,chainFirstEitherK:PD,chainFirstEitherKW:Bce,chainFirstIOK:Gce,chainFirstReaderEitherK:gce,chainFirstReaderEitherKW:_D,chainFirstReaderK:kD,chainFirstReaderKW:Nce,chainFirstReaderTaskK:Wce,chainFirstReaderTaskKW:FD,chainFirstTaskEitherK:mce,chainFirstTaskEitherKW:yD,chainFirstTaskK:Zce,chainFirstW:Gg,chainIOEitherK:pce,chainIOEitherKW:vD,chainIOK:Hce,chainNullableK:ace,chainOptionK:Dce,chainReaderEitherK:vce,chainReaderEitherKW:bD,chainReaderK:xD,chainReaderKW:Fce,chainReaderTaskK:Pce,chainReaderTaskKW:AD,chainTaskEitherK:hce,chainTaskEitherKW:gD,chainTaskK:Jce,chainW:ef,filterOrElse:WD,filterOrElseW:zce,flap:$ce,flatten:bce,flattenW:$D,fold:ece,foldW:tce,fromEither:uD,fromEitherK:Kce,fromIO:su,fromIOEither:KI,fromIOEitherK:mD,fromIOK:Vce,fromNullable:ice,fromNullableK:oce,fromOption:Lce,fromOptionK:jce,fromPredicate:qce,fromReader:sD,fromReaderEither:VI,fromReaderEitherK:YI,fromReaderK:Ace,fromReaderTaskK:n1,fromTask:Ql,fromTaskEither:uu,fromTaskEitherK:GI,fromTaskK:Yce,getAltReaderTaskValidation:OD,getApplicativeReaderTaskValidation:ID,getApplyMonoid:lle,getApplySemigroup:cle,getCompactable:TD,getFilterable:_ce,getOrElse:fD,getOrElseW:nce,getReaderTaskValidation:dle,getSemigroup:fle,left:Bg,leftIO:aD,leftReader:iD,leftReaderTask:Xse,leftTask:rD,local:uce,map:Pp,mapLeft:QI,match:cD,matchE:HI,matchEW:lD,matchW:Qse,of:er,orElse:pD,orElseFirst:hD,orElseFirstW:lce,orElseW:cce,orLeft:fce,readerTaskEither:ule,readerTaskEitherSeq:sle,right:UI,rightIO:zI,rightReader:qI,rightReaderTask:oD,rightTask:BI,run:ple,sequenceArray:ile,sequenceSeqArray:ale,swap:dce,throwError:Wp,toUnion:rce,traverseArray:qD,traverseArrayWithIndex:rle,traverseReadonlyArrayWithIndex:i1,traverseReadonlyArrayWithIndexSeq:o1,traverseReadonlyNonEmptyArrayWithIndex:UD,traverseReadonlyNonEmptyArrayWithIndexSeq:BD,traverseSeqArray:zD,traverseSeqArrayWithIndex:ole},Symbol.toStringTag,{value:"Module"}));var mle=function(e){return new Set(e)},vle=function(e){return new Set([e])},KD=function(e){return function(t){for(var n=t.length,r=new Set,i=ln(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function gle(e){return new Set(e)}function yle(e){var t=ln(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function ble(e){var t=ln(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function a1(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function _le(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Ee(o,i)}}function u1(e){var t=ln(e);return function(n,r){if(r===void 0){var i=u1(e);return function(a){return i(n,a)}}if(Lp(n))return r;if(Lp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function s1(e){var t=ln(e);return function(n,r){if(r===void 0){var i=s1(e);return function(a){return i(a,n)}}if(Lp(n)||Lp(r))return l1;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function $le(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=ln(e),c=ln(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Ee(a,u)}}}function c1(e){var t=ln(e);return function(n,r){if(r===void 0){var i=c1(e);return function(o){return i(o,n)}}return a1(function(o){return!t(o,r)})(n)}}function VD(e){var t=Zg(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function HD(e,t){var n=Zg(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var GD=function(e){var t=Zg(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function YD(e){var t=ln(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var JD=function(e){return function(t){return function(n){return a1(function(r){return!e.equals(t,r)})(n)}}},Sle=function(e){var t=ln(e),n=JD(e),r=YD(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},Tle=function(e){return ZD(e)(B)};function Ile(e,t){return function(n){var r=ln(e),i=ln(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Ee(o,a)}}function ZD(e){var t=ln(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var l1=new Set,Lp=function(e){return e.size===0},Ole=function(e){return e.size},f1=function(e){return function(t){for(var n=t.values(),r,i=!1;!i&&!(r=n.next()).done;)i=e(r.value);return i}};function d1(e){return Bd(f1(Bd(e)))}function jp(e){var t=ln(e);return function(n,r){if(r===void 0){var i=jp(e);return function(o){return i(o,n)}}return d1(function(o){return t(o,r)})(n)}}function ln(e){return function(t,n){if(n===void 0){var r=ln(e);return function(u){return r(t,u)}}for(var i=n.values(),o,a=!1;!a&&!(o=i.next()).done;)a=e.equals(t,o.value);return a}}var Zg=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Cle="ReadonlySet";function XD(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function QD(e){var t=jp(e);return Pr(function(n,r){return t(n,r)&&t(r,n)})}var eU=function(e){return{concat:u1(e)}},wle=function(e){return{concat:eU(e).concat,empty:l1}},Ele=function(e){return{concat:s1(e)}},Rle=function(e){return{concat:c1(e)}},Mle=KD;const xle=Object.freeze(Object.defineProperty({__proto__:null,URI:Cle,chain:ble,compact:Tle,difference:c1,elem:ln,empty:l1,every:d1,filter:a1,filterMap:ZD,foldMap:HD,fromArray:Mle,fromReadonlyArray:KD,fromSet:mle,getDifferenceMagma:Rle,getEq:QD,getIntersectionSemigroup:Ele,getShow:XD,getUnionMonoid:wle,getUnionSemigroup:eU,insert:YD,intersection:s1,isEmpty:Lp,isSubset:jp,map:yle,partition:_le,partitionMap:$le,reduce:VD,reduceRight:GD,remove:JD,separate:Ile,singleton:vle,size:Ole,some:f1,toReadonlyArray:Zg,toSet:gle,toggle:Sle,union:u1},Symbol.toStringTag,{value:"Module"}));function Ht(e){return e[0]}function Tn(e){return e[1]}var kle=function(e){return[Tn(e),Ht(e)]};function p1(e){return{URI:Sr,_E:void 0,map:Dp,ap:function(t,n){return[Ht(t)(Ht(n)),e.concat(Tn(t),Tn(n))]}}}var tU=function(e){return function(t){return[t,e.empty]}};function Ale(e){var t=p1(e);return{URI:Sr,_E:void 0,map:t.map,ap:t.ap,of:tU(e)}}function h1(e){var t=p1(e);return{URI:Sr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(Ht(n)),o=i[0],a=i[1];return[o,e.concat(Tn(n),a)]}}}function Fle(e){var t=h1(e);return{URI:Sr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:tU(e)}}function Nle(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=Ht(o);u._tag==="Left";)a=e.concat(a,Tn(o)),o=i(u.left),u=Ht(o);return[u.right,e.concat(a,Tn(o))]},n=h1(e);return{URI:Sr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var nU=function(e,t){return m(e,sU(t))},Dp=function(e,t){return m(e,y1(t))},rU=function(e,t,n){return m(e,uU(t,n))},iU=function(e,t){return m(e,b1(t))},oU=function(e,t){return m(e,_1(t))},m1=function(e,t,n){return m(e,$1(t,n))},v1=function(e){var t=S1();return function(n,r){return m(n,t(r))}},g1=function(e,t,n){return m(e,T1(t,n))},aU=function(e){var t=cU(e);return function(n,r){return m(n,t(r))}},uU=function(e,t){return function(n){return[t(Ht(n)),e(Tn(n))]}},y1=function(e){return function(t){return[e(Ht(t)),Tn(t)]}},b1=function(e){return function(t){return[Ht(t),e(Tn(t))]}},sU=function(e){return function(t){return[Ht(t),Tn(e)]}},_1=function(e){return function(t){return[e(t),Tn(t)]}},Xg=Ht,Ple=_1(B),$1=function(e,t){return function(n){return t(e,Ht(n))}},S1=function(){return function(e){return function(t){return e(Ht(t))}}},T1=function(e,t){return function(n){return t(Ht(n),e)}},cU=function(e){return function(t){return function(n){return e.map(t(Ht(n)),function(r){return[r,Tn(n)]})}}},I1=function(e){return function(t){return e.map(Ht(t),function(n){return[n,Tn(t)]})}},Sr="ReadonlyTuple",lU={URI:Sr,map:Dp},Wle=Ue(lU),Lle={URI:Sr,bimap:rU,mapLeft:iU},jle={URI:Sr,compose:nU},Dle={URI:Sr,map:Dp,extend:oU,extract:Xg},Ule={URI:Sr,reduce:m1,foldMap:v1,reduceRight:g1},Ble={URI:Sr,map:Dp,reduce:m1,foldMap:v1,reduceRight:g1,traverse:aU,sequence:I1},qle=y1,zle=b1,Kle={URI:Sr,compose:nU,map:Dp,bimap:rU,mapLeft:iU,extract:Xg,extend:oU,reduce:m1,foldMap:v1,reduceRight:g1,traverse:aU,sequence:I1};const Vle=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Lle,Comonad:Dle,Foldable:Ule,Functor:lU,Semigroupoid:jle,Traversable:Ble,URI:Sr,bimap:uU,compose:sU,duplicate:Ple,extend:_1,extract:Xg,flap:Wle,foldMap:S1,fst:Ht,getApplicative:Ale,getApply:p1,getChain:h1,getChainRec:Nle,getMonad:Fle,map:qle,mapFst:y1,mapLeft:zle,mapSnd:b1,readonlyTuple:Kle,reduce:$1,reduceRight:T1,sequence:I1,snd:Tn,swap:kle,traverse:cU},Symbol.toStringTag,{value:"Module"}));var nf=globalThis&&globalThis.__assign||function(){return nf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},nf.apply(this,arguments)},Hle=Mx,Ns=ci,O1=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Gle=O1(V);function C1(e){if(typeof e=="function")return C1(V)(e);var t=O1(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var w1=C1(V)(function(e,t){return[e,t]});function Yle(e){return function(t){var n=w1(t),r=n.length;return e.unfold(0,function(i){return i<r?fe([n[i],i+1]):ge})}}var fU=v0,dU=ko;function pU(e){return function(t){if(!ct.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Jle=function(e,t){return hU(e,function(){return t})},hU=function(e,t){return function(n){if(!dU(e,n))return ge;var r=Object.assign({},n);return r[e]=t(n[e]),fe(r)}};function Zle(e){var t=pU(e);return function(n){var r=mU(e,n);return At(r)?ge:fe([r.value,t(n)])}}var Xle=Dm,mU=Yu,Qle=Um,efe=g0;function tfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Bc(e[0]):Bc(V).apply(void 0,e)}function nfe(e){return"compare"in e?qc(e):qc(V)(e)}function rfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?zc(e[0]):zc(V).apply(void 0,e)}var ife=xx;function ofe(e){return kx(e)}function E1(e){return Bm(e)}function Up(e){return Kc(e)}var afe=function(e){var t=E1(e);return function(n){return function(r){return e.map(m(r,t(n)),fu)}}},ufe=function(e){var t=E1(e);return function(n){return function(r){return e.map(m(r,t(n)),du)}}},sfe=qm;function cfe(e){return zm(e)}var lfe=Km;function ffe(e){return Vm(e)}function vU(e,t){return Ax(e,t)}var dfe=w1,pfe=function(e){return vU(Tm(),rF)(e)};function hfe(e,t){return y0(e,t)}var mfe=Fx,vfe=Nx,gfe=b0,gU=function(e){var t=_0(e);return function(n){return function(r){return Ns(r)?nf({},n):Ns(n)?nf({},r):t(n)(r)}}},yU=function(e){return function(t){return function(n){return Ns(n)||Ns(t)?{}:$0(e)(t)(n)}}},bU=function(e){return function(t){return Ns(t)?nf({},e):Ns(e)?nf({},t):S0(e)(t)}},yi=mr,Bp=Ju,bi=vr,_i=gr,$i=yr,qp=Zu,zp=Xu,Kp=Qu,Vp=es,Hp=ts,Gp=ns,Yp=rs,_U=Hm,$U=Gm,SU=Ym,TU=Jm,rf=Hi,IU=bd,R1=function(e){return function(t){var n=O1(e);return function(r,i){var o=n(r);if(o.length===0)return t.of({});for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){return d[f]=p,d}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},yfe=T0,bfe=I0,_fe=O0,$fe=C0;function Sfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?$d(e[0]):$d(V).apply(void 0,e)}function Tfe(e){return"compare"in e?Sd(e):Sd(V)(e)}function Ife(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Td(e[0]):Td(V).apply(void 0,e)}var fu=Ao,du=Fo,fn="Record";function Ofe(e){return"compare"in e?Zm(e):Zm(V)(e)}var Cfe=Px,wfe=Wx,OU={URI:fn,map:yi},Efe=Ue(OU),Rfe={URI:fn,map:yi,mapWithIndex:Bp},Mfe=function(e){return{URI:fn,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e)}},xfe=function(e){return{URI:fn,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e),reduceWithIndex:Hp(e),foldMapWithIndex:Gp(e),reduceRightWithIndex:Yp(e)}},Jp={URI:fn,compact:fu,separate:du},kfe={URI:fn,map:yi,compact:fu,separate:du,filter:qp,filterMap:zp,partition:Kp,partitionMap:Vp},Afe={URI:fn,map:yi,mapWithIndex:Bp,compact:fu,separate:du,filter:qp,filterMap:zp,partition:Kp,partitionMap:Vp,filterMapWithIndex:SU,filterWithIndex:TU,partitionMapWithIndex:_U,partitionWithIndex:$U},CU=function(e){return{URI:fn,map:yi,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e),traverse:rf(e),sequence:IU(e)}},Ffe=function(e){return{URI:fn,map:yi,mapWithIndex:Bp,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e),reduceWithIndex:Hp(e),foldMapWithIndex:Gp(e),reduceRightWithIndex:Yp(e),traverse:rf(e),sequence:IU(e),traverseWithIndex:R1(e)}},Nfe=function(e){var t=CU(e);return{URI:fn,map:yi,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e),traverse:t.traverse,sequence:t.sequence,compact:fu,separate:du,filter:qp,filterMap:zp,partition:Kp,partitionMap:Vp,wither:si(t,Jp),wilt:ui(t,Jp)}},wU=function(e){var t=gU(e);return{concat:function(n,r){return t(r)(n)}}},Pfe=function(e){return{concat:wU(e).concat,empty:{}}},Wfe=function(e){var t=yU(e);return{concat:function(n,r){return t(r)(n)}}},Lfe=function(){return{concat:function(e,t){return bU(t)(e)}}},jfe={URI:fn,reduce:bi(V),foldMap:_i(V),reduceRight:$i(V)},Dfe={URI:fn,reduce:bi(V),foldMap:_i(V),reduceRight:$i(V),reduceWithIndex:Hp(V),foldMapWithIndex:Gp(V),reduceRightWithIndex:Yp(V)},M1={URI:fn,map:yi,reduce:bi(V),foldMap:_i(V),reduceRight:$i(V),traverse:rf(V),sequence:Up},Ufe={URI:fn,map:yi,mapWithIndex:Bp,reduce:bi(V),foldMap:_i(V),reduceRight:$i(V),reduceWithIndex:Hp(V),foldMapWithIndex:Gp(V),reduceRightWithIndex:Yp(V),traverse:rf(V),sequence:Up,traverseWithIndex:R1(V)},EU=si(M1,Jp),RU=ui(M1,Jp),Bfe={URI:fn,map:yi,reduce:bi(V),foldMap:_i(V),reduceRight:$i(V),traverse:rf(V),sequence:Up,compact:fu,separate:du,filter:qp,filterMap:zp,partition:Kp,partitionMap:Vp,wither:EU,wilt:RU},qfe={},zfe=fU,Kfe=qx,Vfe={URI:fn,map:yi,reduce:bi(V),foldMap:_i(V),reduceRight:$i(V),traverse:rf(V),sequence:Up,compact:fu,separate:du,filter:qp,filterMap:zp,partition:Kp,partitionMap:Vp,mapWithIndex:Bp,reduceWithIndex:Hp(V),foldMapWithIndex:Gp(V),reduceRightWithIndex:Yp(V),filterMapWithIndex:SU,filterWithIndex:TU,partitionMapWithIndex:_U,partitionWithIndex:$U,traverseWithIndex:R1(V),wither:EU,wilt:RU};const Hfe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Jp,Filterable:kfe,FilterableWithIndex:Afe,Foldable:jfe,FoldableWithIndex:Dfe,Functor:OU,FunctorWithIndex:Rfe,Traversable:M1,TraversableWithIndex:Ufe,URI:fn,Witherable:Bfe,collect:C1,compact:fu,deleteAt:pU,difference:bU,elem:gfe,empty:qfe,every:mfe,filter:yfe,filterMap:bfe,filterMapWithIndex:lfe,filterWithIndex:ffe,flap:Efe,foldMap:Tfe,foldMapWithIndex:nfe,fromEntries:pfe,fromFoldable:vU,fromFoldableMap:hfe,getDifferenceMagma:Lfe,getEq:Cfe,getFoldable:Mfe,getFoldableWithIndex:xfe,getIntersectionSemigroup:Wfe,getMonoid:wfe,getShow:Ofe,getTraversable:CU,getTraversableWithIndex:Ffe,getUnionMonoid:Pfe,getUnionSemigroup:wU,getWitherable:Nfe,has:dU,hasOwnProperty:Kfe,insertAt:zfe,intersection:yU,isEmpty:Ns,isSubrecord:Xle,keys:Gle,lookup:mU,map:efe,mapWithIndex:Qle,modifyAt:hU,partition:_fe,partitionMap:$fe,partitionMapWithIndex:sfe,partitionWithIndex:cfe,pop:Zle,record:Vfe,reduce:Sfe,reduceRight:Ife,reduceRightWithIndex:rfe,reduceWithIndex:tfe,separate:du,sequence:Up,singleton:ife,size:Hle,some:vfe,toArray:w1,toEntries:dfe,toUnfoldable:Yle,traverse:E1,traverseWithIndex:ofe,union:gU,updateAt:Jle,upsertAt:fU,wilt:ufe,wither:afe},Symbol.toStringTag,{value:"Module"}));var Gfe=function(e){return function(t){return gt(e(t))}},Yfe=function(e){return function(t){return M_(e(t))}},Jfe=function(){return function(e){return!0}},Zfe=function(e){return function(t){return!e(t)}},Xfe=function(e){return function(t){return function(n){return t(n)||e(n)}}},Qfe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ede=function(){return function(e){return!1}},tde=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const nde=Object.freeze(Object.defineProperty({__proto__:null,and:Qfe,compose:tde,fromEitherK:Yfe,fromOptionK:Gfe,id:Jfe,not:Zfe,or:Xfe,zero:ede},Symbol.toStringTag,{value:"Module"}));var MU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(n,r){return e.map(function(i,o){return i.add(n[o],r[o])})},zero:e.map(function(n){return n.zero}),mul:function(n,r){return e.map(function(i,o){return i.mul(n[o],r[o])})},one:e.map(function(n){return n.one}),sub:function(n,r){return e.map(function(i,o){return i.sub(n[o],r[o])})}}},rde=function(e){return function(t){return e.sub(e.zero,t)}},ide=MU,ode=_M;const ade=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:ode,getTupleRing:ide,negate:rde,tuple:MU},Symbol.toStringTag,{value:"Module"})),ude=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var sde=w_;const cde=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:sde},Symbol.toStringTag,{value:"Module"}));var lde=XD,fde=QD;function dde(e){var t=tr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function pde(e){var t=tr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function x1(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function hde(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Ee(o,i)}}function k1(e){var t=tr(e);return function(n,r){if(r===void 0){var i=k1(e);return function(a){return i(n,a)}}if(Zp(n))return r;if(Zp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function A1(e){var t=tr(e);return function(n,r){if(r===void 0){var i=A1(e);return function(a){return i(a,n)}}if(Zp(n)||Zp(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function mde(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=tr(e),c=tr(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Ee(a,u)}}}function F1(e){var t=tr(e);return function(n,r){if(r===void 0){var i=F1(e);return function(o){return i(o,n)}}return x1(function(o){return!t(o,r)})(n)}}var xU=function(e){return{concat:k1(e)}},vde=function(e){return{concat:xU(e).concat,empty:new Set}},gde=function(e){return{concat:A1(e)}},yde=function(e){return{concat:F1(e)}},bde=VD,_de=HD,$de=GD,Sde=function(e){return new Set([e])};function kU(e){var t=tr(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var AU=function(e){return function(t){return function(n){return x1(function(r){return!e.equals(t,r)})(n)}}},Tde=function(e){var t=tr(e),n=AU(e),r=kU(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},FU=function(e){return function(t){for(var n=t.length,r=new Set,i=tr(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},Ide=function(e){return NU(e)(B)};function Ode(e,t){return function(n){var r=tr(e),i=tr(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Ee(o,a)}}function NU(e){var t=tr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var Cde=new Set,Zp=function(e){return e.size===0},wde=function(e){return e.size},Ede=f1,PU=d1,Rde=jp,tr=ln,WU=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Mde=jp;const xde=Object.freeze(Object.defineProperty({__proto__:null,chain:pde,compact:Ide,difference:F1,elem:tr,empty:Cde,every:PU,filter:x1,filterMap:NU,foldMap:_de,fromArray:FU,getDifferenceMagma:yde,getEq:fde,getIntersectionSemigroup:gde,getShow:lde,getUnionMonoid:vde,getUnionSemigroup:xU,insert:kU,intersection:A1,isEmpty:Zp,isSubset:Rde,map:dde,partition:hde,partitionMap:mde,reduce:bde,reduceRight:$de,remove:AU,separate:Ode,singleton:Sde,size:wde,some:Ede,subset:Mde,toArray:WU,toggle:Tde,union:k1},Symbol.toStringTag,{value:"Module"}));var LU=function(e){return{show:function(t){var n="{";for(var r in e)ct.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},jU=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(n){return"[".concat(n.map(function(r,i){return e[i].show(r)}).join(", "),"]")}}},kde=jU,Ade=LU,Fde={show:function(e){return JSON.stringify(e)}},Nde={show:function(e){return JSON.stringify(e)}},Pde={show:function(e){return JSON.stringify(e)}};const Wde=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:Ade,getTupleShow:kde,showBoolean:Fde,showNumber:Pde,showString:Nde,struct:LU,tuple:jU},Symbol.toStringTag,{value:"Module"}));function N1(e){return function(t){return function(n){return e.of([t,n])}}}function P1(e){return function(t){return function(n){return function(r){return e.map(n(r),function(i){var o=i[0],a=i[1];return[t(o),a]})}}}}function W1(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return e.map(t(a),function(u){var s=u[0],c=u[1];return[o(s),c]})})}}}}function L1(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return t(o)(a)})}}}}function j1(e){return function(t){return function(n){return e.of(t(n))}}}function D1(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function U1(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function B1(e){return function(t){return function(n){return e.map(n(t),Tn)}}}function Lde(e){var t=W1(e),n=P1(e),r=L1(e),i=U1(e),o=B1(e);return{map:function(a,u){return m(a,n(u))},ap:function(a,u){return m(a,t(u))},of:N1(e),chain:function(a,u){return m(a,r(u))},get:function(){return function(a){return e.of([a,a])}},put:function(a){return function(){return e.of([void 0,a])}},modify:function(a){return function(u){return e.of([void 0,a(u)])}},gets:function(a){return function(u){return e.of([a(u),u])}},fromState:j1(e),fromM:D1(e),evalState:function(a,u){return m(a,i(u))},execState:function(a,u){return m(a,o(u))}}}const jde=Object.freeze(Object.defineProperty({__proto__:null,ap:W1,chain:L1,evaluate:U1,execute:B1,fromF:D1,fromState:j1,getStateM:Lde,map:P1,of:N1},Symbol.toStringTag,{value:"Module"}));var q1=function(e){return function(){return Bg(e)}},z1=N1(t1);function DU(e){return Si(BI(e))}function Dde(e){return Si(rD(e))}function UU(e){return Si(qI(e))}function Ude(e){return Si(iD(e))}function BU(e){return Si(zI(e))}function Bde(e){return Si(aD(e))}var qde=function(e){return H(e,UI)},zde=function(e){return function(t){return Bg(e(t)[0])}},qU=Za(function(e){return q1(e)},z1),zU=UU,Ps=BU,Xp=DU,KU=j1(t1),VU=function(e){return Si(uu(e))},HU=function(e){return Si(KI(e))},Kde=function(e){return Si(VI(e))},Si=D1(Fs),Vde=function(e){return function(t){return H(t,ap(e))}},GU=function(e){return function(t){return function(n){return e(n)(t)(n)}}},Hde=GU,YU=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return HU(e.apply(void 0,t))}},JU=function(e){return function(t){return m(t,Qp(YU(e)))}},Gde=JU,ZU=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return VU(e.apply(void 0,t))}},XU=function(e){return function(t){return m(t,Qp(ZU(e)))}},Yde=XU,QU=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Si(e.apply(void 0,t))}},eB=function(e){return function(t){return m(t,Qp(QU(e)))}},Jde=eB,Ti=function(e,t){return m(e,tB(t))},la=function(e,t){return m(e,V1(t))},Ws=function(e,t){return m(e,H1(t))},K1=function(e,t){return function(n){return m(e(n),Vg(function(){return t()(n)}))}},Qg=function(e,t,n){return function(r){return m(e(r),XI(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},ey=function(e,t){return function(n){return m(e(n),QI(t))}},tB=P1(Fs),Zde=function(e,t){return function(n){return Qg(n,e,t)}},Xde=function(e){return function(t){return ey(t,e)}},V1=W1(Nn),Qde=V1,so=z1,H1=L1(Nn),Qp=H1,nB=Qp(B),epe=nB,rB=function(e){return function(t){return function(n){return m(t(n),SD(function(){return e()(n)}))}}},tpe=rB,ty=q1,jt="StateReaderTaskEither",G1={URI:jt,map:Ti},npe=Ue(G1),rpe={URI:jt,of:so},ny={URI:jt,map:Ti,ap:la},iB=It(ny),ipe=iB,oB=Ot(ny),ope=oB,ape={URI:jt,map:Ti,ap:la,of:so},nr={URI:jt,map:Ti,ap:la,chain:Ws},Ls={URI:jt,fromState:KU},upe=vP(Ls),spe=gP(Ls),cpe=yP(Ls),lpe=bP(Ls),fpe=JS(Ls),dpe=_P(Ls,nr),ppe={URI:jt,map:Ti,ap:la,of:so,chain:Ws},hpe={URI:jt,map:Ti,ap:la,of:so,chain:Ws,fromIO:Ps},mpe={URI:jt,map:Ti,ap:la,of:so,chain:Ws,fromIO:Ps,fromTask:Xp},vpe={URI:jt,map:Ti,ap:la,of:so,chain:Ws,throwError:ty},aB=lt(nr),gpe=aB,ype={URI:jt,bimap:Qg,mapLeft:ey},bpe={URI:jt,map:Ti,alt:K1},of={URI:jt,fromReader:zU},_pe=cp(of),$pe=lp(of),Spe=Is(of),uB=fp(of,nr),Tpe=uB,sB=dp(of,nr),Ipe=sB,fa={URI:jt,fromEither:qU},Ope=Gi(fa),Cpe=Yi(fa),wpe=is(fa,nr),cB=No(fa,nr),Epe=cB,lB=Po(fa,nr),Rpe=lB,Mpe=qa(fa),fB=as(fa,nr),xpe=fB,kpe=br(fa),ry={URI:jt,fromIO:Ps},Ape=eo(ry),Fpe=Ko(ry,nr),Npe=Vo(ry,nr),iy={URI:jt,fromIO:Ps,fromTask:Xp},Ppe=Os(iy),Wpe=Ml(iy,nr),Lpe=xl(iy,nr),jpe=U1(Fs),Dpe=B1(Fs),Upe=Tt(G1),dB=wt(nr),Bpe=dB,pB=Ct(ny),qpe=pB,hB=function(e){return function(t){return function(n){return function(r){return function(){return Lc(t).reduce(function(i,o,a){return i.then(function(u){return Bt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Bt(s))return s;var c=s.right,l=c[0],f=c[1];return u.right[0].push(l),u.right[1]=f,u})})},e(0,hr(t))(n)(r)().then(gs(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},Y1=function(e){var t=hB(e);return function(n){return mt(n)?t(n):so(en)}},zpe=Y1,mB=function(e){return Y1(function(t,n){return e(n)})},Kpe=mB(B),Vpe={URI:jt,map:Ti,of:so,ap:la,chain:Ws,bimap:Qg,mapLeft:ey,alt:K1,fromIO:Ps,fromTask:Xp,throwError:ty},Hpe={URI:jt,map:Ti,of:so,ap:la,chain:Ws,bimap:Qg,mapLeft:ey,alt:K1,fromIO:Ps,fromTask:Xp,throwError:ty},Gpe=function(e,t){return m(e(t),Pp(function(n){var r=n[0];return r}))},Ype=function(e,t){return m(e(t),Pp(function(n){n[0];var r=n[1];return r}))};function Jpe(e,t,n){return e(t)(n)()}const Zpe=Object.freeze(Object.defineProperty({__proto__:null,Alt:bpe,Applicative:ape,Apply:ny,Bifunctor:ype,Chain:nr,FromEither:fa,FromIO:ry,FromReader:of,FromState:Ls,FromTask:iy,Functor:G1,Monad:ppe,MonadIO:hpe,MonadTask:mpe,MonadThrow:vpe,Pointed:rpe,URI:jt,alt:tpe,altW:rB,ap:V1,apFirst:iB,apFirstW:ipe,apS:pB,apSW:qpe,apSecond:oB,apSecondW:ope,apW:Qde,ask:_pe,asks:$pe,asksStateReaderTaskEither:Hde,asksStateReaderTaskEitherW:GU,bimap:Zde,bind:dB,bindTo:Upe,bindW:Bpe,chain:H1,chainEitherK:cB,chainEitherKW:Epe,chainFirst:aB,chainFirstEitherK:lB,chainFirstEitherKW:Rpe,chainFirstIOK:Npe,chainFirstReaderK:sB,chainFirstReaderKW:Ipe,chainFirstTaskK:Lpe,chainFirstW:gpe,chainIOEitherK:Gde,chainIOEitherKW:JU,chainIOK:Fpe,chainOptionK:wpe,chainReaderK:uB,chainReaderKW:Tpe,chainReaderTaskEitherK:Jde,chainReaderTaskEitherKW:eB,chainStateK:dpe,chainTaskEitherK:Yde,chainTaskEitherKW:XU,chainTaskK:Wpe,chainW:Qp,evalState:Gpe,evaluate:jpe,execState:Ype,execute:Dpe,filterOrElse:fB,filterOrElseW:xpe,flap:npe,flatten:epe,flattenW:nB,fromEither:qU,fromEitherK:kpe,fromIO:Ps,fromIOEither:HU,fromIOEitherK:YU,fromIOK:Ape,fromOption:Ope,fromOptionK:Cpe,fromPredicate:Mpe,fromReader:zU,fromReaderEither:Kde,fromReaderK:Spe,fromReaderTaskEither:Si,fromReaderTaskEitherK:QU,fromState:KU,fromStateK:fpe,fromTask:Xp,fromTaskEither:VU,fromTaskEitherK:ZU,fromTaskK:Ppe,get:upe,gets:lpe,left:q1,leftIO:Bde,leftReader:Ude,leftState:zde,leftTask:Dde,local:Vde,map:tB,mapLeft:Xde,modify:cpe,of:so,put:spe,right:z1,rightIO:BU,rightReader:UU,rightState:qde,rightTask:DU,run:Jpe,sequenceArray:Kpe,stateReaderTaskEither:Vpe,stateReaderTaskEitherSeq:Hpe,throwError:ty,traverseArray:mB,traverseArrayWithIndex:zpe,traverseReadonlyArrayWithIndex:Y1,traverseReadonlyNonEmptyArrayWithIndex:hB},Symbol.toStringTag,{value:"Module"}));function Xpe(e){return function(t){return{peek:t.peek,pos:e}}}function Qpe(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function ehe(e){return function(t){return t.peek(e(t.pos))}}function the(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var vB=function(e,t){return m(e,yB(t))},nhe=function(e,t){return m(e,J1(t))},J1=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},gB=function(e){return e.peek(e.pos)},rhe=J1(B),yB=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},Z1="Store",bB={URI:Z1,map:vB},ihe=Ue(bB),_B={URI:Z1,map:vB,extend:nhe,extract:gB},ohe=_B;const ahe=Object.freeze(Object.defineProperty({__proto__:null,Comonad:_B,Functor:bB,URI:Z1,duplicate:rhe,experiment:the,extend:J1,extract:gB,flap:ihe,map:yB,peeks:ehe,seek:Xpe,seeks:Qpe,store:ohe},Symbol.toStringTag,{value:"Module"}));function X1(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function $B(e,t){var n=X1(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),B,function(o){return[o,o]}))}}function uhe(e){return X1(e,e)}function she(e){return $B(e,e)}const che=Object.freeze(Object.defineProperty({__proto__:null,fanOut:$B,fanout:she,split:X1,splitStrong:uhe},Symbol.toStringTag,{value:"Module"}));var lhe=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},fhe=function(e){return function(t){var n={};for(var r in t)ct.call(t,r)&&(n[r]=e[r](t[r]));return n}};const dhe=Object.freeze(Object.defineProperty({__proto__:null,evolve:fhe,getAssignSemigroup:lhe},Symbol.toStringTag,{value:"Module"}));var phe=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},hhe=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},SB=gp(an),mhe=TT(an),vhe=$n,TB=IT(an),eh=function(e){return oy(An(e))},oy=ig(Le),ghe=ru(pl),IB=OT(Le),yhe=IB,Q1=sg(Hl),bhe=Q1,OB=Q1,_he=OB,CB=cg(Vt),$he=CB,She=og(an),wB=function(e){return function(){return phe(void 0,void 0,void 0,function(){return hhe(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(fe)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,ge];case 3:return[2]}})})}},The=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return wB(function(){return e.apply(void 0,t)})}},Ihe=ag(an),Ohe=$T(Vt),Che=ug(an),whe=ST(Vt),eO=lg(Le),EB=fg(xs),co=SB,ay=Pl(Vt),Ehe=ay(B),tO=dg(Vt),Rhe=tO,uy=yp(an),Mhe=uy(),nO=Xi(Le,ds),rO=Bo(Le,ds,cl),RB=qo(Le,jo),MB=zo(Le,jo),xB=Xa(Le,jo),kB=Qa(Le,jo),Kr=function(e,t){return m(e,eO(t))},js=function(e,t){return m(e,EB(t))},sy=function(e,t){return m(e,ay(t))},AB=function(e,t){return m(e,tO(t))},xhe=function(e,t){return m(e,RB(t))},khe=function(e,t){return m(e,MB(t))},Ahe=function(e,t){return m(e,xB(t))},Fhe=function(e,t){return m(e,kB(t))},Gt="TaskOption",iO={URI:Gt,map:Kr},Nhe=Ue(iO),FB={URI:Gt,of:co},cy={URI:Gt,map:Kr,ap:js},Phe=It(cy),Whe=Ot(cy),Lhe={URI:Gt,map:Kr,ap:js,of:co},NB=function(e,t){return m(e,ay(function(n){return m(t,eO(n))}))},jhe={URI:Gt,map:Kr,ap:NB},Dhe={URI:Gt,map:Kr,ap:NB,of:co},da={URI:Gt,map:Kr,ap:js,chain:sy},Uhe=lt(da),Bhe={URI:Gt,map:Kr,alt:AB},PB={URI:Gt,zero:uy},qhe=Zc(PB,FB),zhe={URI:Gt,map:Kr,ap:js,of:co,alt:AB,zero:uy},Khe={URI:Gt,map:Kr,ap:js,of:co,chain:sy},Vhe={URI:Gt,map:Kr,ap:js,of:co,chain:sy,fromIO:eh},Hhe={URI:Gt,map:Kr,ap:js,of:co,chain:sy,fromIO:eh,fromTask:oy},Ghe={URI:Gt,compact:nO,separate:rO},Yhe={URI:Gt,map:Kr,compact:nO,separate:rO,filter:xhe,filterMap:khe,partition:Ahe,partitionMap:Fhe},ly={URI:Gt,fromIO:eh},Jhe=eo(ly),Zhe=Ko(ly,da),Xhe=Vo(ly,da),fy={URI:Gt,fromEither:TB},Qhe=br(fy),eme=No(fy,da),tme=Po(fy,da),dy={URI:Gt,fromIO:eh,fromTask:oy},nme=Os(dy),rme=Ml(dy,da),ime=xl(dy,da),ome=co(qt),ame=Tt(iO),ume=wt(da),sme=Ct(cy),oO=co(en),WB=function(e){return H(Gl(e),ru(Bv(Yn)))},aO=function(e){var t=WB(e);return function(n){return mt(n)?t(n):oO}},LB=function(e){return function(t){return function(){return Lc(t).reduce(function(n,r,i){return n.then(function(o){return At(o)?n:e(i+1,r)().then(function(a){return At(a)?a:(o.value.push(a.value),o)})})},e(0,hr(t))().then(Zi(cd)))}}},uO=function(e){var t=LB(e);return function(n){return mt(n)?t(n):oO}},cme=aO,jB=function(e){return aO(function(t,n){return e(n)})},lme=jB(B),fme=uO,DB=function(e){return uO(function(t,n){return e(n)})},dme=DB(B);const pme=Object.freeze(Object.defineProperty({__proto__:null,Alt:Bhe,Alternative:zhe,ApT:oO,ApplicativePar:Lhe,ApplicativeSeq:Dhe,ApplyPar:cy,ApplySeq:jhe,Chain:da,Compactable:Ghe,Do:ome,Filterable:Yhe,FromEither:fy,FromIO:ly,FromTask:dy,Functor:iO,Monad:Khe,MonadIO:Vhe,MonadTask:Hhe,Pointed:FB,Zero:PB,alt:tO,altW:Rhe,ap:EB,apFirst:Phe,apS:sme,apSecond:Whe,bind:ume,bindTo:ame,chain:ay,chainEitherK:eme,chainFirst:Uhe,chainFirstEitherK:tme,chainFirstIOK:Xhe,chainFirstTaskK:ime,chainIOK:Zhe,chainNullableK:Ohe,chainOptionK:whe,chainTaskK:rme,compact:nO,filter:RB,filterMap:MB,flap:Nhe,flatten:Ehe,fold:bhe,foldW:_he,fromEither:TB,fromEitherK:Qhe,fromIO:eh,fromIOK:Jhe,fromNullable:She,fromNullableK:Ihe,fromOption:vhe,fromOptionK:Che,fromPredicate:mhe,fromTask:oy,fromTaskEither:ghe,fromTaskK:nme,getOrElse:CB,getOrElseW:$he,guard:qhe,map:eO,match:IB,matchE:Q1,matchEW:OB,matchW:yhe,none:Mhe,of:co,partition:xB,partitionMap:kB,separate:rO,sequenceArray:lme,sequenceSeqArray:dme,some:SB,traverseArray:jB,traverseArrayWithIndex:cme,traverseReadonlyArrayWithIndex:aO,traverseReadonlyArrayWithIndexSeq:uO,traverseReadonlyNonEmptyArrayWithIndex:WB,traverseReadonlyNonEmptyArrayWithIndexSeq:LB,traverseSeqArray:DB,traverseSeqArrayWithIndex:fme,tryCatch:wB,tryCatchK:The,zero:uy},Symbol.toStringTag,{value:"Module"}));var Ge=function(e){return e._tag==="Left"},Rt=function(e){return e._tag==="Right"};function Ds(e){return e._tag==="Both"}function dn(e){return{_tag:"Left",left:e}}function rr(e){return{_tag:"Right",right:e}}function et(e,t){return{_tag:"Both",left:e,right:t}}var sO=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},hme=sO,pu=sO,mme=pu,UB=pu(rr,dn,function(e,t){return et(t,e)});function vme(e,t){return{show:pu(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function gme(e,t){return Pr(function(n,r){return Ge(n)?Ge(r)&&e.equals(n.left,r.left):Rt(n)?Rt(r)&&t.equals(n.right,r.right):Ds(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function BB(e,t){return{concat:function(n,r){return Ge(n)?Ge(r)?dn(e.concat(n.left,r.left)):Rt(r)?et(n.left,r.right):et(e.concat(n.left,r.left),r.right):Rt(n)?Ge(r)?et(r.left,n.right):Rt(r)?rr(t.concat(n.right,r.right)):et(r.left,t.concat(n.right,r.right)):Ge(r)?et(e.concat(n.left,r.left),n.right):Rt(r)?et(n.left,t.concat(n.right,r.right)):et(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var py=function(e){return{URI:Tr,_E:void 0,map:Us,ap:function(t,n){return Ge(t)?Ge(n)?dn(e.concat(t.left,n.left)):Rt(n)?dn(t.left):dn(e.concat(t.left,n.left)):Rt(t)?Ge(n)?dn(n.left):Rt(n)?rr(t.right(n.right)):et(n.left,t.right(n.right)):Ge(n)?dn(e.concat(t.left,n.left)):Rt(n)?et(t.left,t.right(n.right)):et(e.concat(t.left,n.left),t.right(n.right))}}};function yme(e){var t=py(e);return{URI:Tr,_E:void 0,map:Us,ap:t.ap,of:th}}function qB(e){var t=py(e),n=function(r,i){if(Ge(r))return r;if(Rt(r))return i(r.right);var o=i(r.right);return Ge(o)?dn(e.concat(r.left,o.left)):Rt(o)?et(r.left,o.right):et(e.concat(r.left,o.left),o.right)};return{URI:Tr,_E:void 0,map:Us,ap:t.ap,chain:n}}function bme(e){var t=qB(e);return{URI:Tr,_E:void 0,map:Us,of:th,ap:t.ap,chain:t.chain,throwError:dn}}function _me(e){return Ge(e)?fe(e.left):Rt(e)?ge:fe(e.left)}function $me(e){return Ge(e)?ge:(Rt(e),fe(e.right))}function Sme(e){return function(t){return At(t)?dn(e):et(e,t.value)}}function Tme(e){return function(t){return At(t)?rr(e):et(t.value,e)}}function Ime(e){return Ge(e)?fe(e.left):ge}function Ome(e){return Rt(e)?fe(e.right):ge}var Cme=function(e,t){return At(e)?At(t)?ge:fe(rr(t.value)):At(t)?fe(dn(e.value)):fe(et(e.value,t.value))},Us=function(e,t){return m(e,hO(t))},zB=function(e,t,n){return m(e,dO(t,n))},KB=function(e,t){return m(e,pO(t))},cO=function(e,t,n){return m(e,HB(t,n))},lO=function(e){var t=GB(e);return function(n,r){return m(n,t(r))}},fO=function(e,t,n){return m(e,YB(t,n))},VB=function(e){var t=JB(e);return function(n,r){return m(n,t(r))}},dO=function(e,t){return function(n){return Ge(n)?dn(e(n.left)):Rt(n)?rr(t(n.right)):et(e(n.left),t(n.right))}},pO=function(e){return function(t){return Ge(t)?dn(e(t.left)):Ds(t)?et(e(t.left),t.right):t}},hO=function(e){return function(t){return Ge(t)?t:Rt(t)?rr(e(t.right)):et(t.left,e(t.right))}},HB=function(e,t){return function(n){return Ge(n)?e:t(e,n.right)}},GB=function(e){return function(t){return function(n){return Ge(n)?e.empty:t(n.right)}}},YB=function(e,t){return function(n){return Ge(n)?e:t(n.right,e)}},JB=function(e){return function(t){return function(n){return Ge(n)?e.of(n):Rt(n)?e.map(t(n.right),rr):e.map(t(n.right),function(r){return et(n.left,r)})}}},mO=function(e){return function(t){return Ge(t)?e.of(t):Rt(t)?e.map(t.right,rr):e.map(t.right,function(n){return et(t.left,n)})}},th=rr,Tr="These",vO={URI:Tr,map:Us},wme=Ue(vO),Eme={URI:Tr,of:th},Rme={URI:Tr,bimap:zB,mapLeft:KB},Mme={URI:Tr,fromThese:B},xme={URI:Tr,reduce:cO,foldMap:lO,reduceRight:fO},kme={URI:Tr,map:Us,reduce:cO,foldMap:lO,reduceRight:fO,traverse:VB,sequence:mO},gO={URI:Tr,fromEither:B},Ame=Gi(gO),Fme=Yi(gO),Nme=function(e){return function(t){return function(n){return Ge(n)?!1:e.equals(t,n.right)}}},Pme=function(e){return function(t){return Ge(t)?!1:e(t.right)}},yO=function(e,t){return function(n){return Ge(n)?[n.left,t()]:Rt(n)?[e(),n.right]:[n.left,n.right]}},Wme=function(e,t){return yO(function(){return e},function(){return t})},ZB=th(en),bO=function(e){return function(t){return function(n){var r=ge,i=t(0,hr(n));if(Ge(i))return i;Ds(i)&&(r=fe(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ge(u))return u;Ds(u)&&(r=At(r)?fe(u.left):fe(e.concat(r.value,u.left))),o.push(u.right)}return At(r)?rr(o):et(r.value,o)}}},Lme=function(e){return function(t){var n=bO(e)(t);return function(r){return mt(r)?n(r):ZB}}},jme={URI:Tr,map:Us,bimap:zB,mapLeft:KB,reduce:cO,foldMap:lO,reduceRight:fO,traverse:VB,sequence:mO};const Dme=Object.freeze(Object.defineProperty({__proto__:null,ApT:ZB,Bifunctor:Rme,Foldable:xme,FromEither:gO,FromThese:Mme,Functor:vO,Pointed:Eme,Traversable:kme,URI:Tr,bimap:dO,both:et,elem:Nme,exists:Pme,flap:wme,fold:mme,foldMap:GB,foldW:hme,fromOption:Ame,fromOptionK:Fme,fromOptions:Cme,getApplicative:yme,getApply:py,getChain:qB,getEq:gme,getLeft:_me,getLeftOnly:Ime,getMonad:bme,getRight:$me,getRightOnly:Ome,getSemigroup:BB,getShow:vme,isBoth:Ds,isLeft:Ge,isRight:Rt,left:dn,leftOrBoth:Sme,map:hO,mapLeft:pO,match:pu,matchW:sO,of:th,reduce:HB,reduceRight:YB,right:rr,rightOrBoth:Tme,sequence:mO,swap:UB,these:jme,toTuple:Wme,toTuple2:yO,traverse:JB,traverseReadonlyArrayWithIndex:Lme,traverseReadonlyNonEmptyArrayWithIndex:bO},Symbol.toStringTag,{value:"Module"}));function hy(e){return H(rr,e.of)}function my(e){return H(dn,e.of)}function _O(e){return H(et,e.of)}function $O(e){return function(t){return e.map(t,rr)}}function SO(e){return function(t){return e.map(t,dn)}}function TO(e){return Pc(e,vO)}function IO(e,t){return xo(e,py(t))}function OO(e,t){var n=my(e);return function(r){return function(i){return e.chain(i,pu(n,r,function(o,a){return e.map(r(a),pu(function(u){return dn(t.concat(o,u))},function(u){return et(o,u)},function(u,s){return et(t.concat(o,u),s)}))}))}}}function CO(e){return function(t,n){return function(r){return e.map(r,dO(t,n))}}}function wO(e){return function(t){return function(n){return e.map(n,pO(t))}}}function XB(e){return function(t,n,r){return function(i){return e.map(i,pu(t,n,r))}}}function EO(e){return function(t,n,r){return function(i){return e.chain(i,pu(t,n,r))}}}function RO(e){return function(t){return e.map(t,UB)}}function MO(e){return function(t,n){return function(r){return e.map(r,yO(t,n))}}}function Ume(e){var t=TO(e),n=CO(e),r=wO(e),i=EO(e),o=MO(e),a=hy(e),u=function(s,c){return m(s,t(c))};return{map:u,bimap:function(s,c,l){return m(s,n(c,l))},mapLeft:function(s,c){return m(s,r(c))},fold:function(s,c,l,f){return m(s,i(c,l,f))},swap:RO(e),rightM:$O(e),leftM:SO(e),left:my(e),right:hy(e),both:_O(e),toTuple:function(s,c,l){return m(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=IO(e,s),l=OO(e,s);return{_E:void 0,map:u,of:a,ap:function(f,d){return m(f,c(d))},chain:function(f,d){return m(f,l(d))}}}}}const Bme=Object.freeze(Object.defineProperty({__proto__:null,ap:IO,bimap:CO,both:_O,chain:OO,getTheseM:Ume,left:my,leftF:SO,map:TO,mapLeft:wO,match:XB,matchE:EO,right:hy,rightF:$O,swap:RO,toTuple2:MO},Symbol.toStringTag,{value:"Module"}));var qme=my(an),QB=hy(an),zme=_O(an),xO=$O(Le),e2=SO(Le),t2=H(An,xO),Kme=H(An,e2),n2=$n,r2=$n,vy=t2,Vme=An,kO=xO,i2=XB(Le),Hme=i2,o2=EO(Vt),a2=o2,u2=a2,Gme=u2,Yme=RO(Le),Bs=function(e,t){return m(e,s2(t))},AO=function(e,t,n){return m(e,c2(t,n))},FO=function(e,t){return m(e,l2(t))},s2=TO(Le),c2=CO(Le),l2=wO(Le),nh=QB,Pn="TaskThese",NO=function(e,t){var n=IO(e,t);return{URI:Pn,_E:void 0,map:Bs,ap:function(r,i){return m(r,n(i))}}};function f2(e,t){var n=NO(e,t).ap;return{URI:Pn,_E:void 0,map:Bs,ap:n,of:nh}}function d2(e){var t=NO(Rp,e),n=OO(Vt,e);return{URI:Pn,_E:void 0,map:Bs,ap:t.ap,chain:function(r,i){return m(r,n(i))}}}function Jme(e){var t=f2(Rp,e),n=d2(e);return{URI:Pn,_E:void 0,map:Bs,ap:t.ap,of:nh,chain:n.chain,fromIO:vy,fromTask:kO}}var p2={URI:Pn,map:Bs},Zme=Ue(p2),Xme={URI:Pn,of:nh},Qme={URI:Pn,bimap:AO,mapLeft:FO},gy={URI:Pn,fromEither:n2},eve=Gi(gy),tve=Yi(gy),nve=qa(gy),h2={URI:Pn,fromThese:r2},rve=$P(h2),m2={URI:Pn,fromIO:vy},ive=eo(m2),v2={URI:Pn,fromIO:vy,fromTask:kO},ove=Os(v2),g2=MO(Le),PO=nh(en),y2=function(e){var t=bO(e);return function(n){return H(Gl(n),ru(t(Yn)))}},ave=function(e){return function(t){var n=y2(e)(t);return function(r){return mt(r)?n(r):PO}}},b2=function(e){return function(t){return function(n){return function(){return Lc(n).reduce(function(r,i,o){return r.then(function(a){return Ge(a)?r:t(o+1,i)().then(function(u){if(Ge(u))return u;if(Ds(u)){var s=a.right;return s.push(u.right),Ds(a)?et(e.concat(a.left,u.left),s):et(u.left,s)}return a.right.push(u.right),a})})},t(0,hr(n))().then(hO(cd)))}}}},uve=function(e){return function(t){var n=b2(e)(t);return function(r){return mt(r)?n(r):PO}}},sve={URI:Pn,map:Bs},cve={URI:Pn,bimap:AO,mapLeft:FO},lve=function(e,t){return g2(function(){return e},function(){return t})},fve={URI:Pn,map:Bs,bimap:AO,mapLeft:FO},dve=function(e,t){return zt(Mg)(BB(e,t))};const pve=Object.freeze(Object.defineProperty({__proto__:null,ApT:PO,Bifunctor:Qme,FromEither:gy,FromIO:m2,FromTask:v2,FromThese:h2,Functor:p2,Pointed:Xme,URI:Pn,bifunctorTaskThese:cve,bimap:c2,both:zme,flap:Zme,fold:a2,foldW:Gme,fromEither:n2,fromIO:vy,fromIOEither:Vme,fromIOK:ive,fromOption:eve,fromOptionK:tve,fromPredicate:nve,fromTask:kO,fromTaskK:ove,fromThese:r2,fromTheseK:rve,functorTaskThese:sve,getApplicative:f2,getApply:NO,getChain:d2,getMonad:Jme,getSemigroup:dve,left:qme,leftIO:Kme,leftTask:e2,map:s2,mapLeft:l2,match:i2,matchE:o2,matchEW:u2,matchW:Hme,of:nh,right:QB,rightIO:t2,rightTask:xO,swap:Yme,taskThese:fve,toTuple:lve,toTuple2:g2,traverseReadonlyArrayWithIndex:ave,traverseReadonlyArrayWithIndexSeq:uve,traverseReadonlyNonEmptyArrayWithIndex:y2,traverseReadonlyNonEmptyArrayWithIndexSeq:b2},Symbol.toStringTag,{value:"Module"}));function hve(e,t){return function(n){return n(t(n(e.empty)))}}function mve(e){return function(t){return[e(t),t]}}function vve(e){return function(t){return function(n){return[t(n),e(n)]}}}function gve(e){return function(t){return function(n){return t(e(n))}}}function yve(e){function t(r,i){return function(o){return i(function(a){return r(e.concat(o,a))})}}function n(r){return r(e.empty)}return{URI:WO,_E:void 0,map:_2,extend:t,extract:n}}var _2=function(e,t){return m(e,$2(t))},$2=function(e){return function(t){return function(n){return e(t(n))}}},WO="Traced",LO={URI:WO,map:_2},bve=Ue(LO),_ve=LO;const $ve=Object.freeze(Object.defineProperty({__proto__:null,Functor:LO,URI:WO,censor:gve,flap:bve,getComonad:yve,listen:mve,listens:vve,map:$2,traced:_ve,tracks:hve},Symbol.toStringTag,{value:"Module"}));function S2(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function T2(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function Sve(e,t){var n=Wc(e,t).map,r=NS(e,t),i=S2(e,t),o=T2(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var u=i(a);return function(s,c){return m(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return m(s,u)}}}}const Tve=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:Sve,sequence:T2,traverse:S2},Symbol.toStringTag,{value:"Module"})),Ive=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function I2(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function Ove(e){var t=function(n){return Va(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Cve(e){var t,n=Pr(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=QA(n),n}var O2=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"└":"├")+"─ "+i.value,n+=O2(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function C2(e){return O2(`
28
+ `,e)}function wve(e){return e.value+C2(e.forest)}function w2(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:E2(i,t)}}function E2(e,t){return e.map(function(n){return w2(n,t)})}function R2(e){var t=M2(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(u){return{value:o,forest:u}})})}}function M2(e){var t=Mv(e);return function(n,r){return m(n,t(function(i){return R2(e)(i,r)}))}}function Eve(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var hu=function(e,t){return m(e,by(t))},af=function(e,t){return m(e,rh(function(n){return m(t,by(n))}))},jO=function(e,t){return m(e,rh(t))},DO=function(e,t,n){return m(e,_y(t,n))},UO=function(e){var t=A2(e);return function(n,r){return m(n,t(r))}},BO=function(e,t,n){return m(e,qO(t,n))},x2=function(e,t){return m(e,yy(t))},k2=function(e){var t=KO(e);return function(n,r){return m(n,t(r))}},Rve=function(e){return function(t){return af(t,e)}},rh=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=G$().concat;return{value:r,forest:o(i,t.forest.map(rh(e)))}}},yy=function(e){return function(t){return{value:e(t),forest:t.forest.map(yy(e))}}},Mve=yy(B),xve=rh(B),by=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(by(e))}}},_y=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=m(n.forest[o],_y(r,t));return r}},A2=function(e){return function(t){return _y(e.empty,function(n,r){return e.concat(n,t(r))})}},qO=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=m(n.forest[o],qO(r,t));return t(n.value,r)}},zO=function(e){return e.value},KO=function(e){var t=Mv(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),m(i.forest,t(n(r))))}};return n},VO=function(e){return KO(e)(B)},uf=function(e){return I2(e)},Ii="Tree",HO={URI:Ii,map:hu},kve=Ue(HO),Ave={URI:Ii,of:uf},$y={URI:Ii,map:hu,ap:af},Fve=It($y),Nve=Ot($y),Pve={URI:Ii,map:hu,ap:af,of:uf},GO={URI:Ii,map:hu,ap:af,chain:jO},Wve={URI:Ii,map:hu,ap:af,of:uf,chain:jO},Lve=lt(GO),jve={URI:Ii,reduce:DO,foldMap:UO,reduceRight:BO},Dve={URI:Ii,map:hu,reduce:DO,foldMap:UO,reduceRight:BO,traverse:k2,sequence:VO},Uve={URI:Ii,map:hu,extend:x2,extract:zO},Bve=uf(qt),qve=Tt(HO),zve=wt(GO),Kve=Ct($y);function Vve(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var F2=function(e){return function(t){return e(t.value)||t.forest.some(F2(e))}},Hve={URI:Ii,map:hu,of:uf,ap:af,chain:jO,reduce:DO,foldMap:UO,reduceRight:BO,traverse:k2,sequence:VO,extract:zO,extend:x2};const Gve=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Pve,Apply:$y,Chain:GO,Comonad:Uve,Do:Bve,Foldable:jve,Functor:HO,Monad:Wve,Pointed:Ave,Traversable:Dve,URI:Ii,ap:Rve,apFirst:Fve,apS:Kve,apSecond:Nve,bind:zve,bindTo:qve,chain:rh,chainFirst:Lve,drawForest:C2,drawTree:wve,duplicate:Mve,elem:Vve,exists:F2,extend:yy,extract:zO,flap:kve,flatten:xve,fold:Eve,foldMap:A2,getEq:Cve,getShow:Ove,make:I2,map:by,of:uf,reduce:_y,reduceRight:qO,sequence:VO,traverse:KO,tree:Hve,unfoldForest:E2,unfoldForestM:M2,unfoldTree:w2,unfoldTreeM:R2},Symbol.toStringTag,{value:"Module"}));var Ir=Ht,ir=Tn,Yve=function(e){return[ir(e),Ir(e)]};function YO(e){return{URI:Or,_E:void 0,map:ih,ap:function(t,n){return[Ir(t)(Ir(n)),e.concat(ir(t),ir(n))]}}}var N2=function(e){return function(t){return[t,e.empty]}};function Jve(e){var t=YO(e);return{URI:Or,_E:void 0,map:t.map,ap:t.ap,of:N2(e)}}function JO(e){var t=YO(e);return{URI:Or,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(Ir(n)),o=i[0],a=i[1];return[o,e.concat(ir(n),a)]}}}function Zve(e){var t=JO(e);return{URI:Or,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:N2(e)}}function Xve(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=Ir(o);u._tag==="Left";)a=e.concat(a,ir(o)),o=i(u.left),u=Ir(o);return[u.right,e.concat(a,ir(o))]},n=JO(e);return{URI:Or,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var P2=function(e,t){return m(e,B2(t))},ih=function(e,t){return m(e,eC(t))},W2=function(e,t,n){return m(e,U2(t,n))},L2=function(e,t){return m(e,tC(t))},j2=function(e,t){return m(e,nC(t))},ZO=function(e,t,n){return m(e,z2(t,n))},XO=function(e){var t=q2();return function(n,r){return m(n,t(r))}},QO=function(e,t,n){return m(e,K2(t,n))};function D2(e){var t=V2(e);return function(n,r){return m(n,t(r))}}var U2=function(e,t){return function(n){return[t(Ir(n)),e(ir(n))]}},eC=function(e){return function(t){return[e(Ir(t)),ir(t)]}},tC=function(e){return function(t){return[Ir(t),e(ir(t))]}},B2=function(e){return function(t){return[Ir(t),ir(e)]}},nC=function(e){return function(t){return[e(t),ir(t)]}},Qve=nC(B),rC=Xg,q2=S1,z2=$1,K2=T1,V2=function(e){return function(t){return function(n){return e.map(t(Ir(n)),function(r){return[r,ir(n)]})}}},iC=function(e){return function(t){return e.map(Ir(t),function(n){return[n,ir(t)]})}},Or="Tuple",H2={URI:Or,map:ih},ege=Ue(H2),tge={URI:Or,bimap:W2,mapLeft:L2},nge={URI:Or,compose:P2},rge={URI:Or,map:ih,extend:j2,extract:rC},ige={URI:Or,reduce:ZO,foldMap:XO,reduceRight:QO},oge={URI:Or,map:ih,reduce:ZO,foldMap:XO,reduceRight:QO,traverse:D2,sequence:iC},age=eC,uge=tC,sge={URI:Or,compose:P2,map:ih,bimap:W2,mapLeft:L2,extract:rC,extend:j2,reduce:ZO,foldMap:XO,reduceRight:QO,traverse:D2,sequence:iC};const cge=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:tge,Comonad:rge,Foldable:ige,Functor:H2,Semigroupoid:nge,Traversable:oge,URI:Or,bimap:U2,compose:B2,duplicate:Qve,extend:nC,extract:rC,flap:ege,foldMap:q2,fst:Ir,getApplicative:Jve,getApply:YO,getChain:JO,getChainRec:Xve,getMonad:Zve,map:age,mapFst:eC,mapLeft:uge,mapSnd:tC,reduce:z2,reduceRight:K2,sequence:iC,snd:ir,swap:Yve,traverse:V2,tuple:sge},Symbol.toStringTag,{value:"Module"})),lge=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function fge(e,t){var n=Kx(t,Ya(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Bt(o)?t.of(Mo(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return M_(o)?t.of(o):t.map(i(),function(a){return Bt(a)?Mo(e.concat(o.left,a.left)):a})})}}}const dge=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:fge},Symbol.toStringTag,{value:"Module"}));var G2=W_(void 0),pge={concat:G2.concat,empty:void 0};const hge=Object.freeze(Object.defineProperty({__proto__:null,Monoid:pge,Semigroup:G2},Symbol.toStringTag,{value:"Module"}));var mge=function(e){return function(){return[void 0,e]}},vge=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},gge=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},yge=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},bge=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},oh=function(e,t){return m(e,Y2(t))},Y2=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},qs="Writer",J2=function(e){return{URI:qs,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},oC=function(e){return{URI:qs,_E:void 0,map:oh,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),u=a[0],s=a[1];return[i(u),e.concat(o,s)]}}}},Z2=function(e){var t=oC(e),n=J2(e);return{URI:qs,_E:void 0,map:oh,ap:t.ap,of:n.of}};function X2(e){var t=oC(e);return{URI:qs,_E:void 0,map:oh,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,e.concat(a,c)]}}}}function _ge(e){var t=Z2(e),n=X2(e);return{URI:qs,_E:void 0,map:oh,ap:t.ap,of:t.of,chain:n.chain}}var aC={URI:qs,map:oh},$ge=Ue(aC),Sge=function(e){return e()[0]},Tge=function(e){return e()[1]},Ige=function(e){return e()[0]},Oge=function(e){return e()[1]},Cge=aC;const wge=Object.freeze(Object.defineProperty({__proto__:null,Functor:aC,URI:qs,censor:bge,evalWriter:Ige,evaluate:Sge,execWriter:Oge,execute:Tge,flap:$ge,getApplicative:Z2,getApply:oC,getChain:X2,getMonad:_ge,getPointed:J2,listen:vge,listens:yge,map:Y2,pass:gge,tell:mge,writer:Cge},Symbol.toStringTag,{value:"Module"}));function Ege(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],u=r[1];return[o,a(u)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(),function(s){var c=s[0],l=s[1];return[a(c),n.concat(u,l)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(a)(),function(s){var c=s[0],l=s[1];return[c,n.concat(u,l)]})})}}}}}}const ht=Ac(Object.freeze(Object.defineProperty({__proto__:null,alt:xG,alternative:AG,applicative:FG,apply:_6,array:z8,bifunctor:K8,boolean:Q8,booleanAlgebra:iZ,bounded:sZ,boundedDistributiveLattice:fZ,boundedJoinSemilattice:dZ,boundedLattice:pZ,boundedMeetSemilattice:hZ,category:mZ,chain:$6,chainRec:vZ,choice:bZ,comonad:_Z,compactable:fX,console:vX,const:xX,contravariant:kX,date:DX,distributiveLattice:cZ,either:AN,eitherT:EQ,endomorphism:MQ,eq:u6,extend:xQ,field:FQ,filterable:PQ,filterableWithIndex:WQ,foldable:qQ,foldableWithIndex:KQ,fromEither:NG,fromIO:VQ,fromReader:hee,fromState:Fee,fromTask:Nee,fromThese:Pee,function:OM,functor:s6,functorWithIndex:Lee,group:jee,heytingAlgebra:Dee,hkt:Uee,identity:cte,invariant:lte,io:Rte,ioEither:Rne,ioOption:Sre,ioRef:Ire,joinSemilattice:Ore,json:Ere,lattice:Rre,magma:j6,map:Lie,meetSemilattice:jie,monad:Die,monadIO:Uie,monadTask:Bie,monadThrow:qie,monoid:noe,naturalTransformation:roe,nonEmptyArray:wY,number:FY,option:cX,optionT:xne,ord:N6,ordering:loe,pipeable:Eoe,pointed:Roe,predicate:OZ,profunctor:Moe,random:Foe,reader:pee,readerEither:Mae,readerT:Aae,readerTask:Uue,readerTaskEither:hle,readonlyArray:a7,readonlyMap:nie,readonlyNonEmptyArray:W9,readonlyRecord:RG,readonlySet:xle,readonlyTuple:Vle,record:Hfe,refinement:nde,ring:ade,semigroup:QM,semigroupoid:ude,semiring:cde,separated:m6,set:xde,show:Wde,state:Aee,stateReaderTaskEither:Zpe,stateT:jde,store:ahe,string:eG,strong:che,struct:dhe,task:oue,taskEither:Zse,taskOption:pme,taskThese:pve,these:Dme,theseT:Bme,traced:$ve,traversable:Tve,traversableWithIndex:Ive,tree:Gve,tuple:cge,unfoldable:lge,validationT:dge,void:hge,witherable:tG,writer:wge,writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:Ege},Symbol.toStringTag,{value:"Module"})),zero:NY},Symbol.toStringTag,{value:"Module"})));var In={},sf={},pn={},Ye={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function(C){return function(){return{meet:function(I,M){return function(R){return C.meet(I(R),M(R))}},join:function(I,M){return function(R){return C.join(I(R),M(R))}},zero:function(){return C.zero},one:function(){return C.one},implies:function(I,M){return function(R){return C.implies(I(R),M(R))}},not:function(I){return function(M){return C.not(I(M))}}}}};e.getBooleanAlgebra=t;var n=function(C){return function(){return{concat:function(I,M){return function(R){return C.concat(I(R),M(R))}}}}};e.getSemigroup=n;var r=function(C){var I=(0,e.getSemigroup)(C);return function(){return{concat:I().concat,empty:function(){return C.empty}}}};e.getMonoid=r;var i=function(C){return{add:function(I,M){return function(R){return C.add(I(R),M(R))}},zero:function(){return C.zero},mul:function(I,M){return function(R){return C.mul(I(R),M(R))}},one:function(){return C.one}}};e.getSemiring=i;var o=function(C){var I=(0,e.getSemiring)(C);return{add:I.add,mul:I.mul,one:I.one,zero:I.zero,sub:function(M,R){return function(U){return C.sub(M(U),R(U))}}}};e.getRing=o;var a=function(C){return function(I){return I(C)}};e.apply=a;function u(C){return C}e.identity=u,e.unsafeCoerce=u;function s(C){return function(){return C}}e.constant=s,e.constTrue=s(!0),e.constFalse=s(!1),e.constNull=s(null),e.constUndefined=s(void 0),e.constVoid=e.constUndefined;function c(C){return function(I,M){return C(M,I)}}e.flip=c;function l(C,I,M,R,U,q,N,Z,ee){switch(arguments.length){case 1:return C;case 2:return function(){return I(C.apply(this,arguments))};case 3:return function(){return M(I(C.apply(this,arguments)))};case 4:return function(){return R(M(I(C.apply(this,arguments))))};case 5:return function(){return U(R(M(I(C.apply(this,arguments)))))};case 6:return function(){return q(U(R(M(I(C.apply(this,arguments))))))};case 7:return function(){return N(q(U(R(M(I(C.apply(this,arguments)))))))};case 8:return function(){return Z(N(q(U(R(M(I(C.apply(this,arguments))))))))};case 9:return function(){return ee(Z(N(q(U(R(M(I(C.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var C=[],I=0;I<arguments.length;I++)C[I]=arguments[I];return C}e.tuple=f;function d(C){return C+1}e.increment=d;function p(C){return C-1}e.decrement=p;function h(C){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v(C){return function(I){return C.apply(void 0,I)}}e.tupled=v;function g(C){return function(){for(var I=[],M=0;M<arguments.length;M++)I[M]=arguments[M];return C(I)}}e.untupled=g;function b(C,I,M,R,U,q,N,Z,ee){switch(arguments.length){case 1:return C;case 2:return I(C);case 3:return M(I(C));case 4:return R(M(I(C)));case 5:return U(R(M(I(C))));case 6:return q(U(R(M(I(C)))));case 7:return N(q(U(R(M(I(C))))));case 8:return Z(N(q(U(R(M(I(C)))))));case 9:return ee(Z(N(q(U(R(M(I(C))))))));default:{for(var J=arguments[0],ve=1;ve<arguments.length;ve++)J=arguments[ve](J);return J}}}e.pipe=b,e.hole=h;var S=function(C,I){return I};e.SK=S;function O(C){return function(I){return!C(I)}}e.not=O;var y=function(){return{concat:function(C,I){return l(C,I)},empty:u}};e.getEndomorphismMonoid=y})(Ye);var ke={},Rge=de&&de.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(ke,"__esModule",{value:!0}),ke.fromReadonlyNonEmptyArray=ke.has=ke.emptyRecord=ke.emptyReadonlyArray=ke.tail=ke.head=ke.isNonEmpty=ke.singleton=ke.right=ke.left=ke.isRight=ke.isLeft=ke.some=ke.none=ke.isSome=ke.isNone=void 0;var Mge=function(e){return e._tag==="None"};ke.isNone=Mge;var xge=function(e){return e._tag==="Some"};ke.isSome=xge,ke.none={_tag:"None"};var kge=function(e){return{_tag:"Some",value:e}};ke.some=kge;var Age=function(e){return e._tag==="Left"};ke.isLeft=Age;var Fge=function(e){return e._tag==="Right"};ke.isRight=Fge;var Nge=function(e){return{_tag:"Left",left:e}};ke.left=Nge;var Pge=function(e){return{_tag:"Right",right:e}};ke.right=Pge;var Wge=function(e){return[e]};ke.singleton=Wge;var Lge=function(e){return e.length>0};ke.isNonEmpty=Lge;var jge=function(e){return e[0]};ke.head=jge;var Dge=function(e){return e.slice(1)};ke.tail=Dge,ke.emptyReadonlyArray=[],ke.emptyRecord={},ke.has=Object.prototype.hasOwnProperty;var Uge=function(e){return Rge([e[0]],e.slice(1),!0)};ke.fromReadonlyNonEmptyArray=Uge;var Bge=de&&de.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),qge=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),zge=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Bge(t,e,n);return qge(t,e),t};Object.defineProperty(pn,"__esModule",{value:!0}),pn.sequenceS=pn.sequenceT=pn.getApplySemigroup=pn.apS=pn.apSecond=pn.apFirst=pn.ap=void 0;var Kge=Ye,Vge=zge(ke);function Hge(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}pn.ap=Hge;function Gge(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}pn.apFirst=Gge;function Yge(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}pn.apSecond=Yge;function Jge(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}pn.apS=Jge;function Zge(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}pn.getApplySemigroup=Zge;function uC(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):uC(e,t-1,i)}}var sC={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function Xge(e){return Vge.has.call(sC,e)||(sC[e]=uC(Kge.tuple,e-1,[])),sC[e]}function Qge(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=Xge(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}pn.sequenceT=Qge;function eye(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return uC(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function tye(e){return function(t){for(var n=Object.keys(t),r=n.length,i=eye(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}pn.sequenceS=tye;var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.getFunctorComposition=Vr.bindTo=Vr.flap=Vr.map=void 0;var nye=Ye;function Q2(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}Vr.map=Q2;function rye(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}Vr.flap=rye;function iye(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}Vr.bindTo=iye;function oye(e,t){var n=Q2(e,t);return{map:function(r,i){return(0,nye.pipe)(r,n(i))}}}Vr.getFunctorComposition=oye,Object.defineProperty(sf,"__esModule",{value:!0}),sf.getApplicativeComposition=sf.getApplicativeMonoid=void 0;var eq=pn,aye=Ye,uye=Vr;function sye(e){var t=(0,eq.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}sf.getApplicativeMonoid=sye;function cye(e,t){var n=(0,uye.getFunctorComposition)(e,t).map,r=(0,eq.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,aye.pipe)(i,r(o))}}}sf.getApplicativeComposition=cye;var zs={};Object.defineProperty(zs,"__esModule",{value:!0}),zs.bind=zs.chainFirst=void 0;function lye(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}zs.chainFirst=lye;function fye(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}zs.bind=fye;var Sy={};Object.defineProperty(Sy,"__esModule",{value:!0}),Sy.tailRec=void 0;var dye=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};Sy.tailRec=dye;var Yt={},pye=de&&de.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),hye=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mye=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&pye(t,e,n);return hye(t,e),t};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.filterOrElse=Yt.chainFirstEitherK=Yt.chainEitherK=Yt.fromEitherK=Yt.chainOptionK=Yt.fromOptionK=Yt.fromPredicate=Yt.fromOption=void 0;var vye=zs,cC=Ye,Ks=mye(ke);function tq(e){return function(t){return function(n){return e.fromEither(Ks.isNone(n)?Ks.left(t()):Ks.right(n.value))}}}Yt.fromOption=tq;function gye(e){return function(t,n){return function(r){return e.fromEither(t(r)?Ks.right(r):Ks.left(n(r)))}}}Yt.fromPredicate=gye;function nq(e){var t=tq(e);return function(n){var r=t(n);return function(i){return(0,cC.flow)(i,r)}}}Yt.fromOptionK=nq;function yye(e,t){var n=nq(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}Yt.chainOptionK=yye;function lC(e){return function(t){return(0,cC.flow)(t,e.fromEither)}}Yt.fromEitherK=lC;function bye(e,t){var n=lC(e);return function(r){return function(i){return t.chain(i,n(r))}}}Yt.chainEitherK=bye;function _ye(e,t){return(0,cC.flow)(lC(e),(0,vye.chainFirst)(t))}Yt.chainFirstEitherK=_ye;function $ye(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ks.right(o):Ks.left(r(o)))})}}}Yt.filterOrElse=$ye;var rq={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Ye,n=Vr,r=function(d,p){return{left:d,right:p}};e.separated=r;var i=function(d,p){return(0,t.pipe)(d,(0,e.map)(p))},o=function(d,p){return(0,t.pipe)(d,(0,e.mapLeft)(p))},a=function(d,p,h){return(0,t.pipe)(d,(0,e.bimap)(p,h))},u=function(d){return function(p){return(0,e.separated)((0,e.left)(p),d((0,e.right)(p)))}};e.map=u;var s=function(d){return function(p){return(0,e.separated)(d((0,e.left)(p)),(0,e.right)(p))}};e.mapLeft=s;var c=function(d,p){return function(h){return(0,e.separated)(d((0,e.left)(h)),p((0,e.right)(h)))}};e.bimap=c,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var l=function(d){return d.left};e.left=l;var f=function(d){return d.right};e.right=f})(rq);var mu={},Sye=de&&de.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),Tye=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Iye=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Sye(t,e,n);return Tye(t,e),t};Object.defineProperty(mu,"__esModule",{value:!0}),mu.filterE=mu.witherDefault=mu.wiltDefault=void 0;var iq=Iye(ke);function Oye(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}mu.wiltDefault=Oye;function Cye(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}mu.witherDefault=Cye;function wye(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?iq.some(o):iq.none})})}}}}mu.filterE=wye,function(e){var t=de&&de.__createBinding||(Object.create?function(P,F,D,Fe){Fe===void 0&&(Fe=D);var W=Object.getOwnPropertyDescriptor(F,D);(!W||("get"in W?!F.__esModule:W.writable||W.configurable))&&(W={enumerable:!0,get:function(){return F[D]}}),Object.defineProperty(P,Fe,W)}:function(P,F,D,Fe){Fe===void 0&&(Fe=D),P[Fe]=F[D]}),n=de&&de.__setModuleDefault||(Object.create?function(P,F){Object.defineProperty(P,"default",{enumerable:!0,value:F})}:function(P,F){P.default=F}),r=de&&de.__importStar||function(P){if(P&&P.__esModule)return P;var F={};if(P!=null)for(var D in P)D!=="default"&&Object.prototype.hasOwnProperty.call(P,D)&&t(F,P,D);return n(F,P),F};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=sf,o=pn,a=zs,u=Sy,s=Yt,c=Ye,l=Vr,f=r(ke),d=rq,p=mu;e.left=f.left,e.right=f.right;var h=function(P,F){return(0,c.pipe)(P,(0,e.map)(F))},v=function(P,F){return(0,c.pipe)(P,(0,e.ap)(F))},g=function(P,F){return(0,c.pipe)(P,(0,e.chain)(F))},b=function(P,F,D){return(0,c.pipe)(P,(0,e.reduce)(F,D))},S=function(P){return function(F,D){var Fe=(0,e.foldMap)(P);return(0,c.pipe)(F,Fe(D))}},O=function(P,F,D){return(0,c.pipe)(P,(0,e.reduceRight)(F,D))},y=function(P){var F=(0,e.traverse)(P);return function(D,Fe){return(0,c.pipe)(D,F(Fe))}},C=function(P,F,D){return(0,c.pipe)(P,(0,e.bimap)(F,D))},I=function(P,F){return(0,c.pipe)(P,(0,e.mapLeft)(F))},M=function(P,F){return(0,c.pipe)(P,(0,e.alt)(F))},R=function(P,F){return(0,c.pipe)(P,(0,e.extend)(F))},U=function(P,F){return(0,u.tailRec)(F(P),function(D){return(0,e.isLeft)(D)?(0,e.right)((0,e.left)(D.left)):(0,e.isLeft)(D.right)?(0,e.left)(F(D.right.left)):(0,e.right)((0,e.right)(D.right.right))})};e.URI="Either";var q=function(P,F){return{show:function(D){return(0,e.isLeft)(D)?"left(".concat(P.show(D.left),")"):"right(".concat(F.show(D.right),")")}}};e.getShow=q;var N=function(P,F){return{equals:function(D,Fe){return D===Fe||((0,e.isLeft)(D)?(0,e.isLeft)(Fe)&&P.equals(D.left,Fe.left):(0,e.isRight)(Fe)&&F.equals(D.right,Fe.right))}}};e.getEq=N;var Z=function(P){return{concat:function(F,D){return(0,e.isLeft)(D)?F:(0,e.isLeft)(F)?D:(0,e.right)(P.concat(F.right,D.right))}}};e.getSemigroup=Z;var ee=function(P){var F=(0,e.left)(P.empty);return{URI:e.URI,_E:void 0,compact:function(D){return(0,e.isLeft)(D)?D:D.right._tag==="None"?F:(0,e.right)(D.right.value)},separate:function(D){return(0,e.isLeft)(D)?(0,d.separated)(D,D):(0,e.isLeft)(D.right)?(0,d.separated)((0,e.right)(D.right.left),F):(0,d.separated)(F,(0,e.right)(D.right.right))}}};e.getCompactable=ee;var J=function(P){var F=(0,e.left)(P.empty),D=(0,e.getCompactable)(P),Fe=D.compact,W=D.separate,ie=function(he,Oe){return(0,e.isLeft)(he)||Oe(he.right)?he:F},me=function(he,Oe){return(0,e.isLeft)(he)?(0,d.separated)(he,he):Oe(he.right)?(0,d.separated)(F,(0,e.right)(he.right)):(0,d.separated)((0,e.right)(he.right),F)};return{URI:e.URI,_E:void 0,map:h,compact:Fe,separate:W,filter:ie,filterMap:function(he,Oe){if((0,e.isLeft)(he))return he;var st=Oe(he.right);return st._tag==="None"?F:(0,e.right)(st.value)},partition:me,partitionMap:function(he,Oe){if((0,e.isLeft)(he))return(0,d.separated)(he,he);var st=Oe(he.right);return(0,e.isLeft)(st)?(0,d.separated)((0,e.right)(st.left),F):(0,d.separated)(F,(0,e.right)(st.right))}}};e.getFilterable=J;var ve=function(P){var F=(0,e.getFilterable)(P),D=(0,e.getCompactable)(P);return{URI:e.URI,_E:void 0,map:h,compact:F.compact,separate:F.separate,filter:F.filter,filterMap:F.filterMap,partition:F.partition,partitionMap:F.partitionMap,traverse:y,sequence:e.sequence,reduce:b,foldMap:S,reduceRight:O,wither:(0,p.witherDefault)(e.Traversable,D),wilt:(0,p.wiltDefault)(e.Traversable,D)}};e.getWitherable=ve;var Ie=function(P){return{URI:e.URI,_E:void 0,map:h,ap:function(F,D){return(0,e.isLeft)(F)?(0,e.isLeft)(D)?(0,e.left)(P.concat(F.left,D.left)):F:(0,e.isLeft)(D)?D:(0,e.right)(F.right(D.right))},of:e.of}};e.getApplicativeValidation=Ie;var k=function(P){return{URI:e.URI,_E:void 0,map:h,alt:function(F,D){if((0,e.isRight)(F))return F;var Fe=D();return(0,e.isLeft)(Fe)?(0,e.left)(P.concat(F.left,Fe.left)):Fe}}};e.getAltValidation=k;var A=function(P){return function(F){return(0,e.isLeft)(F)?F:(0,e.right)(P(F.right))}};e.map=A,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var T=function(P){return function(F){return(0,e.isLeft)(F)?F:(0,e.isLeft)(P)?P:(0,e.right)(F.right(P.right))}};e.apW=T,e.ap=e.apW,e.Apply={URI:e.URI,map:h,ap:v},e.Applicative={URI:e.URI,map:h,ap:v,of:e.of};var $=function(P){return function(F){return(0,e.isLeft)(F)?F:P(F.right)}};e.chainW=$,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:g},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:g};var x=function(P,F){return function(D){return(0,e.isLeft)(D)?P:F(P,D.right)}};e.reduce=x;var L=function(P){return function(F){return function(D){return(0,e.isLeft)(D)?P.empty:F(D.right)}}};e.foldMap=L;var X=function(P,F){return function(D){return(0,e.isLeft)(D)?P:F(D.right,P)}};e.reduceRight=X,e.Foldable={URI:e.URI,reduce:b,foldMap:S,reduceRight:O};var ne=function(P){return function(F){return function(D){return(0,e.isLeft)(D)?P.of((0,e.left)(D.left)):P.map(F(D.right),e.right)}}};e.traverse=ne;var xe=function(P){return function(F){return(0,e.isLeft)(F)?P.of((0,e.left)(F.left)):P.map(F.right,e.right)}};e.sequence=xe,e.Traversable={URI:e.URI,map:h,reduce:b,foldMap:S,reduceRight:O,traverse:y,sequence:e.sequence};var se=function(P,F){return function(D){return(0,e.isLeft)(D)?(0,e.left)(P(D.left)):(0,e.right)(F(D.right))}};e.bimap=se;var Ae=function(P){return function(F){return(0,e.isLeft)(F)?(0,e.left)(P(F.left)):F}};e.mapLeft=Ae,e.Bifunctor={URI:e.URI,bimap:C,mapLeft:I};var ze=function(P){return function(F){return(0,e.isLeft)(F)?P():F}};e.altW=ze,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:M};var He=function(P){return function(F){return(0,e.isLeft)(F)?F:(0,e.right)(P(F))}};e.extend=He,e.Extend={URI:e.URI,map:h,extend:R},e.ChainRec={URI:e.URI,map:h,ap:v,chain:g,chainRec:U},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:g,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:c.identity},e.fromPredicate=(0,s.fromPredicate)(e.FromEither),e.fromOption=(0,s.fromOption)(e.FromEither),e.isLeft=f.isLeft,e.isRight=f.isRight;var ut=function(P,F){return function(D){return(0,e.isLeft)(D)?P(D.left):F(D.right)}};e.matchW=ut,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Ut=function(P){return function(F){return(0,e.isLeft)(F)?P(F.left):F.right}};e.getOrElseW=Ut,e.getOrElse=e.getOrElseW,e.flap=(0,l.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(c.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(c.identity),e.fromOptionK=(0,s.fromOptionK)(e.FromEither),e.chainOptionK=(0,s.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,s.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var Qt=function(P){return(0,e.isLeft)(P)?(0,e.right)(P.left):(0,e.left)(P.right)};e.swap=Qt;var gn=function(P){return function(F){return(0,e.isLeft)(F)?P(F.left):F}};e.orElseW=gn,e.orElse=e.orElseW;var dr=function(P){return function(F){return F==null?(0,e.left)(P):(0,e.right)(F)}};e.fromNullable=dr;var Ui=function(P,F){try{return(0,e.right)(P())}catch(D){return(0,e.left)(F(D))}};e.tryCatch=Ui;var ti=function(P,F){return function(){for(var D=[],Fe=0;Fe<arguments.length;Fe++)D[Fe]=arguments[Fe];return(0,e.tryCatch)(function(){return P.apply(void 0,D)},F)}};e.tryCatchK=ti;var Ro=function(P){var F=(0,e.fromNullable)(P);return function(D){return(0,c.flow)(D,F)}};e.fromNullableK=Ro;var Fa=function(P){var F=(0,e.fromNullableK)(P);return function(D){return(0,e.chain)(F(D))}};e.chainNullableK=Fa,e.toUnion=(0,e.foldW)(c.identity,c.identity);function Bi(P){return P instanceof Error?P:new Error(String(P))}e.toError=Bi;function pr(P){return function(F,D){if(D===void 0){var Fe=pr(P);return function(W){return Fe(F,W)}}return(0,e.isLeft)(D)?!1:P.equals(F,D.right)}}e.elem=pr;var ni=function(P){return function(F){return(0,e.isLeft)(F)?!1:P(F.right)}};e.exists=ni,e.Do=(0,e.of)(f.emptyRecord),e.bindTo=(0,l.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(f.emptyReadonlyArray);var qi=function(P){return function(F){var D=P(0,f.head(F));if((0,e.isLeft)(D))return D;for(var Fe=[D.right],W=1;W<F.length;W++){var ie=P(W,F[W]);if((0,e.isLeft)(ie))return ie;Fe.push(ie.right)}return(0,e.right)(Fe)}};e.traverseReadonlyNonEmptyArrayWithIndex=qi;var zi=function(P){var F=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(P);return function(D){return f.isNonEmpty(D)?F(D):e.ApT}};e.traverseReadonlyArrayWithIndex=zi,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Na=function(P){return(0,e.traverseReadonlyArrayWithIndex)(function(F,D){return P(D)})};e.traverseArray=Na,e.sequenceArray=(0,e.traverseArray)(c.identity);function Pa(P,F){return(0,e.tryCatch)(function(){return JSON.parse(P)},F)}e.parseJSON=Pa;var Wa=function(P,F){return(0,e.tryCatch)(function(){var D=JSON.stringify(P);if(typeof D!="string")throw new Error("Converting unsupported structure to JSON");return D},F)};e.stringifyJSON=Wa,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:g,reduce:b,foldMap:S,reduceRight:O,traverse:y,sequence:e.sequence,bimap:C,mapLeft:I,alt:M,extend:R,chainRec:U,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var ri=function(P,F){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(P))(F)};e.getValidationSemigroup=ri;var Hu=function(P,F){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(P))(F)};e.getValidationMonoid=Hu;function ed(P){var F=(0,e.getApplicativeValidation)(P).ap,D=(0,e.getAltValidation)(P).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:g,bimap:C,mapLeft:I,reduce:b,foldMap:S,reduceRight:O,extend:R,traverse:y,sequence:e.sequence,chainRec:U,throwError:e.throwError,ap:F,alt:D}}e.getValidation=ed}(In);var Ze=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cf=globalThis&&globalThis.__assign||function(){return cf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},cf.apply(this,arguments)},Eye=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},lo=$t,Xe=function(e,t,n){return lo([{value:e,context:t,message:n}])},Ce=Ke,$e=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return ue(a)?a:t.validate(a.right,o)},this.encode===je&&t.encode===je?je:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),je=function(e){return e};function oq(e){return e.displayName||e.name||"<function".concat(e.length,">")}function Rye(e,t){return{key:e,type:t}}function Oi(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function pa(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var Vs=Object.prototype.hasOwnProperty;function fC(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function ah(e){for(var t=0;t<e.length;t++)if(e[t].encode!==je)return!1;return!0}function aq(e){return"{ ".concat(fC(e)," }")}function uq(e){return"Partial<".concat(e,">")}function Mye(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new _C(r,function(o){return Wn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=Wn.validate(o,a);if(ue(u))return u;for(var s=u.right,c={},l=[],f=!1,d=0;d<i;d++){var p=e[d],h=s[p],v=n.validate(h,Oi(a,p,n,h));if(ue(v))pa(l,v.left);else{var g=v.right;f=f||g!==h,c[p]=g}}return l.length>0?lo(l):Ce(f||Object.keys(s).length!==i?c:s)},n.encode===je?je:function(o){for(var a={},u=0;u<i;u++){var s=e[u];a[s]=n.encode(o[s])}return a},t,n)}function dC(e){var t;if(dq(e)){var n=e.value;if(Ci.is(n))return t={},t[n]=null,t}else{if(Pye(e))return e.keys;if(hq(e)){var r=e.types.map(function(i){return dC(i)});return r.some(Ty.is)?void 0:Object.assign.apply(Object,Eye([{}],r,!1))}}}function xye(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new _C(n,function(r){return Wn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):fq(t)&&Array.isArray(r)},function(r,i){if(Wn.is(r)){for(var o={},a=[],u=Object.keys(r),s=u.length,c=!1,l=0;l<s;l++){var f=u[l],d=r[f],p=e.validate(f,Oi(i,f,e,f));if(ue(p))pa(a,p.left);else{var h=p.right;c=c||h!==f,f=h;var v=t.validate(d,Oi(i,f,t,d));if(ue(v))pa(a,v.left);else{var g=v.right;c=c||g!==d,o[f]=g}}}return a.length>0?lo(a):Ce(c?o:r)}return fq(t)&&Array.isArray(r)?Ce(r):Xe(r,i)},e.encode===je&&t.encode===je?je:function(r){for(var i={},o=Object.keys(r),a=o.length,u=0;u<a;u++){var s=o[u];i[String(e.encode(s))]=t.encode(r[s])}return i},e,t)}function sq(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function pC(e,t){for(var n=!0,r=!0,i=!Wn.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),Wn.is(u)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var s={},c=0,l=t;c<l.length;c++){var u=l[c];for(var f in u)(!Vs.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function hC(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return hC(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,hC(n))},{})}}function cq(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];Vs.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function kye(e){return pq(e)?"{| ".concat(fC(e.props)," |}"):Wye(e)?uq("{| ".concat(fC(e.props)," |}")):"Exact<".concat(e.name,">")}function Aye(e){return e.length>0}var or={};function lq(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function Fye(e,t){if(e===or)return t;if(t===or)return e;var n=Object.assign({},e);for(var r in t)if(Vs.call(e,r)){var i=lq(e[r],t[r]);if(Aye(i))n[r]=i;else{n=or;break}}else n[r]=t[r];return n}function Nye(e,t){if(e===or||t===or)return or;var n=or;for(var r in e)if(Vs.call(t,r)){var i=lq(e[r],t[r]);i.length===0&&(n===or&&(n={}),n[r]=e[r].concat(t[r]))}return n}function fq(e){return e._tag==="AnyType"}function dq(e){return e._tag==="LiteralType"}function Pye(e){return e._tag==="KeyofType"}function pq(e){return e._tag==="InterfaceType"}function Wye(e){return e._tag==="PartialType"}function Lye(e){return e._tag==="StrictType"}function jye(e){return e._tag==="ExactType"}function Dye(e){return e._tag==="RefinementType"}function Uye(e){return e._tag==="IntersectionType"}function hq(e){return e._tag==="UnionType"}function Bye(e){return e._tag==="RecursiveType"}var mC=[];function vu(e){if(mC.indexOf(e)!==-1)return or;if(pq(e)||Lye(e)){var t=or;for(var n in e.props){var r=e.props[n];dq(r)&&(t===or&&(t={}),t[n]=[r.value])}return t}else{if(jye(e)||Dye(e))return vu(e.type);if(Uye(e))return e.types.reduce(function(o,a){return Fye(o,vu(a))},or);if(hq(e))return e.types.slice(1).reduce(function(o,a){return Nye(o,vu(a))},vu(e.types[0]));if(Bye(e)){mC.push(e);var i=vu(e.type);return mC.pop(),i}}return or}function mq(e){var t=vu(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),f=[t[c]],d=1;d<r;d++){var p=e[d],h=vu(p),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(g){return l.indexOf(g)!==-1}))return"continue-keys";l.push.apply(l,v),f.push(v)}return{value:[c,f]}};e:for(var o=0,a=n;o<a.length;o++){var u=a[o],s=i(u);if(typeof s=="object")return s.value;switch(s){case"continue-keys":continue e}}}var vq=function(e){Ze(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="NullType",n}return t}($e),vC=new vq,gq=function(e){Ze(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="UndefinedType",n}return t}($e),Ty=new gq,yq=function(e){Ze(t,e);function t(){var n=e.call(this,"void",Ty.is,Ty.validate,je)||this;return n._tag="VoidType",n}return t}($e),bq=new yq,_q=function(e){Ze(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ce,je)||this;return n._tag="UnknownType",n}return t}($e),qye=new _q,$q=function(e){Ze(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="StringType",n}return t}($e),Ci=new $q,Sq=function(e){Ze(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="NumberType",n}return t}($e),Hs=new Sq,Tq=function(e){Ze(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="BigIntType",n}return t}($e),zye=new Tq,Iq=function(e){Ze(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="BooleanType",n}return t}($e),Iy=new Iq,Oq=function(e){Ze(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="AnyArrayType",n}return t}($e),lf=new Oq,Cq=function(e){Ze(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="AnyDictionaryType",n}return t}($e),Wn=new Cq,wq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return t}($e);function uh(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new wq(t,n,function(r,i){return n(r)?Ce(e):Xe(r,i)},je,e)}var Eq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return t}($e);function Kye(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return Ci.is(r)&&Vs.call(e,r)};return new Eq(t,n,function(r,i){return n(r)?Ce(r):Xe(r,i)},je,e)}var Rq=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return t}($e);function Oy(e,t,n){return TC(e,t,n)}var Cy=Oy(Hs,function(e){return Number.isInteger(e)},"Int"),gC=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return t}($e);Object.defineProperty(gC.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function yC(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new gC(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var Mq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return t}($e);function wy(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new Mq(t,function(n){return lf.is(n)&&n.every(e.is)},function(n,r){var i=lf.validate(n,r);if(ue(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=e.validate(l,Oi(r,String(c),e,l));if(ue(f))pa(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?lo(s):Ce(u)},e.encode===je?je:function(n){return n.map(e.encode)},e)}var xq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return t}($e);function bC(e,t){t===void 0&&(t=aq(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new xq(t,function(o){if(Wn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!Vs.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=Wn.validate(o,a);if(ue(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=r[f],v=h.validate(p,Oi(a,d,h,p));if(ue(v))pa(l,v.left);else{var g=v.right;(g!==p||g===void 0&&!Vs.call(c,d))&&(c===s&&(c=cf({},s)),c[d]=g)}}return l.length>0?lo(l):Ce(c)},ah(r)?je:function(o){for(var a=cf({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==je&&(a[s]=c(o[s]))}return a},e)}var kq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return t}($e);function Vye(e,t){t===void 0&&(t=uq(aq(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new kq(t,function(o){if(Wn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s!==void 0&&!e[u].is(s))return!1}return!0}return!1},function(o,a){var u=Wn.validate(o,a);if(ue(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=e[d],v=h.validate(p,Oi(a,d,h,p));if(ue(v))p!==void 0&&pa(l,v.left);else{var g=v.right;g!==p&&(c===s&&(c=cf({},s)),c[d]=g)}}return l.length>0?lo(l):Ce(c)},ah(r)?je:function(o){for(var a=cf({},o),u=0;u<i;u++){var s=n[u],c=o[s];c!==void 0&&(a[s]=r[u].encode(c))}return a},e)}var _C=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return t}($e);function $C(e,t,n){var r=dC(e);return r?Mye(Object.keys(r),e,t,n):xye(e,t,n)}var SC=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return t}($e);function sh(e,t){t===void 0&&(t=sq(e));var n=mq(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(u){for(var s=0;s<o;s++)if(i[s].indexOf(u)!==-1)return s};return new Ey(t,function(u){if(Wn.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=Wn.validate(u,s);if(ue(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return Xe(u,s);var d=e[f];return d.validate(l,Oi(s,String(f),d,l))},ah(e)?je:function(u){var s=a(u[r]);if(s===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[s].encode(u)},e,r)}else return new SC(t,function(u){return e.some(function(s){return s.is(u)})},function(u,s){for(var c=[],l=0;l<e.length;l++){var f=e[l],d=f.validate(u,Oi(s,String(l),f,u));if(ue(d))pa(c,d.left);else return Ce(d.right)}return lo(c)},ah(e)?je:function(u){for(var s=0,c=e;s<c.length;s++){var l=c[s];if(l.is(u))return l.encode(u)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var Aq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return t}($e);function Hye(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new Aq(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ce:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,Oi(i,String(u),s,r));ue(c)?pa(a,c.left):o.push(c.right)}return a.length>0?lo(a):Ce(pC(r,o))},e.length===0?je:function(r){return pC(r,e.map(function(i){return i.encode(r)}))},e)}var Fq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return t}($e);function Gye(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new Fq(t,function(r){return lf.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=lf.validate(r,i);if(ue(o))return o;for(var a=o.right,u=a.length>n?a.slice(0,n):a,s=[],c=0;c<n;c++){var l=a[c],f=e[c],d=f.validate(l,Oi(i,String(c),f,l));if(ue(d))pa(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?lo(s):Ce(u)},ah(e)?je:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var Nq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return t}($e);function Yye(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new Nq(t,e.is,e.validate,e.encode,e)}var Pq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return t}($e);function Wq(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=wy(e);return new Pq(t,n.is,n.validate,n.encode,e)}var ch=function(e,t){return jq(bC(e),t)},Lq=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return t}($e);function jq(e,t){t===void 0&&(t=kye(e));var n=hC(e);return new Lq(t,e.is,function(r,i){var o=Wn.validate(r,i);if(ue(o))return o;var a=e.validate(r,i);return ue(a)?a:Ke(cq(a.right,n))},function(r){return e.encode(cq(r,n))},e)}var Dq=function(e){Ze(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="FunctionType",n}return t}($e),Jye=new Dq,Ey=function(e){Ze(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o,a)||this;return s.tag=u,s}return t}(SC),Zye=function(e,t,n){n===void 0&&(n=sq(t));var r=sh(t,n);return r instanceof Ey?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new Ey(n,r.is,r.validate,r.encode,t,e))},Xye=function(e,t){return{value:e,context:t}},Uq=function(e){return[{key:"",type:e}]},Bq=function(e){Ze(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return Xe(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}($e),Qye=new Bq,qq=function(e){Ze(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ce,je)||this;return n._tag="AnyType",n}return t}($e),ebe=new qq,tbe=Wn,zq=function(e){Ze(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ce(r):Xe(r,i)},je)||this;return n._tag="ObjectType",n}return t}($e),nbe=new zq;function TC(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(oq(t),")")),new Rq(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(ue(o))return o;var a=o.right;return t(a)?Ce(a):Xe(a,i)},e.encode,e,t)}var rbe=TC(Hs,Number.isInteger,"Integer"),ibe=$C,obe=function(e){Ze(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return t}($e);function abe(e){return e}function ube(e){return function(){return e}}const Q=Ac(Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Oq,AnyDictionaryType:Cq,AnyType:qq,Array:lf,ArrayType:Mq,BigIntType:Tq,BooleanType:Iq,Dictionary:tbe,DictionaryType:_C,ExactType:Lq,Function:Jye,FunctionType:Dq,Int:Cy,Integer:rbe,InterfaceType:xq,IntersectionType:Aq,KeyofType:Eq,LiteralType:wq,NeverType:Bq,NullType:vq,NumberType:Sq,ObjectType:zq,PartialType:kq,ReadonlyArrayType:Pq,ReadonlyType:Nq,RecursiveType:gC,RefinementType:Rq,StrictType:obe,StringType:$q,TaggedUnionType:Ey,TupleType:Fq,Type:$e,UndefinedType:gq,UnionType:SC,UnknownArray:lf,UnknownRecord:Wn,UnknownType:_q,VoidType:yq,alias:ube,any:ebe,appendContext:Oi,array:wy,bigint:zye,boolean:Iy,brand:Oy,clean:abe,dictionary:ibe,emptyTags:or,exact:jq,failure:Xe,failures:lo,getContextEntry:Rye,getDefaultContext:Uq,getDomainKeys:dC,getFunctionName:oq,getIndex:mq,getTags:vu,getValidationError:Xye,identity:je,interface:bC,intersection:Hye,keyof:Kye,literal:uh,mergeAll:pC,never:Qye,null:vC,nullType:vC,number:Hs,object:nbe,partial:Vye,readonly:Yye,readonlyArray:Wq,record:$C,recursion:yC,refinement:TC,strict:ch,string:Ci,success:Ce,taggedUnion:Zye,tuple:Gye,type:bC,undefined:Ty,union:sh,unknown:qye,void:bq,voidType:bq},Symbol.toStringTag,{value:"Module"})));var Gs={},Ry={},rt={};const wi=Ac(OM);function Kq(e,t,n){return n===void 0&&(n=e.name),new $e(n,e.is,e.validate,function(r){return t(e.encode(r))})}const sbe=Ac(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:Kq},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(rt,"__esModule",{value:!0}),rt.addType=rt.isEmpty=rt.objectToMap=rt.grouped=rt.formatDate=rt.formatDateTime=rt.filterDouble=rt.refineType=rt.nullable=void 0;const cbe=G,lbe=ht,fbe=wi,ff=(0,cbe.__importStar)(Q),dbe=sbe;function pbe(e){return ff.union([e,ff.null,ff.undefined])}rt.nullable=pbe;function hbe(e,t,n){return new ff.Type(t,e.is,(r,i)=>(0,fbe.pipe)(e.validate(r,i),lbe.either.chain(o=>n(o)?ff.success(o):ff.failure(r,i))),e.encode)}rt.refineType=hbe;function mbe(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}rt.filterDouble=mbe;function vbe(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}rt.formatDateTime=vbe;function gbe(e){return e.toISOString().replace(/T.*/,"")}rt.formatDate=gbe;function ybe(e,t){return e.reduce((n,r,i)=>(i%t===0?n.push([r]):n[Math.floor(i/t)].push(r),n),new Array)}rt.grouped=ybe;function bbe(e){return new Map(Object.entries(e))}rt.objectToMap=bbe;function _be(e){for(const t in e)return!1;return!0}rt.isEmpty=_be;function $be(e,t){return(0,dbe.mapOutput)(e,n=>({...n,__TYPE__:t}))}rt.addType=$be,Object.defineProperty(Ry,"__esModule",{value:!0}),Ry.WidgetKey=void 0;const Sbe=(0,G.__importStar)(Q),Tbe=rt,Ibe=new RegExp("^[^<>]+$");Ry.WidgetKey=(0,Tbe.refineType)(Sbe.string,"WidgetKey",e=>e.length===0||Ibe.test(e)),function(e){Object.defineProperty(e,"__esModule",{value:!0}),(0,G.__exportStar)(Ry,e)}(Gs);var IC={},OC={},Ys={},Vq;function Mt(){if(Vq)return Ys;Vq=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.hasContentType=Ys.hasFieldContentType=void 0;const e=In,t=Zw();function n(i){var o;return r(i)&&i.__TYPE__===t.FieldContentType&&((o=i)===null||o===void 0?void 0:o.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}Ys.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return Ys.hasContentType=r,Ys}var Hq;function Gq(){return Hq||(Hq=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=Mt();e.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const u=i.union([i.null,i.type({value:i.null})]),s=c=>new i.Type("EmptyLegacy",e.isEmptyContent,l=>(0,r.pipe)(u.decode(l),n.either.map(()=>({type:c,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=s,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(OC)),OC}var CC={},Ln={},fo={},My={},at={},wC={};const ha=Ac(AN);Object.defineProperty(wC,"__esModule",{value:!0});const Obe=G,Cbe=ha,wbe=wi,xy=(0,Obe.__importStar)(Q);wC.default=new xy.Type("dateFromString",e=>e instanceof Date,(e,t)=>(0,wbe.pipe)(xy.string.validate(e,t),(0,Cbe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?xy.failure(e,t):xy.success(r)})),e=>e.toISOString());var EC={};Object.defineProperty(EC,"__esModule",{value:!0});const Ebe=G,Rbe=ha,Mbe=wi,df=(0,Ebe.__importStar)(Q);EC.default=new df.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,Mbe.pipe)(df.union([df.number,df.string]).validate(e,t),(0,Rbe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?df.failure(e,t):df.success(r)})),e=>e);var RC={};Object.defineProperty(RC,"__esModule",{value:!0});const xbe=G,kbe=ha,Abe=wi,ky=(0,xbe.__importStar)(Q);RC.default=new ky.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,Abe.pipe)(ky.number.validate(e,t),(0,kbe.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?ky.failure(e,t):ky.success(r)})),e=>e.getTime());var MC={};Object.defineProperty(MC,"__esModule",{value:!0});const Fbe=G,Nbe=ha,Pbe=wi,Js=(0,Fbe.__importStar)(Q);MC.default=new Js.Type("IntFromNumber",Js.Int.is,(e,t)=>(0,Pbe.pipe)(Js.number.validate(e,t),(0,Nbe.chain)(n=>Js.Int.is(n)?Js.success(n):Js.success(Math.round(n)))),Js.Int.encode);var xC={};Object.defineProperty(xC,"__esModule",{value:!0});const Wbe=G,Lbe=ha,jbe=wi,pf=(0,Wbe.__importStar)(Q),Dbe=/^([0-9]+)px$/;xC.default=new pf.Type("IntFromPixels",pf.Int.is,(e,t)=>(0,jbe.pipe)(pf.string.validate(e,t),(0,Lbe.chain)(n=>{try{const r=n.match(Dbe);if(!r)return pf.failure(e,t);const i=parseInt(r[1]);return pf.success(i)}catch{return pf.failure(e,t)}})),String);var kC={};Object.defineProperty(kC,"__esModule",{value:!0});const Ube=(0,G.__importStar)(Q),Bbe=rt;kC.default=(0,Bbe.refineType)(Ube.string,"nonEmptyString",e=>e.trim().length>0);var AC={},Ay={};Object.defineProperty(Ay,"__esModule",{value:!0});const qbe=(0,G.__importStar)(Q),zbe=rt;Ay.default=(0,zbe.nullable)(qbe.string),Object.defineProperty(AC,"__esModule",{value:!0});const Kbe=G,Vbe=ha,Hbe=wi,FC=Q,Gbe=(0,Kbe.__importDefault)(Ay);AC.default=new FC.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,Hbe.pipe)(Gbe.default.validate(e,t),(0,Vbe.chain)(n=>typeof n=="string"&&n.length>0?(0,FC.success)(n):(0,FC.success)(null))),e=>e);var NC={};Object.defineProperty(NC,"__esModule",{value:!0});const Ybe=(0,G.__importStar)(Q),Jbe=rt;NC.default=(0,Jbe.nullable)(Ybe.number);var PC={};Object.defineProperty(PC,"__esModule",{value:!0});const Zbe=G,Xbe=ha,Qbe=wi,Fy=(0,Zbe.__importStar)(Q);PC.default=new Fy.Type("StringFromInt",Fy.string.is,(e,t)=>(0,Qbe.pipe)(Fy.boolean.validate(e,t),(0,Xbe.chain)(n=>Fy.success(n.toString()))),e=>e);var WC={};Object.defineProperty(WC,"__esModule",{value:!0});const e_e=G,t_e=ha,n_e=wi,Ny=(0,e_e.__importStar)(Q);WC.default=new Ny.Type("StringFromInt",Ny.string.is,(e,t)=>(0,n_e.pipe)(Ny.number.validate(e,t),(0,t_e.chain)(n=>Ny.success(n.toString()))),e=>e),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=G;var n=wC;Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=EC;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=RC;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),e.Function=(0,t.__importStar)(rt);var o=MC;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=xC;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=kC;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=AC;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=NC;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=PC;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=WC;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var d=Ay;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}})}(at);var ma={},LC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))})(LC);var jC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))})(jC);var DC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))})(DC);var UC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))})(UC);var BC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))})(BC);var qC={},lh={},Py={},hf={},Zs={};Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.pipe=Zs.pipeable=void 0;var zC=Ye,r_e=function(e){return typeof e.map=="function"},i_e=function(e){return typeof e.contramap=="function"},o_e=function(e){return typeof e.mapWithIndex=="function"},a_e=function(e){return typeof e.ap=="function"},u_e=function(e){return typeof e.chain=="function"},s_e=function(e){return typeof e.bimap=="function"},c_e=function(e){return typeof e.extend=="function"},l_e=function(e){return typeof e.reduce=="function"},f_e=function(e){return typeof e.reduceWithIndex=="function"},d_e=function(e){return typeof e.alt=="function"},p_e=function(e){return typeof e.compact=="function"},h_e=function(e){return typeof e.filter=="function"},m_e=function(e){return typeof e.filterWithIndex=="function"},v_e=function(e){return typeof e.promap=="function"},g_e=function(e){return typeof e.compose=="function"},y_e=function(e){return typeof e.throwError=="function"};function b_e(e){var t={};if(r_e(e)){var n=function(T){return function($){return e.map($,T)}};t.map=n}if(i_e(e)){var r=function(T){return function($){return e.contramap($,T)}};t.contramap=r}if(o_e(e)){var i=function(T){return function($){return e.mapWithIndex($,T)}};t.mapWithIndex=i}if(a_e(e)){var o=function(T){return function($){return e.ap($,T)}},a=function(T){return function($){return e.ap(e.map($,function(x){return function(){return x}}),T)}};t.ap=o,t.apFirst=a,t.apSecond=function(T){return function($){return e.ap(e.map($,function(){return function(x){return x}}),T)}}}if(u_e(e)){var u=function(T){return function($){return e.chain($,T)}},s=function(T){return function($){return e.chain($,function(x){return e.map(T(x),function(){return x})})}},c=function(T){return e.chain(T,zC.identity)};t.chain=u,t.chainFirst=s,t.flatten=c}if(s_e(e)){var l=function(T,$){return function(x){return e.bimap(x,T,$)}},f=function(T){return function($){return e.mapLeft($,T)}};t.bimap=l,t.mapLeft=f}if(c_e(e)){var d=function(T){return function($){return e.extend($,T)}},p=function(T){return e.extend(T,zC.identity)};t.extend=d,t.duplicate=p}if(l_e(e)){var h=function(T,$){return function(x){return e.reduce(x,T,$)}},v=function(T){var $=e.foldMap(T);return function(x){return function(L){return $(L,x)}}},g=function(T,$){return function(x){return e.reduceRight(x,T,$)}};t.reduce=h,t.foldMap=v,t.reduceRight=g}if(f_e(e)){var b=function(T,$){return function(x){return e.reduceWithIndex(x,T,$)}},S=function(T){var $=e.foldMapWithIndex(T);return function(x){return function(L){return $(L,x)}}},O=function(T,$){return function(x){return e.reduceRightWithIndex(x,T,$)}};t.reduceWithIndex=b,t.foldMapWithIndex=S,t.reduceRightWithIndex=O}if(d_e(e)){var y=function(T){return function($){return e.alt($,T)}};t.alt=y}if(p_e(e)&&(t.compact=e.compact,t.separate=e.separate),h_e(e)){var C=function(T){return function($){return e.filter($,T)}},I=function(T){return function($){return e.filterMap($,T)}},M=function(T){return function($){return e.partition($,T)}},R=function(T){return function($){return e.partitionMap($,T)}};t.filter=C,t.filterMap=I,t.partition=M,t.partitionMap=R}if(m_e(e)){var U=function(T){return function($){return e.filterWithIndex($,T)}},q=function(T){return function($){return e.filterMapWithIndex($,T)}},N=function(T){return function($){return e.partitionWithIndex($,T)}},Z=function(T){return function($){return e.partitionMapWithIndex($,T)}};t.filterWithIndex=U,t.filterMapWithIndex=q,t.partitionWithIndex=N,t.partitionMapWithIndex=Z}if(v_e(e)){var ee=function(T,$){return function(x){return e.promap(x,T,$)}};t.promap=ee}if(g_e(e)){var J=function(T){return function($){return e.compose($,T)}};t.compose=J}if(y_e(e)){var ve=function(T){return function($){return $._tag==="None"?e.throwError(T()):e.of($.value)}},Ie=function(T){return T._tag==="Left"?e.throwError(T.left):e.of(T.right)},k=function(T,$){return function(x){return T(x)?e.of(x):e.throwError($(x))}},A=function(T,$){return function(x){return e.chain(x,function(L){return T(L)?e.of(L):e.throwError($(L))})}};t.fromOption=ve,t.fromEither=Ie,t.fromPredicate=k,t.filterOrElse=A}return t}Zs.pipeable=b_e,Zs.pipe=zC.pipe;var __e=de&&de.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),$_e=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),S_e=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&__e(t,e,n);return $_e(t,e),t};Object.defineProperty(hf,"__esModule",{value:!0}),hf.NumberFromString=void 0;var fh=S_e(Q),T_e=Zs,I_e=In;hf.NumberFromString=new fh.Type("NumberFromString",fh.number.is,function(e,t){return T_e.pipe(fh.string.validate(e,t),I_e.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?fh.failure(e,t):fh.success(r)}))},String);var O_e=de&&de.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),C_e=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),w_e=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&O_e(t,e,n);return C_e(t,e),t};Object.defineProperty(Py,"__esModule",{value:!0}),Py.IntFromString=void 0;var dh=w_e(Q),Yq=hf,E_e=Zs,R_e=In;Py.IntFromString=new dh.Type("IntFromString",dh.Int.is,function(e,t){return E_e.pipe(Yq.NumberFromString.validate(e,t),R_e.chain(function(n){return dh.Int.is(n)?dh.success(n):dh.failure(e,t)}))},Yq.NumberFromString.encode),Object.defineProperty(lh,"__esModule",{value:!0});const M_e=G,x_e=In,va=(0,M_e.__importStar)(Q),k_e=Py,Jq=at,Zq=new va.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>x_e.either.chain(va.union([va.literal("auto"),va.literal(""),va.Int,k_e.IntFromString,Jq.IntFromNumber,Jq.IntFromPixels,va.null]).validate(e,t),n=>n==="auto"||n===""?va.success(null):va.success(n)),e=>e),A_e=va.partial({width:Zq,height:Zq});lh.default=A_e,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=G,n=(0,t.__importStar)(Q),r=at,i=(0,t.__importDefault)(lh);e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))}(qC);var KC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))})(KC);var VC={},mf={},Wy={},Ly={};Object.defineProperty(Ly,"__esModule",{value:!0}),Ly.clone=void 0;function F_e(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}Ly.clone=F_e;var N_e=de&&de.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),P_e=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),W_e=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&N_e(t,e,n);return P_e(t,e),t};Object.defineProperty(Wy,"__esModule",{value:!0}),Wy.withValidate=void 0;var L_e=W_e(Q),j_e=Ly;function D_e(e,t,n){n===void 0&&(n=e.name);var r=j_e.clone(e);return r.validate=t,r.decode=function(i){return t(i,L_e.getDefaultContext(r))},r.name=n,r}Wy.withValidate=D_e;var U_e=de&&de.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),B_e=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),q_e=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&U_e(t,e,n);return B_e(t,e),t};Object.defineProperty(mf,"__esModule",{value:!0}),mf.withFallback=void 0;var z_e=q_e(Q),K_e=Wy,V_e=In;function H_e(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),K_e.withValidate(e,function(r,i){return V_e.orElse(function(){return z_e.success(t)})(e.validate(r,i))},n)}mf.withFallback=H_e,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=G,n=In,r=(0,t.__importStar)(Q),i=mf,o=at,a=c=>{if(c instanceof Array&&c.reduce((f,d)=>f&&typeof d=="string",!0))return r.success(c)},u=c=>{if(typeof c=="string")return r.success([c])},s=new r.Type("MasksArrayString",c=>c instanceof Array,(c,l)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(c,l),f=>a(f)||u(f)||r.failure(c,l)),c=>c);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:s,tags:s,allowTargetBlank:r.boolean})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))}(VC);var HC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=(0,G.__importStar)(Q),r=hf,i=at;e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))})(HC);var GC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=(0,G.__importStar)(Q),r=hf,i=at;e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))})(GC);var YC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=G,n=ht,r=In,i=Ye,o=(0,t.__importStar)(Q),a=at,u=(0,t.__importDefault)(lh);e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},e.RichTextNodeTypeCodec=o.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const s=new o.Type("RichTextOptions",h=>typeof h=="string",h=>(0,i.pipe)(o.union([o.string,o.null]).decode(h),n.either.map(v=>{if(!v)return e.DEFAULT_OPTION;const b=v.split(",").map(S=>S.trim()).filter(S=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(S)));return b.length?b.join(","):e.DEFAULT_OPTION})),h=>h),c=h=>{if(!h)return o.success([])},l=h=>{if(h instanceof Object){const v=h;if(!Object.entries(v).length)return o.success([]);if(v[""])return o.success(v[""].map(b=>b.name));const g=Object.entries(v).reduce((b,[,S])=>b.concat(S.map(O=>O.name)),[]).filter(Boolean);return o.success(g)}},f=h=>{if(h instanceof Array&&h.reduce((g,b)=>g&&typeof b=="string",!0))return o.success(h)},d=h=>{if(typeof h=="string")return o.success([h])},p=new o.Type("RichTextLabels",h=>h instanceof Array,(h,v)=>{const g=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),b=o.readonlyArray(o.string);return(0,i.pipe)(o.union([g,b,o.string,o.null]).decode(h),n.either.chain(S=>c(S)||f(S)||l(S)||d(S)||o.failure(h,v)))},h=>h);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:s,multi:s,imageConstraint:u.default,labels:p,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))})(YC);var JC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.SelectFieldType="Select",e.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))})(JC);var ZC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))})(ZC);var XC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))})(XC);var QC={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))})(QC),Object.defineProperty(ma,"__esModule",{value:!0}),ma.NestableWidget=void 0;const G_e=(0,G.__importStar)(Q),Y_e=LC,J_e=jC,Z_e=DC,X_e=UC,Q_e=BC,e0e=qC,t0e=KC,n0e=VC,r0e=HC,i0e=GC,o0e=YC,a0e=JC,u0e=ZC,s0e=XC,c0e=QC;ma.NestableWidget=G_e.union([J_e.Color,Y_e.BooleanField,X_e.Embed,Q_e.GeoPoint,Z_e.Date,r0e.Number,i0e.Range,o0e.RichText,a0e.Select,u0e.Separator,s0e.Text,c0e.Timestamp,n0e.Link,e0e.Image,t0e.IntegrationField]),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.GroupFieldType=void 0;const n=(0,G.__importStar)(Q),r=Gs,i=at,o=ma;e.GroupFieldType="Group",e.GroupConfig=n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,o.NestableWidget)})),e.Group=n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:e.GroupConfig})]))}(My);var jy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(LC,e),(0,t.__exportStar)(jC,e),(0,t.__exportStar)(DC,e),(0,t.__exportStar)(UC,e),(0,t.__exportStar)(BC,e),(0,t.__exportStar)(qC,e),(0,t.__exportStar)(KC,e),(0,t.__exportStar)(VC,e),(0,t.__exportStar)(ma,e),(0,t.__exportStar)(HC,e),(0,t.__exportStar)(GC,e),(0,t.__exportStar)(YC,e),(0,t.__exportStar)(JC,e),(0,t.__exportStar)(ZC,e),(0,t.__exportStar)(XC,e),(0,t.__exportStar)(QC,e)})(jy);var Xq={};(function(e){var t=de&&de.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=lh;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(Xq);var Qq={},Dy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=(0,G.__importStar)(Q),r=Gs,i=at,o=ma;e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]))})(Dy);var ph={};Object.defineProperty(ph,"__esModule",{value:!0}),ph.LegacySlice=void 0;const l0e=(0,G.__importStar)(Q),f0e=My,d0e=ma;ph.LegacySlice=l0e.union([d0e.NestableWidget,f0e.Group]);var hh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=(0,G.__importStar)(Q),r=mf,i=Gs,o=ma,a="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,a),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,o.NestableWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice",e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string})]))})(hh);var mh={};Object.defineProperty(mh,"__esModule",{value:!0}),mh.SharedSliceRef=void 0;const ew=(0,G.__importStar)(Q),p0e=hh;mh.SharedSliceRef=ew.exact(ew.type({type:ew.literal(p0e.SharedSliceType)}));var ez={};Object.defineProperty(ez,"__esModule",{value:!0});var tw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;const n=(0,G.__importStar)(Q),r=Gs,i=at,o=Dy,a=ph,u=hh,s=mh;e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]);function c(d){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,d]))}))}e.slicesConfigReader=c,e.StaticSlicesConfig=c(u.SharedSlice),e.DynamicSlicesConfig=c(s.SharedSliceRef);const l={toStatic(d,p){const h=Object.entries(d.choices||{}).reduce((v,[g,b])=>{if(b.type==="SharedSlice"){const S=p.get(g);return S?{...v,[g]:S}:v}else return{...v,[g]:b}},{});return{...d,choices:h}}};function f(d){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:d})]))}e.slicesReader=f,e.StaticSlices=f(e.StaticSlicesConfig),e.DynamicSlices=f(e.DynamicSlicesConfig),e.Slices={toStatic(d,p){return d.config?{...d,config:l.toStatic(d.config,p)}:d}}})(tw);var Uy={};Object.defineProperty(Uy,"__esModule",{value:!0}),Uy.SlicesTypes=void 0;const h0e=(0,G.__importStar)(Q),m0e=Dy,v0e=hh;Uy.SlicesTypes=h0e.keyof({[m0e.CompositeSliceType]:null,[v0e.SharedSliceType]:null}),function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Dy,e),(0,t.__exportStar)(ph,e),(0,t.__exportStar)(hh,e),(0,t.__exportStar)(mh,e),(0,t.__exportStar)(ez,e),(0,t.__exportStar)(tw,e),(0,t.__exportStar)(Uy,e)}(Qq);var nw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=(0,G.__importStar)(Q),r=at;e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))})(nw);var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.Widgets=Cr.FieldType=Cr.DynamicWidget=Cr.StaticWidget=Cr.widgetReader=void 0;const tz=(0,G.__importStar)(Q),nz=My,jn=jy,g0e=ma,vh=tw,rz=nw;function rw(e){return tz.union([rz.UID,g0e.NestableWidget,nz.Group,e])}Cr.widgetReader=rw,Cr.StaticWidget=rw(vh.StaticSlices),Cr.DynamicWidget=rw(vh.DynamicSlices),Cr.FieldType=tz.keyof({[jn.ColorFieldType]:null,[jn.BooleanFieldType]:null,[jn.NumberFieldType]:null,[jn.EmbedFieldType]:null,[jn.GeoPointFieldType]:null,[jn.DateFieldType]:null,[jn.RangeFieldType]:null,[jn.RichTextFieldType]:null,[jn.SelectFieldType]:null,[jn.SeparatorFieldType]:null,[jn.TextFieldType]:null,[jn.TimestampFieldType]:null,[jn.LinkFieldType]:null,[jn.ImageFieldType]:null,[jn.IntegrationFieldType]:null,[rz.UIDFieldType]:null,[nz.GroupFieldType]:null,[vh.SlicesFieldType]:null,[vh.LegacySlicesFieldType]:null}),Cr.Widgets={toStatic(e,t){switch(e.type){case"Choice":case"Slices":return vh.Slices.toStatic(e,t);default:return e}}},function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(My,e),(0,t.__exportStar)(jy,e),(0,t.__exportStar)(Xq,e),(0,t.__exportStar)(Qq,e),(0,t.__exportStar)(nw,e),(0,t.__exportStar)(Cr,e)}(fo),Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.defaultCtx=Ln.getFieldCtx=Ln.LegacyContentCtx=Ln.FieldOrSliceType=void 0;const y0e=(0,G.__importStar)(Q),iz=fo;Ln.FieldOrSliceType=y0e.union([iz.FieldType,iz.SlicesTypes]);class iw{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;const i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}Ln.LegacyContentCtx=iw;function b0e(e,t,n){return new iw(e,[...t.fieldPath,t.fieldKey,...n||[]],t.allTypes)}Ln.getFieldCtx=b0e;function _0e(e,t=new Map){return new iw(e,[],t)}Ln.defaultCtx=_0e;var ow={},aw={},oz;function az(){return oz||(oz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=Mt();e.BooleanContentType="BooleanContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const u=s=>new i.Type("BooleanLegacy",e.isBooleanContent,c=>(0,r.pipe)(i.boolean.decode(c),n.either.map(l=>e.BooleanContent.encode({value:l,__TYPE__:e.BooleanContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"Boolean"}}));e.BooleanLegacy=u,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean})}(aw)),aw}var uw={},uz;function sw(){return uz||(uz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=at,a=Mt();e.EmbedContentType="EmbedContent";const u=c=>(0,a.hasContentType)(c)&&c.__TYPE__===e.EmbedContentType;e.isEmbedContent=u,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const s=c=>new i.Type("EmbedLegacy",e.isEmbedContent,l=>(0,r.pipe)(e.EmbedContentLegacy.decode(l),n.either.map(f=>({...f,all:l,__TYPE__:e.EmbedContentType}))),l=>({content:l.all,types:{[c.keyOfType]:"Embed"}}));e.EmbedLegacy=s,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(uw)),uw}var cw={},lw={},ga={};Object.defineProperty(ga,"__esModule",{value:!0});const $0e=G,S0e=ha,T0e=wi,By=(0,$0e.__importStar)(Q);function I0e(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}ga.default=new By.Type("TrimmedString",By.string.is,(e,t)=>(0,T0e.pipe)(By.string.validate(e,t),(0,S0e.chain)(n=>By.success(I0e(n)))),e=>e);var Hr={};Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.FieldContentType=void 0,Hr.FieldContentType="FieldContent";var sz;function cz(){return sz||(sz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=fo,a=(0,t.__importDefault)(ga),u=Mt(),s=Hr,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Color";e.isColorContent=c;const l=f=>new i.Type("ColorLegacy",e.isColorContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.ColorContent.encode({value:p,type:o.ColorFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=l,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(lw)),lw}var fw={},lz;function fz(){return lz||(lz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=fo,a=(0,t.__importDefault)(ga),u=Mt(),s=Hr,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Date";e.isDateContent=c;const l=f=>new i.Type("DateLegacy",e.isDateContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.DateContent.encode({value:p,type:o.DateFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.DateFieldType}}));e.DateLegacy=l,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(fw)),fw}var dw={},dz;function pz(){return dz||(dz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=fo,a=(0,t.__importDefault)(ga),u=Mt(),s=Hr,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Number";e.isNumberContent=c;const l=f=>new i.Type("NumberLegacy",e.isNumberContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.NumberContent.encode({value:p,type:o.NumberFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=l,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(dw)),dw}var pw={},hz;function mz(){return hz||(hz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=fo,a=(0,t.__importDefault)(ga),u=Mt(),s=Hr,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Range";e.isRangeContent=c;const l=f=>new i.Type("RangeLegacy",e.isRangeContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.RangeContent.encode({value:p,type:o.RangeFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=l,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(pw)),pw}var hw={},vz;function gz(){return vz||(vz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=fo,a=(0,t.__importDefault)(ga),u=Mt(),s=Hr,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Select";e.isSelectContent=c;const l=f=>new i.Type("SelectLegacy",e.isSelectContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.SelectContent.encode({value:p,type:o.SelectFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=l,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(hw)),hw}var mw={},yz;function bz(){return yz||(yz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=fo,a=(0,t.__importDefault)(ga),u=Mt(),s=Hr,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Text";e.isTextContent=c;const l=f=>new i.Type("TextLegacy",e.isTextContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.TextContent.encode({value:p,type:o.TextFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.TextFieldType}}));e.TextLegacy=l,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(mw)),mw}var vw={},_z;function $z(){return _z||(_z=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=fo,a=(0,t.__importDefault)(ga),u=Mt(),s=Hr,c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Timestamp";e.isTimestampContent=c;const l=f=>new i.Type("TimestampLegacy",e.isTimestampContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.TimestampContent.encode({value:p,type:o.TimestampFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=l,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(vw)),vw}var Sz;function Tz(){return Sz||(Sz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=G,n=(0,t.__importStar)(Q),r=cz(),i=fz(),o=pz(),a=mz(),u=gz(),s=bz(),c=$z();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,u.SelectContent,s.TextContent,c.TimestampContent]),(0,t.__exportStar)(cz(),e),(0,t.__exportStar)(Hr,e),(0,t.__exportStar)(fz(),e),(0,t.__exportStar)(pz(),e),(0,t.__exportStar)(mz(),e),(0,t.__exportStar)(gz(),e),(0,t.__exportStar)(bz(),e),(0,t.__exportStar)($z(),e)}(cw)),cw}var gw={},Iz;function Oz(){return Iz||(Iz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=G,n=ht,r=wi,i=(0,t.__importStar)(Q),o=Mt();e.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const u=i.strict({position:i.strict({lat:i.number,lng:i.number})}),s=c=>new i.Type("GeoPointLegacy",e.isGeoPointContent,l=>(0,r.pipe)(u.decode(l),n.either.map(f=>e.GeoPointContent.encode({...f,__TYPE__:e.GeoPointContentType}))),l=>({content:{position:l.position},types:{[c.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=s,e.GeoPointContent=i.intersection([u,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(gw)),gw}var yw={},ya={};Object.defineProperty(ya,"__esModule",{value:!0}),ya.withOptionals=ya.isNotEmpty=ya.zipObjects=void 0;function O0e(e,t){return[...new Set(Object.keys(e||{}).concat(Object.keys(t||{})))].reduce((r,i)=>{const o=e==null?void 0:e[i],a=t==null?void 0:t[i];return{...r,[i]:{left:o,right:a}}},{})}ya.zipObjects=O0e;function C0e(e){return Boolean(Object.keys(e).length)}ya.isNotEmpty=C0e;function w0e(e,t){return{...e,...t.reduce((n,[r,i])=>i?{...n,[r]:i}:n,{})}}ya.withOptionals=w0e;var Cz;function bw(){return Cz||(Cz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=ya,a=at,u=Mt();e.ImageContentType="ImageContent";const s=d=>(0,u.hasContentType)(d)&&d.__TYPE__===e.ImageContentType;e.isImageContent=s;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const l=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),f=d=>new i.Type("ImageLegacy",e.isImageContent,p=>(0,r.pipe)(l.decode(p),n.either.map(h=>e.ImageContent.encode({...h,__TYPE__:e.ImageContentType}))),p=>({content:(0,o.withOptionals)({edit:p.edit,height:p.height,origin:p.origin,width:p.width},[["alt",p.alt],["credits",p.credits],["provider",p.provider],["thumbnails",p.thumbnails],["url",p.url]]),types:{[d.keyOfType]:"Image"}}));e.ImageLegacy=f,e.ImageContent=i.intersection([l,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(yw)),yw}var _w={},wz;function Ez(){return wz||(wz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=Mt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const u=s=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.IntegrationFieldContent.encode({value:l,__TYPE__:e.IntegrationFieldContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=u,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(_w)),_w}var $w={},Rz=Oy(Ci,function(e){return e.length>0},"NonEmptyString");function Mz(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=wy(e);return new $e(t,function(r){return n.is(r)&&Ft(r)},function(r,i){return le(n.validate(r,i),jr(function(o){var a=W0(o);return We(a)?Xe(r,i):Ce(a.value)}))},function(r){return n.encode(r)})}function xz(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=wy(e),i=WU(t),o=FU(t);return new $e(n,function(a){return a instanceof Set&&PU(e.is)(a)},function(a,u){return le(r.validate(a,u),jr(function(s){var c=o(s);return c.size!==s.length?Xe(a,u):Ce(c)}))},function(a){return r.encode(i(a))})}function E0e(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),xz(e,t,n)}function Sw(e,t){return new $e(e,t,function(n,r){return t(n)?Ce(n):Xe(n,r)},je)}var R0e=function(e){return e instanceof Date},M0e=Sw("Date",R0e),x0e=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},k0e=function(e,t){return{get:e,reverseGet:t}},kz=function(e){return gu(e.get,H(e.reverseGet,Gn))},A0e=function(e){return Xs(H(e.get,yt),e.reverseGet)},F0e=function(e){return ba(H(e.get,yt),H(e.reverseGet,Gn))},N0e=function(e){return vf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},gu=function(e,t){return{get:e,set:t}},Tw=function(e){return ba(H(e.get,yt),e.set)},P0e=function(e){return vf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},Az=function(e){return function(t){return gu(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},W0e=function(e){return function(t){return Xs(H(t.getOption,Kd(e.getOption)),H(e.reverseGet,t.reverseGet))}},L0e=function(e){return function(t){return Qs(Iw(e))(Tw(t))}},j0e=function(){return gu(B,Gn)},D0e=function(e){return function(t){return gu(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,(i={},i[e]=n,i)))(r)}})}},U0e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return gu(function(r){for(var i=n.get(r),o={},a=0,u=e;a<u.length;a++){var s=u[a];o[s]=i[s]}return o},function(r){return function(i){for(var o=n.get(i),a=0,u=e;a<u.length;a++){var s=u[a];if(r[s]!==o[s])return n.set(Object.assign({},o,r))(i)}return i}})}},B0e=function(e){return function(t){return gu(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},q0e=function(e){return function(t){return le(t,Az(f$e().at(e)))}},Xs=function(e,t){return{getOption:e,reverseGet:t}},Iw=function(e){return ba(e.getOption,function(t){return Nz(t)(e)})},Fz=function(e){return vf(function(t){return function(n){return function(r){return le(e.getOption(r),Uo(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return Nz(o)(e)(r)})}))}}})},z0e=function(e){return function(t){return function(n){return le(t.getOption(n),Zi(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},K0e=function(e){return function(t){var n=z0e(e)(t);return function(r){return le(n(r),vS(function(){return r}))}}},Nz=function(e){return K0e(function(){return e})},V0e=function(e){return function(t){return Qs(Tw(e))(Iw(t))}},H0e=function(){return Xs(ps,B)},Ow=function(e){return Xs(kv(e),B)},G0e=function(){return Xs(B,yt)},Y0e=function(){return Xs(pl,Ke)},J0e=function(){return Xs(function(e){return ue(e)?yt(e.left):nt},$t)},ba=function(e,t){return{getOption:e,set:t}},Z0e=function(e){return vf(function(t){return function(n){return function(r){return le(e.getOption(r),Uo(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},Pz=function(e){return function(t){return function(n){return le(t.getOption(n),Zi(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},Wz=function(e){return function(t){var n=Pz(e)(t);return function(r){return le(n(r),vS(function(){return r}))}}},Qs=function(e){return function(t){return ba(H(t.getOption,Kd(e.getOption)),function(n){return Wz(e.set(n))(t)})}},X0e=function(e){return function(t){return le(t,Qs(u$e().index(e)))}},Q0e=function(e){return function(t){return le(t,Qs(s$e().index(e)))}},e$e=function(e){return function(t){return le(t,Qs(c$e().index(e)))}},t$e=function(e){return ba(lv(e),function(t){return function(n){return le(cv(e)(n),Uo(function(){return n},function(r){return Sv(r,t,n)}))}})},Lz=function(e,t,n){if(n[e]===t)return n;var r=x0e([n[0]],n.slice(1),!0);return r[e]=t,r},n$e=function(e){return ba(lv(e),function(t){return function(n){return le(cv(e)(n),Uo(function(){return n},function(r){return Lz(r,t,n)}))}})},vf=function(e){return{modifyF:e}};function Cw(e){return function(t){return vf(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var r$e={URI:"Identity",map:function(e,t){return t(e)},of:B,ap:function(e,t){return e(t)}},i$e=function(e){return e.URI==="Identity"};function o$e(e){return function(){return vf(function(t){var n=i$e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function a$e(e){return Cw(o$e(e)())}var ww=function(e){return{index:e}},u$e=function(){return ww(function(e){return ba(function(t){return us(e,t)},function(t){return function(n){return le(us(e,n),Uo(function(){return n},function(){return Sv(e,t,n)}))}})})},s$e=function(){return ww(function(e){return ba(function(t){return us(e,t)},function(t){return function(n){return le(us(e,n),Uo(function(){return n},function(){return Lz(e,t,n)}))}})})},c$e=function(){return ww(function(e){return ba(function(t){return Yu(e,t)},function(t){return function(n){return n[e]===t||We(Yu(e,n))?n:E0(e,t)(n)}})})},l$e=function(e){return{at:e}};function f$e(){return l$e(function(e){return gu(function(t){return Yu(e,t)},Uo(function(){return jm(e)},function(t){return E0(e,t)}))})}var jz=k0e,Ew=kz,Rw=A0e,Mw=F0e,xw=N0e,d$e=function(e){return function(t){return jz(H(t.get,e.get),H(e.reverseGet,t.reverseGet))}},p$e=function(e){return jz(e.reverseGet,e.get)},h$e=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},Dz=gu,qy=j0e,yu=Tw,gf=P0e,ec=Az,m$e=ec,v$e=H(kz,ec),tc=L0e,kw=function(e){return H(yu,Qs(e))},g$e=function(e){return H(gf,Cw(e))},Uz=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function y$e(e){return function(t){return function(n){return function(r){return le(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var b$e=function(e){return tc(H0e())(e)};function _$e(e){return tc(Ow(e))}var Bz=D0e,qz=U0e,$$e=B0e,S$e=function(e){return H(yu,X0e(e))},T$e=function(e){return H(yu,Q0e(e))},I$e=function(e){return H(yu,e$e(e))},O$e=q0e,C$e=tc(G0e()),w$e=tc(Y0e()),E$e=tc(J0e());function R$e(e){return H(gf,a$e(e))}function M$e(e){return kw(t$e(e))}function x$e(e){return kw(n$e(e))}var k$e=function(e,t){return function(n){return zz(n,e,t)}},zz=function(e,t,n){return Dz(H(e.get,t),H(n,e.set))},zy="monocle-ts/Lens",A$e={URI:zy,imap:zz},Kz={URI:zy,compose:function(e,t){return ec(e)(t)}},F$e={URI:zy,compose:Kz.compose,id:qy};const N$e=Object.freeze(Object.defineProperty({__proto__:null,Category:F$e,Invariant:A$e,Semigroupoid:Kz,URI:zy,asOptional:yu,asTraversal:gf,atKey:O$e,component:$$e,compose:ec,composeIso:v$e,composeLens:m$e,composeOptional:kw,composePrism:tc,composeTraversal:g$e,filter:_$e,findFirst:M$e,findFirstNonEmpty:x$e,fromNullable:b$e,id:qy,imap:k$e,index:S$e,indexNonEmpty:T$e,key:I$e,left:E$e,lens:Dz,modify:Uz,modifyF:y$e,prop:Bz,props:qz,right:w$e,some:C$e,traverse:R$e},Symbol.toStringTag,{value:"Module"}));var Vz=Z0e,nc=Qs,P$e=Pz,W$e=Wz,L$e=Ow,Aw=Iw,Fw=Fz,Nw=W0e,j$e=V0e,_a=Cw,Hz=function(e){return function(t){return t.modifyF(r$e)(e)}},D$e=function(e){return Hz(function(){return e})};function U$e(e){return _a(Fz(Ow(e)))}var Gz=function(e){return new Jz(e.get,e.reverseGet)},yf=function(e){return new Pw(e.get,e.set)},gh=function(e){return new Zz(e.getOption,e.reverseGet)},Gr=function(e){return new B$e(e.getOption,e.set)},wr=function(e){return new q$e(e.modifyF)},Yz=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},Jz=function(){function e(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return e.prototype.reverse=function(){return Gz(p$e(this))},e.prototype.modify=function(t){return h$e(t)(this)},e.prototype.asLens=function(){return yf(Ew(this))},e.prototype.asPrism=function(){return gh(Rw(this))},e.prototype.asOptional=function(){return Gr(Mw(this))},e.prototype.asTraversal=function(){return wr(xw(this))},e.prototype.asFold=function(){var t=this;return new bf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new Qz(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new yh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Gz(d$e(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return yf(le(this,Ew,ec(t)))},e.prototype.composePrism=function(t){return gh(le(this,Rw,Nw(t)))},e.prototype.composeOptional=function(t){return Gr(le(this,Mw,nc(t)))},e.prototype.composeTraversal=function(t){return wr(le(this,xw,_a(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),Pw=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return yf(le(qy(),Bz(t)))}},e.fromProps=function(){return function(t){return yf(le(qy(),qz.apply(N$e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=ps(r[t]);return We(i)?n:i.value},function(r){return function(i){return Yz(i,t,r)}})}},e.prototype.modify=function(t){return Uz(t)(this)},e.prototype.asOptional=function(){return Gr(yu(this))},e.prototype.asTraversal=function(){return wr(gf(this))},e.prototype.asSetter=function(){var t=this;return new yh(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new Qz(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new bf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return yf(ec(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return Gr(le(this,yu,nc(t)))},e.prototype.composeTraversal=function(t){return wr(le(this,gf,_a(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return yf(le(this,ec(le(t,Ew))))},e.prototype.composePrism=function(t){return Gr(tc(t)(this))},e}(),Zz=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return gh(L$e(t))},e.some=function(){return Xz},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return We(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return HF.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return Gr(Aw(this))},e.prototype.asTraversal=function(){return wr(Fw(this))},e.prototype.asSetter=function(){var t=this;return new yh(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new bf(function(n){return function(r){return function(i){var o=t.getOption(i);return We(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return gh(Nw(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Gr(le(this,Aw,nc(t)))},e.prototype.composeTraversal=function(t){return wr(le(this,Fw,_a(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return gh(le(this,Nw(le(t,Rw))))},e.prototype.composeLens=function(t){return Gr(j$e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),Xz=new Zz(B,yt),B$e=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return ps(n[t])},function(n){return function(r){return r[t]==null?r:Yz(r,t,n)}})}},e.fromOptionProp=function(){var t=Pw.fromProp();return function(n){return t(n).composePrism(Xz)}},e.prototype.modify=function(t){return W$e(t)(this)},e.prototype.modifyOption=function(t){return P$e(t)(this)},e.prototype.asTraversal=function(){return wr(Vz(this))},e.prototype.asFold=function(){var t=this;return new bf(function(n){return function(r){return function(i){var o=t.getOption(i);return We(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new yh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Gr(nc(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return wr(le(this,Vz,_a(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return Gr(le(this,nc(le(t,yu))))},e.prototype.composePrism=function(t){return Gr(le(this,nc(le(t,Aw))))},e.prototype.composeIso=function(t){return Gr(le(this,nc(le(t,Mw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),q$e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return Hz(t)(this)},e.prototype.set=function(t){return D$e(t)(this)},e.prototype.filter=function(t){return wr(U$e(t)(this))},e.prototype.asFold=function(){var t=this;return new bf(function(n){return function(r){return t.modifyF(JF(n))(function(i){return hl(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new yh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return wr(_a(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return wr(le(this,_a(le(t,gf))))},e.prototype.composePrism=function(t){return wr(le(this,_a(le(t,Fw))))},e.prototype.composeIso=function(t){return wr(le(this,_a(le(t,xw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),Qz=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new bf(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),bf=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(G$())(Ga),this.exist=t(TL),this.all=t(SL),this.foldMapFirst=t(GF())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst(kv(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),yh=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Gn(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),z$e=new Jz(Fc,Fc);function K$e(){return z$e}function V$e(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=K$e();return new $e(t,function(r){return e.is(r)},function(r,i){return le(e.validate(r,i),gs(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var H$e=ch({_tag:uh("None")}),G$e=uh("Some");function eK(e,t){return t===void 0&&(t="Option<"+e.name+">"),sh([H$e,ch({_tag:G$e,value:e},"Some<"+e.name+">")],t)}function Y$e(e,t){return t===void 0&&(t="Option<"+e.name+">"),new $e(t,eK(e).is,function(n,r){return n==null?Ce(nt):le(e.validate(n,r),gs(yt))},function(n){return gS(le(n,Zi(e.encode)))})}var J$e=new $e("DateFromISOString",function(e){return e instanceof Date},function(e,t){return le(Ci.validate(e,t),jr(function(n){var r=new Date(n);return isNaN(r.getTime())?Xe(e,t):Ce(r)}))},function(e){return e.toISOString()});function Z$e(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),Mz(e,t)}function tK(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var X$e=new $e("DateFromNumber",function(e){return e instanceof Date},function(e,t){return le(Hs.validate(e,t),jr(function(n){var r=new Date(n);return isNaN(r.getTime())?Xe(e,t):Ce(r)}))},function(e){return e.getTime()});function Ky(e,t,n){n===void 0&&(n=e.name);var r=tK(e);return r.validate=t,r.decode=function(i){return t(i,Uq(r))},r.name=n,r}function Q$e(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),Ky(e,function(r,i){return ON(function(){return Ce(t)})(e.validate(r,i))},n)}var eSe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,tSe=Oy(Ci,function(e){return eSe.test(e)},"UUID");function nSe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),Ky(e,function(r,i){return r==null?Ce(t):e.validate(r,i)},n)}var rSe=new $e("BooleanFromString",Iy.is,function(e,t){return le(Ci.validate(e,t),jr(function(n){return n==="true"?Ce(!0):n==="false"?Ce(!1):Xe(e,t)}))},String);function iSe(e,t){return Ky(e,function(n,r){return Qd(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function nK(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return nK(e.type)}}var oSe=Pw.fromProp();function aSe(e){var t={};for(var n in nK(e))t[n]=oSe(n);return t}var uSe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},sSe=Sw("RegExp",uSe),cSe=new $e("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return le(Cy.validate(e,t),jr(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?Xe(e,t):Ce(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),Ww=new $e("NumberFromString",Hs.is,function(e,t){return le(Ci.validate(e,t),jr(function(n){var r=+n;return isNaN(r)||n.trim()===""?Xe(e,t):Ce(r)}))},String),lSe=new $e("IntFromString",Cy.is,function(e,t){return le(Ww.validate(e,t),jr(function(n){return Cy.is(n)?Ce(n):Xe(e,t)}))},Ww.encode),rK=yC("JsonArray",function(){return Wq(Vy)}),iK=yC("JsonRecord",function(){return $C(Ci,Vy)}),Vy=sh([Iy,Hs,Ci,vC,rK,iK],"Json"),fSe=new $e("JsonFromString",Vy.is,function(e,t){try{return Ce(JSON.parse(e))}catch{return Xe(e,t)}},function(e){return JSON.stringify(e)}),dSe=uh("Left"),pSe=uh("Right");function hSe(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),sh([ch({_tag:dSe,left:e},"Left<"+e.name+">"),ch({_tag:pSe,right:t},"Right<"+e.name+">")],n)}var mSe=new $e("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return le(Ci.validate(e,t),jr(function(n){if(!Rz.is(n.trim()))return Xe(e,t);try{return Ce(BigInt(n))}catch{return Xe(e,t)}}))},String);function vSe(e,t,n){return n===void 0&&(n=e.name),new $e(n,e.is,e.validate,t)}var gSe=new $e("BooleanFromNumber",Iy.is,function(e,t){return le(Hs.validate(e,t),gs(function(n){return n!==0}))},Number);const oK=Ac(Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:mSe,BooleanFromNumber:gSe,BooleanFromString:rSe,DateFromISOString:J$e,DateFromNumber:X$e,DateFromUnixTime:cSe,IntFromString:lSe,Json:Vy,JsonArray:rK,JsonFromString:fSe,JsonRecord:iK,NonEmptyString:Rz,NumberFromString:Ww,UUID:tSe,clone:tK,date:M0e,either:hSe,fromNewtype:V$e,fromNullable:nSe,fromRefinement:Sw,getLenses:aSe,mapOutput:Kq,nonEmptyArray:Mz,option:eK,optionFromNullable:Y$e,readonlyNonEmptyArray:Z$e,readonlySetFromArray:E0e,regexp:sSe,setFromArray:xz,withEncode:vSe,withFallback:Q$e,withMessage:iSe,withValidate:Ky},Symbol.toStringTag,{value:"Module"})));var aK;function Lw(){return aK||(aK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.ExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.DocumentLinkType=e.FileLinkContent=e.FileLinkType=e.ImageLinkContent=e.ImageLinkType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=oK,a=at,u=rt,s=Mt();e.ImageLinkType="ImageLink";const c=i.exact(i.intersection([i.type({id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string,kind:i.string}),i.partial({date:a.StringOrNull})])),l=new i.Type("ImageLink",O=>(0,s.hasContentType)(O)&&O.__TYPE__===e.ImageLinkType,O=>(0,r.pipe)(c.decode(O),n.either.map(y=>e.ImageLinkContent.encode({...y,__TYPE__:e.ImageLinkType}))),O=>c.encode(O));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),c]),e.FileLinkType="FileLink";const f=i.exact(i.intersection([i.type({id:i.string,url:i.string,name:i.string,kind:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:(0,u.nullable)(i.string)})])),d=new i.Type("FileLink",O=>(0,s.hasContentType)(O)&&O.__TYPE__===e.FileLinkType,O=>(0,r.pipe)(f.decode(O),n.either.map(y=>e.FileLinkContent.encode({...y,__TYPE__:e.FileLinkType}))),O=>f.encode(O));e.FileLinkContent=i.intersection([f,i.exact(i.intersection([i.type({__TYPE__:i.literal(e.FileLinkType)}),i.partial({size:(0,o.withFallback)(i.string,"0")})]))]),e.DocumentLinkType="DocumentLink";const p=i.strict({id:a.NonEmptyString}),h=new i.Type("DocumentLink",O=>(0,s.hasContentType)(O)&&O.__TYPE__===e.DocumentLinkType,O=>(0,r.pipe)(p.decode(O),n.either.map(y=>e.DocumentLinkContent.encode({...y,__TYPE__:e.DocumentLinkType}))),O=>p.encode(O));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),p]),e.ExternalLinkType="ExternalLink";const v=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:a.StringOrNull,preview:(0,u.nullable)(i.partial({title:i.string}))})])),g=new i.Type("ExternalLink",O=>(0,s.hasContentType)(O)&&O.__TYPE__===e.ExternalLinkType,O=>(0,r.pipe)(v.decode(O),n.either.map(y=>e.ExternalLinkContent.encode({...y,__TYPE__:e.ExternalLinkType}))),O=>v.encode(O));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),v]),e.LinkContentType="LinkContent";const b=O=>(0,s.hasContentType)(O)&&O.__TYPE__===e.LinkContentType;e.isLinkContent=b,e.LinkLegacy=i.union([l,d,h,g]);const S=O=>new i.Type("LinkLegacy",e.isLinkContent,y=>(0,r.pipe)(e.LinkLegacy.decode(y),n.either.map(C=>e.LinkContent.encode({value:C,__TYPE__:e.LinkContentType}))),y=>({content:e.LinkLegacy.encode(y.value),types:{[O.keyOfType]:"Link"}}));e.LinkContentLegacy=S,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent]),e.LinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link})}($w)),$w}var $a={},jw={},Dw={},uK;function sK(){return uK||(uK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.BlockLegacy=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedMetas=e.Span=e.Meta=void 0;const t=G,n=ht,r=In,i=Ye,o=(0,t.__importStar)(Q),a=jy,u=at,s=rt,c=sw(),l=bw(),f=Lw();e.Meta=o.exact(o.intersection([o.partial({data:o.unknown}),o.type({start:o.number,end:o.number,type:o.union([a.RichTextNodeTypeCodec,o.literal("label")])})])),e.Span=e.Meta;const d=I=>new o.Type("ValidatedMetas",M=>Array.isArray(M)&&M.every(e.Meta.is),(M,R)=>{if(Array.isArray(M)){const U=M.reduce((q,N)=>{const Z=e.Meta.decode(N);if((0,r.isRight)(Z)){const ee=Z.right;if(ee.data&&ee.type==="hyperlink"){const J=I.decode(ee.data);return(0,r.isLeft)(J)?q:[...q,{...ee,data:J.right}]}else if(ee.type!=="hyperlink")return[...q,ee]}return q},[]).sort((q,N)=>q.start-N.start);return o.success(U)}else return o.failure(M,R)},M=>M.reduce((R,U)=>{if(U.type==="hyperlink"&&U.data){const q=I.decode(U.data);return(0,r.isLeft)(q)?R:[...R,{...U,data:I.encode(q.right)}]}return[...R,e.Meta.encode(U)]},[]));e.ValidatedMetas=d;const p=I=>o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.image),data:o.intersection([l.ImageContentView,o.partial({linkTo:(0,s.nullable)(I)})])}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));e.ImageBlock=p(f.Link);const h=p(f.LinkLegacy);function v(I){return I.type===a.RichTextNodeType.image}e.checkImageBlock=v;const g=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.embed),data:o.unknown}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})])),b=new o.Type("EmbedBlockLegacy",I=>I.type==="embed",I=>(0,i.pipe)(g.decode(I),n.either.chain(M=>n.either.map(R=>[M,R])(c.EmbedContentLegacy.decode(M.data))),n.either.map(([M,R])=>e.EmbedBlock.encode({...M,data:{...R,__TYPE__:c.EmbedContentType,all:M.data}}))),I=>({...g.encode(I),data:c.EmbedContentLegacy.encode(I.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.embed),data:c.EmbedContent}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function S(I){return I.type===a.RichTextNodeType.embed}e.checkEmbedBlock=S;const O=I=>o.exact(o.intersection([o.type({type:(0,s.refineType)(a.RichTextNodeTypeCodec,`string which isn't ${a.RichTextNodeType.image} ${a.RichTextNodeType.embed}`,M=>M!==a.RichTextNodeType.image&&M!==a.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedMetas)(I)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=O(f.Link);const y=O(f.LinkLegacy),C=o.union([b,h,y]);e.BlockLegacy=new o.Type("BlockLegacy",I=>b.is(I)||h.is(I)||y.is(I),I=>C.decode(I),I=>(()=>e.ImageBlock.is(I)?h.encode(I):e.EmbedBlock.is(I)?b.encode(I):y.encode(I))()),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(Dw)),Dw}var cK;function lK(){return cK||(cK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=Mt(),a=sK();e.RichTextContentType="StructuredTextContent";const u=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.RichTextContentType;e.isRichTextContent=u;const s=i.array(a.BlockLegacy);e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),(0,t.__exportStar)(sK(),e);const c=l=>new i.Type("RichTextLegacy",e.isRichTextContent,f=>(0,r.pipe)(s.decode(f),n.either.map(d=>({value:d,__TYPE__:e.RichTextContentType}))),f=>({content:s.encode(f.value),types:{[l.keyOfType]:"StructuredText"}}));e.RichTextLegacy=c}(jw)),jw}var Uw={},fK;function dK(){return fK||(fK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=(0,G.__importStar)(Q),r=Mt();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(Uw)),Uw}var pK;function ySe(){if(pK)return $a;pK=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.NestableLegacy=$a.isNestableContent=$a.NestableContent=void 0;const e=G,t=In,n=(0,e.__importStar)(Q),r=Gq(),i=az(),o=sw(),a=Tz(),u=Hr,s=Oz(),c=bw(),l=Ez(),f=Lw(),d=lK(),p=dK();$a.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,s.GeoPointContent,c.ImageContent,l.IntegrationFieldContent,f.LinkContent,d.RichTextContent,p.SeparatorContent]);const h=g=>(0,a.isTextContent)(g)||(0,a.isColorContent)(g)||(0,a.isDateContent)(g)||(0,a.isTimestampContent)(g)||(0,a.isNumberContent)(g)||(0,a.isRangeContent)(g)||(0,a.isSelectContent)(g)||(0,s.isGeoPointContent)(g)||(0,d.isRichTextContent)(g)||(0,i.isBooleanContent)(g)||(0,o.isEmbedContent)(g)||(0,c.isImageContent)(g)||(0,l.isIntegrationFieldContent)(g)||(0,f.isLinkContent)(g)||(0,p.isSeparatorContent)(g)||(0,r.isEmptyContent)(g);$a.isNestableContent=h;const v=g=>({decode(b){if(!g.fieldType)return;const S=(0,r.EmptyLegacy)(g.fieldType).decode(b);if((0,t.isRight)(S))return S;const O=(()=>{switch(g.fieldType){case"Text":return(0,a.TextLegacy)(g);case"Color":return(0,a.ColorLegacy)(g);case"Date":return(0,a.DateLegacy)(g);case"Timestamp":return(0,a.TimestampLegacy)(g);case"Number":return(0,a.NumberLegacy)(g);case"Range":return(0,a.RangeLegacy)(g);case"Select":return(0,a.SelectLegacy)(g);case"GeoPoint":return(0,s.GeoPointLegacy)(g);case"StructuredText":return(0,d.RichTextLegacy)(g);case"Boolean":return(0,i.BooleanLegacy)(g);case"Embed":return(0,o.EmbedLegacy)(g);case"Image":return(0,c.ImageLegacy)(g);case"IntegrationFields":return(0,l.IntegrationFieldLegacy)(g);case"Link":return(0,f.LinkContentLegacy)(g);case"Separator":return(0,p.SeparatorLegacy)(g);default:return}})();if(O)return O.decode(b)},encode(b){switch(b.__TYPE__){case u.FieldContentType:return b.type==="Text"?(0,a.TextLegacy)(g).encode(b):b.type==="Color"?(0,a.ColorLegacy)(g).encode(b):b.type==="Range"?(0,a.RangeLegacy)(g).encode(b):b.type==="Date"?(0,a.DateLegacy)(g).encode(b):b.type==="Number"?(0,a.NumberLegacy)(g).encode(b):b.type==="Timestamp"?(0,a.TimestampLegacy)(g).encode(b):b.type==="Select"?(0,a.SelectLegacy)(g).encode(b):void 0;case s.GeoPointContentType:return(0,s.GeoPointLegacy)(g).encode(b);case d.RichTextContentType:return(0,d.RichTextLegacy)(g).encode(b);case o.EmbedContentType:return(0,o.EmbedLegacy)(g).encode(b);case i.BooleanContentType:return(0,i.BooleanLegacy)(g).encode(b);case c.ImageContentType:return(0,c.ImageLegacy)(g).encode(b);case l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(g).encode(b);case f.LinkContentType:return(0,f.LinkContentLegacy)(g).encode(b);case p.SeparatorContentType:return(0,p.SeparatorLegacy)(g).encode(b);default:return}}});return $a.NestableLegacy=v,$a}var hK;function rc(){return hK||(hK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(az(),e),(0,t.__exportStar)(sw(),e),(0,t.__exportStar)(Tz(),e),(0,t.__exportStar)(Oz(),e),(0,t.__exportStar)(bw(),e),(0,t.__exportStar)(Ez(),e),(0,t.__exportStar)(Lw(),e),(0,t.__exportStar)(ySe(),e),(0,t.__exportStar)(lK(),e),(0,t.__exportStar)(dK(),e)}(ow)),ow}var mK;function Hy(){return mK||(mK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GroupContent=e.isGroupContent=e.GroupContentType=e.GroupLegacy=e.GroupItemLegacy=e.GroupItemContent=e.GroupItemContentType=void 0;const t=G,n=ht,r=In,i=Ye,o=(0,t.__importStar)(Q),a=Ln,u=Mt(),s=rc();e.GroupItemContentType="GroupItemContent",e.GroupItemContent=o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,s.NestableContent]))});const c=o.record(o.string,o.unknown),l=p=>new o.Type("GroupItemLegacy",h=>(0,u.hasContentType)(h)&&h.__TYPE__===e.GroupItemContentType,h=>(0,i.pipe)(c.decode(h),n.either.map(g=>({value:Object.entries(g).reduce((S,[O,y])=>{const C=(0,a.getFieldCtx)(O,p),I=(0,s.NestableLegacy)(C).decode(y);return!I||(0,r.isLeft)(I)?S:[...S,[O,I.right]]},[]),__TYPE__:e.GroupItemContentType}))),h=>h.value.reduce((v,[g,b])=>{const S=(0,a.getFieldCtx)(g,p),O=(0,s.NestableLegacy)(S).encode(b);return O?{content:{...v.content,[g]:O.content},types:{...v.types,...O.types}}:v},{content:{},types:{}}));e.GroupItemLegacy=l;const f=p=>{const h=o.array(o.union([o.null,(0,e.GroupItemLegacy)(p)])),v=o.array((0,e.GroupItemLegacy)(p));return new o.Type("GroupLegacy",e.isGroupContent,g=>(0,i.pipe)(h.decode(g),n.either.map(b=>({value:b.map(S=>S===null?{__TYPE__:e.GroupItemContentType,value:[]}:S),__TYPE__:e.GroupContentType}))),g=>{const b=v.encode(g.value);return{content:b.map(S=>S.content),types:b.reduce((S,O)=>({...S,...O.types}),{[p.keyOfType]:"Group"})}})};e.GroupLegacy=f,e.GroupContentType="GroupContentType";const d=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.GroupContentType;e.isGroupContent=d,e.GroupContent=o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)})}(CC)),CC}var Bw={},qw={},zw={},ic={},vK;function gK(){if(vK)return ic;vK=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.RepeatableWidgets=ic.RepeatableWidgetsLegacy=void 0;const t=(0,G.__importStar)(Q),n=Hy(),r=rc(),i=u=>t.array((0,n.GroupItemLegacy)(u));ic.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return t.array(o),ic.RepeatableWidgets=t.array(a),ic}var yK;function Kw(){return yK||(yK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;const t=G,n=ht,r=In,i=Ye,o=(0,t.__importStar)(Q),a=Ln,u=Mt(),s=rc(),c=gK();e.CompositeSliceContentType="CompositeSliceContent";const l=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=l;const f=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),d=p=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,h=>(0,i.pipe)(f.decode(h),n.either.map(v=>{const g=(()=>{const S=(0,a.getFieldCtx)("repeat",p),O=(0,c.RepeatableWidgetsLegacy)(S).decode(v.repeat);if(!(!O||(0,r.isLeft)(O)))return O.right})()||[];return{nonRepeat:Object.entries(v["non-repeat"]||{}).reduce((S,[O,y])=>{const C=(0,a.getFieldCtx)(O,p,["non-repeat"]);if(!C)return S;const I=(0,s.NestableLegacy)(C).decode(y);return!I||(0,r.isLeft)(I)?S:{...S,[O]:I.right}},{}),repeat:g,__TYPE__:e.CompositeSliceContentType}})),h=>{const v=Object.entries(h.nonRepeat).reduce((b,[S,O])=>{const y=(0,a.getFieldCtx)(S,p,["non-repeat"]),C=(0,s.NestableLegacy)(y).encode(O);return C?{content:{...b.content,[S]:C.content},types:{...b.types,...C.types}}:b},{content:{},types:{}}),g=(()=>{const b=(0,a.getFieldCtx)("repeat",p);return(0,c.RepeatableWidgetsLegacy)(b).encode(h.repeat)})()||[];return{content:{"non-repeat":v.content,repeat:g.map(b=>b.content)},types:{[p.keyOfType]:"Slice",...v.types,...g.reduce((b,S)=>({...b,...S.types}),{})}}});e.CompositeSliceLegacy=d,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,s.NestableContent),repeat:c.RepeatableWidgets})}(zw)),zw}var Vw={},bK;function Hw(){return bK||(bK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=G,n=ht,r=In,i=Ye,o=(0,t.__importStar)(Q),a=oK,u=Ln,s=Mt(),c=rc(),l=gK();e.SharedSliceContentType="SharedSliceContent";const f=h=>(0,s.hasContentType)(h)&&h.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=f;const d=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),p=h=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,v=>(0,i.pipe)(d.decode(v),n.either.map(g=>{const b=(()=>{const O=(0,u.getFieldCtx)("items",h,["variations",g.variation]),y=(0,l.RepeatableWidgetsLegacy)(O).decode(g.items);if(!(!y||(0,r.isLeft)(y)))return y.right})()||[],S=Object.entries(g.primary).reduce((O,[y,C])=>{const I=(0,u.getFieldCtx)(y,h,["variations",g.variation,"primary"]),M=(0,c.NestableLegacy)(I).decode(C);return!M||(0,r.isLeft)(M)?O:{...O,[y]:M.right}},{});return{variation:g.variation,primary:S,items:b,__TYPE__:e.SharedSliceContentType}})),v=>{const g=Object.entries(v.primary).reduce((S,[O,y])=>{const C=(0,u.getFieldCtx)(O,h,["variations",v.variation,"primary"]),I=(0,c.NestableLegacy)(C).encode(y);return I?{content:{...S.content,[O]:I.content},types:{...S.types,...I.types}}:S},{content:{},types:{}}),b=(()=>{const S=(0,u.getFieldCtx)("items",h,["variations",v.variation]);return(0,l.RepeatableWidgetsLegacy)(S).encode(v.items)})()||[];return{content:{primary:g.content,items:b.map(S=>S.content),variation:v.variation},types:{[h.keyOfType]:"SharedSlice",...g.types,...b.reduce((S,O)=>({...S,...O.types}),{})}}});e.SharedSliceLegacy=p,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,c.NestableContent),items:l.RepeatableWidgets})}(Vw)),Vw}var Sa={},_K;function Gw(){if(_K)return Sa;_K=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.SimpleSliceLegacy=Sa.isSimpleSliceContent=Sa.SimpleSliceContent=void 0;const t=(0,G.__importStar)(Q),n=Hy(),r=rc();Sa.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=a=>(0,r.isNestableContent)(a)||(0,n.isGroupContent)(a);Sa.isSimpleSliceContent=i;const o=a=>({decode:(()=>a.fieldType==="Group"?(0,n.GroupLegacy)(a).decode.bind(null):(0,r.NestableLegacy)(a).decode.bind(null))(),encode:u=>{switch(u.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(a).encode(u);default:return(0,r.NestableLegacy)(a).encode(u)}}});return Sa.SimpleSliceLegacy=o,Sa}var $K;function SK(){return $K||($K=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=G,n=(0,t.__importStar)(Q),r=Kw(),i=Hw(),o=Gw(),a=u=>({decode:s=>(()=>{switch(u.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(u);case"SharedSlice":return(0,i.SharedSliceLegacy)(u);default:return(0,o.SimpleSliceLegacy)(u)}})().decode(s),encode:s=>{switch(s.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(u).encode(s);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(u).encode(s);default:return(0,o.SimpleSliceLegacy)(u).encode(s)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),(0,t.__exportStar)(Kw(),e),(0,t.__exportStar)(Hw(),e),(0,t.__exportStar)(Gw(),e)}(qw)),qw}var oc={},TK;function IK(){if(TK)return oc;TK=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.SlicesItemLegacy=oc.SliceItemContent=void 0;const e=G,t=ht,n=In,r=Ye,i=(0,e.__importStar)(Q),o=rt,a=Ln,u=SK(),s=Kw(),c=Hw(),l=Gw();oc.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:u.SliceContent});const f=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),d=p=>new i.Type("SlicesItemLegacy",h=>((0,c.isSharedSliceContent)(h.widget),(0,s.isCompositeSliceContent)(h.widget),(0,l.isSimpleSliceContent)(h.widget)),(h,v)=>(0,r.pipe)(f.decode(h),t.either.chain(g=>{var b;const S=g.key.indexOf("$"),O=g.key.substring(0,S>0?S:void 0),y=(0,a.getFieldCtx)(O,p),C=(0,u.SliceLegacy)(y).decode(g.value);return!C||(0,n.isLeft)(C)?i.failure(h,v):i.success({key:g.key,name:O,maybeLabel:(b=g.label)!==null&&b!==void 0?b:void 0,widget:C.right})})),h=>{const v=(0,a.getFieldCtx)(h.name,p),g=(0,u.SliceLegacy)(v).encode(h.widget);return{content:{key:h.key,label:h.maybeLabel,value:(g==null?void 0:g.content)||{}},types:(g==null?void 0:g.types)||{}}});return oc.SlicesItemLegacy=d,oc}var Yw={},OK;function bSe(){return OK||(OK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=Mt(),a=IK();e.SlicesContentType="SliceContentType";const u=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.SlicesContentType;e.isSlicesContent=u;const s=c=>{const l=i.array((0,a.SlicesItemLegacy)(c));return new i.Type("SlicesLegacy",e.isSlicesContent,f=>(0,r.pipe)(l.decode(f),n.either.map(d=>({__TYPE__:e.SlicesContentType,value:d}))),f=>{const d=l.encode(f.value);return{content:d.map(p=>p.content),types:d.reduce((p,h)=>({...p,...h.types}),{[c.keyOfType]:"Slices"})}})};e.SlicesLegacy=s,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(a.SliceItemContent)})}(Yw)),Yw}var CK;function wK(){return CK||(CK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(SK(),e),(0,t.__exportStar)(IK(),e),(0,t.__exportStar)(bSe(),e)}(Bw)),Bw}var Jw={},EK;function RK(){return EK||(EK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=G,n=ht,r=Ye,i=(0,t.__importStar)(Q),o=Mt();e.UIDContentType="UIDContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.UIDContentType;e.isUIDContent=a;const u=s=>new i.Type("UIDLegacy",e.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.UIDContent.encode({value:l,__TYPE__:e.UIDContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"UID"}}));e.UIDLegacy=u,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(Jw)),Jw}var Ta={},MK;function _Se(){if(MK)return Ta;MK=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.WidgetLegacy=Ta.isWidgetContent=Ta.WidgetContent=void 0;const t=(0,G.__importStar)(Q),n=Hy(),r=rc(),i=wK(),o=RK();Ta.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=s=>(0,n.isGroupContent)(s)||(0,r.isNestableContent)(s)||(0,o.isUIDContent)(s)||(0,i.isSlicesContent)(s);Ta.isWidgetContent=a;const u=s=>({decode(c){if(!s.fieldType)return;const l=(()=>{switch(s.fieldType){case"UID":return(0,o.UIDLegacy)(s);case"Group":return(0,n.GroupLegacy)(s);case"Choice":case"Slices":return(0,i.SlicesLegacy)(s);default:return(0,r.NestableLegacy)(s)}})();if(l)return l.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(s).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(s).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(s).encode(c);default:return(0,r.NestableLegacy)(s).encode(c)}}});return Ta.WidgetLegacy=u,Ta}var xK;function Zw(){return xK||(xK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Gq(),e),(0,t.__exportStar)(Hy(),e),(0,t.__exportStar)(rc(),e),(0,t.__exportStar)(wK(),e),(0,t.__exportStar)(RK(),e),(0,t.__exportStar)(_Se(),e)}(IC)),IC}Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.DocumentLegacy=Vc.Document=void 0;const $Se=G,kK=ht,Xw=In,AK=Ye,_f=(0,$Se.__importStar)(Q),Qw=Gs,eE=Zw(),tE=Ln;Vc.Document=_f.record(Qw.WidgetKey,eE.WidgetContent);const SSe=_f.record(Qw.WidgetKey,_f.unknown),nE=e=>new _f.Type("Document",t=>!!t&&typeof t=="object",t=>(0,AK.pipe)(SSe.decode(t),kK.either.map(n=>Object.entries(n).reduce((r,[i,o])=>{const a=(0,tE.defaultCtx)(i,e),u=(0,eE.WidgetLegacy)(a).decode(o);return!u||(0,Xw.isLeft)(u)?r:{...r,[i]:u.right}},{}))),t=>Object.entries(t).reduce((n,[r,i])=>{const o=(0,tE.defaultCtx)(r,e),a=(0,eE.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function FK(e){const t=Object.entries(e),{types:n,widgets:r}=t.reduce((a,[u,s])=>{if(u.endsWith("_TYPE")){const c=tE.FieldOrSliceType.decode(s);if((0,Xw.isRight)(c))return{...a,types:a.types.set(u.substring(0,u.length-5),c.right)}}return!u.endsWith("_POSITION")&&!u.endsWith("_TYPE")?{...a,widgets:{...a.widgets,[u]:s}}:a},{types:new Map,widgets:{}}),i=e.slugs_INTERNAL||[],o=e.uid;return{widgets:r,types:n,uid:o,slugs:i}}function TSe(e){const t=(0,AK.pipe)(_f.record(Qw.WidgetKey,_f.unknown).decode(e),kK.either.chain(n=>{const{types:r,widgets:i}=FK(n);return nE(r).decode(i)}));return(0,Xw.isLeft)(t)?void 0:t.right}function ISe(e){const t=nE().encode(e);return{...t.content,...t.types}}Vc.DocumentLegacy={_codec:nE,extractMetadata:FK,parse:TSe,encode:ISe},function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Vc,e),(0,t.__exportStar)(Zw(),e),(0,t.__exportStar)(Ln,e)}(Qe);function rE(e){const t=j.useRef(e);return j.useLayoutEffect(()=>{t.current=e}),j.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function NK(){const[e,t]=j.useState({});return j.useCallback(()=>t({}),[])}function bh(e,t,n){j.useEffect(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[n,t,e])}function Dn(e){var t;return((t=e.config)==null?void 0:t.label)??(e.type==="Boolean"||e.type==="Separator"?void 0:e.fieldset)??e.type}const PK="...";function po(e,t){var n,r,i;return e.type==="Boolean"?(t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)??PK:e.type==="GeoPoint"?"TODO":((i=e.config)==null?void 0:i.placeholder)??PK}const OSe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var a;const o=(e==null?void 0:e.value)??((a=t.config)==null?void 0:a.default_value)??!1;return _.jsxs(w.Field,{children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"toggleOff"})}),_.jsx(w.FieldLabel,{htmlFor:n,children:Dn(t)}),_.jsxs(w.FieldControl,{children:[_.jsx(w.Text,{children:po(t,o)}),_.jsx(w.Switch,{checked:o,id:n,onCheckedChange:u=>{i||r(CSe(u))}})]})]})};function CSe(e){return{__TYPE__:"BooleanContent",value:e}}const wSe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e},ESe=({id:e,field:t,content:n,onContentChange:r})=>_.jsxs(w.Field,{children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"colorLens"})}),_.jsx(w.FieldLabel,{id:e,children:Dn(t)}),_.jsx(w.FieldControl,{children:_.jsx(_.Fragment,{children:_.jsx(w.Box,{padding:{left:4},alignItems:"center",children:_.jsx(w.ColorInput,{onValueChange:i=>r(wSe(i)),value:n==null?void 0:n.value,"aria-labelledby":e,placeholder:po(t)})})})})]}),RSe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Date",value:e},MSe=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>_.jsxs(w.Field,{children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"dateRange"})}),_.jsx(w.FieldLabel,{id:e,children:Dn(n)}),_.jsx(w.FieldControl,{children:_.jsx(_.Fragment,{children:_.jsx(w.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:_.jsx(w.DateInput,{mode:"date","aria-labelledby":e,readOnly:t,value:r==null?void 0:r.value,onValueChange:o=>i(RSe(o))})})})})]});function bu(e){return e!=null}async function Gy(e,t){const{okType:n,signal:r,headers:i,body:o,timeout:a=1e4,...u}=t,s=new Headers(i);s.has("Content-Type")||s.set("Content-Type","application/json"),s.get("Content-Type")==="multipart/form-data"&&s.delete("Content-Type");const c=FSe();c&&s.set("Authorization",`Bearer ${c}`);const l=s.get("Content-Type")==="application/json"?JSON.stringify(o):o;let f=!1;try{const d=new AbortController,p=kSe([d.signal,r].filter(bu));setTimeout(()=>{f=!0,d.abort()},a);const h=await fetch(e,{...u,body:l,headers:s,signal:p}),{status:v}=h,g=h.clone(),b=await h.json().catch(S=>g.text());if(h.ok){const S=n.safeParse(b);if(!S.success)throw new _h({type:"validation",status:v,cause:S.error});return S.data}else throw new _h({type:"http",status:v,body:b})}catch(d){throw iE(d)?d:ASe(d)?new _h({type:f?"timeout":"abort"}):new _h({type:"unknown",cause:d})}}class _h extends Error{constructor(t){super(JSON.stringify(t,null,2)),this.detail=t,this.name="RequestError"}}function iE(e){return e instanceof _h}function xSe(e){return!iE(e)||e.detail.type!=="http"?!1:e.detail.status===401||e.detail.status===403}function kSe(e){const t=new AbortController;function n(){t.abort();for(const r of e)r.removeEventListener("abort",n)}for(const r of e){if(r.aborted){n();break}r.addEventListener("abort",n)}return t.signal}function ASe(e){return e instanceof DOMException&&e.name==="AbortError"}let FSe=()=>"";const WK=e=>e?"same-origin":"include";function oE(e,t){WSe(e,t),PSe(e,t);const n=ho.get(e,t);if(!n){const r=e(...t);throw ho.set(e,t,{state:"fetching",promise:r}),LK(e,t,r).catch(i=>console.error(i)),r}if(n.state==="fetching")throw n.promise;if(n.ok)return n.body;throw n.error}function NSe(e,t,n,r){const{notify:i=!0}=r??{};ho.set(e,t,{state:"fetched",ok:!0,body:n}),i&&Jy.forEach(o=>o(e,t))}function PSe(e,t){const n=NK(),r=Yy(t);j.useEffect(()=>{function i(o,a){if(e!==o)return;const u=Yy(a);r===u&&n()}return Jy.push(i),()=>{const o=Jy.indexOf(i);Jy.splice(o,1)}},[e,n,r])}function WSe(e,t){const n=NK();j.useEffect(()=>{const r=ho.getFetcherConfig(e).revalidationStrategy;if((r==null?void 0:r.type)==="never"||!(r!=null&&r.onFocus))return;function i(){if(document.visibilityState==="hidden")return;const o=ho.get(e,t);if(!o||o.state!=="fetched")return;const a=e(...t);o.ok?ho.set(e,t,{state:"revalidating",promise:a,ok:!0,body:o.body}):ho.set(e,t,{state:"revalidating",promise:a,ok:!1,error:o.error}),LK(e,t,a).then(n).catch(u=>console.error(u))}return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)})}function LK(e,t,n){return n.then(r=>ho.set(e,t,{state:"fetched",ok:!0,body:r})).catch(r=>ho.set(e,t,{state:"fetched",ok:!1,error:r}))}const ho=LSe(),aE=ho;function LSe(){const e=new Map,t=new Map,n={cacheCapacity:500,revalidationStrategy:{type:"swr",onFocus:!0}};function r(i){return e.get(i)??n}return{get(i,o){const a=Yy(o),u=t.get(i);if(!u||!u.has(a))return;const s=u.get(a);return u.delete(a),s!==void 0&&u.set(a,s),s},set(i,o,a){let u=t.get(i);u||(u=new Map,t.set(i,u));const s=r(i),c=Yy(o);u.size===s.cacheCapacity&&!u.has(c)&&u.delete(u.keys().next().value),u.set(c,a)},getFetcherConfig:r,registerFetcherConfig(i,o){e.set(i,o)},clear(...i){if(i.length>0)for(const o of i)t.delete(o);else t.clear()}}}function Yy(e){return e.join(`
29
+ `)}const Jy=[];function Zy(e){try{return new URL(e)}catch{return}}var Ve;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(const u of o)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ve||(Ve={}));var uE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(uE||(uE={}));const re=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_u=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},Y=Ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),jSe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ei extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],s++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ei.create=e=>new Ei(e);const $h=(e,t)=>{let n;switch(e.code){case Y.invalid_type:e.received===re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Y.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ve.jsonStringifyReplacer)}`;break;case Y.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ve.joinValues(e.keys,", ")}`;break;case Y.invalid_union:n="Invalid input";break;case Y.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ve.joinValues(e.options)}`;break;case Y.invalid_enum_value:n=`Invalid enum value. Expected ${Ve.joinValues(e.options)}, received '${e.received}'`;break;case Y.invalid_arguments:n="Invalid function arguments";break;case Y.invalid_return_type:n="Invalid function return type";break;case Y.invalid_date:n="Invalid date";break;case Y.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ve.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Y.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Y.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Y.custom:n="Invalid input";break;case Y.invalid_intersection_types:n="Intersection results could not be merged";break;case Y.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Y.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ve.assertNever(e)}return{message:n}};let jK=$h;function DSe(e){jK=e}function Xy(){return jK}const Qy=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let u="";const s=r.filter(c=>!!c).slice().reverse();for(const c of s)u=c(a,{data:t,defaultError:u}).message;return{...i,path:o,message:i.message||u}},USe=[];function oe(e,t){const n=Qy({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Xy(),$h].filter(r=>!!r)});e.common.issues.push(n)}class On{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Te;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return On.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return Te;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Te=Object.freeze({status:"aborted"}),DK=e=>({status:"dirty",value:e}),Un=e=>({status:"valid",value:e}),sE=e=>e.status==="aborted",cE=e=>e.status==="dirty",eb=e=>e.status==="valid",tb=e=>typeof Promise<"u"&&e instanceof Promise;var pe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(pe||(pe={}));class mo{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const UK=(e,t)=>{if(eb(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ei(e.common.issues);return this._error=n,this._error}}};function we(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,u)=>a.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:i}}class Re{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return _u(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_u(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new On,ctx:{common:t.parent.common,data:t.data,parsedType:_u(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(tb(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_u(t)},o=this._parseSync({data:t,path:i.path,parent:i});return UK(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_u(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(tb(i)?i:Promise.resolve(i));return UK(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),u=()=>o.addIssue({code:Y.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(s=>s?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new xi({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Oa.create(this,this._def)}nullable(){return cc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mi.create(this,this._def)}promise(){return If.create(this,this._def)}or(t){return Oh.create([this,t],this._def)}and(t){return Ch.create(this,t,this._def)}transform(t){return new xi({...we(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new xh({...we(this._def),innerType:this,defaultValue:n,typeName:ye.ZodDefault})}brand(){return new qK({typeName:ye.ZodBranded,type:this,...we(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ub({...we(this._def),innerType:this,catchValue:n,typeName:ye.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return kh.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const BSe=/^c[^\s-]{8,}$/i,qSe=/^[a-z][a-z0-9]*$/,zSe=/[0-9A-HJKMNP-TV-Z]{26}/,KSe=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,VSe=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,HSe=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,GSe=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,YSe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,JSe=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ZSe(e,t){return!!((t==="v4"||!t)&&GSe.test(e)||(t==="v6"||!t)&&YSe.test(e))}class Ri extends Re{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:Y.invalid_string,...pe.errToObj(r)}),this.nonempty=t=>this.min(1,pe.errToObj(t)),this.trim=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){const o=this._getOrReturnCtx(t);return oe(o,{code:Y.invalid_type,expected:re.string,received:o.parsedType}),Te}const r=new On;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Y.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Y.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,u=t.data.length<o.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?oe(i,{code:Y.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&oe(i,{code:Y.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")VSe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"email",code:Y.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")HSe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"emoji",code:Y.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")KSe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"uuid",code:Y.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")BSe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid",code:Y.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")qSe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid2",code:Y.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")zSe.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ulid",code:Y.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),oe(i,{validation:"url",code:Y.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"regex",code:Y.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Y.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Y.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Y.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?JSe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Y.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?ZSe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ip",code:Y.invalid_string,message:o.message}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Ri({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...pe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...pe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...pe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...pe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...pe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...pe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...pe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...pe.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...pe.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...pe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...pe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...pe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...pe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...pe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...pe.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ri.create=e=>{var t;return new Ri({checks:[],typeName:ye.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};function XSe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class $u extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==re.number){const o=this._getOrReturnCtx(t);return oe(o,{code:Y.invalid_type,expected:re.number,received:o.parsedType}),Te}let r;const i=new On;for(const o of this._def.checks)o.kind==="int"?Ve.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:Y.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Y.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Y.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?XSe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Y.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),oe(r,{code:Y.not_finite,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new $u({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new $u({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:pe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:pe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ve.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}$u.create=e=>new $u({checks:[],typeName:ye.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class Su extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==re.bigint){const o=this._getOrReturnCtx(t);return oe(o,{code:Y.invalid_type,expected:re.bigint,received:o.parsedType}),Te}let r;const i=new On;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Y.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Y.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),oe(r,{code:Y.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ve.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,pe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,pe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,pe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,pe.toString(n))}setLimit(t,n,r,i){return new Su({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:pe.toString(i)}]})}_addCheck(t){return new Su({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:pe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Su.create=e=>{var t;return new Su({checks:[],typeName:ye.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...we(e)})};class Sh extends Re{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==re.boolean){const r=this._getOrReturnCtx(t);return oe(r,{code:Y.invalid_type,expected:re.boolean,received:r.parsedType}),Te}return Un(t.data)}}Sh.create=e=>new Sh({typeName:ye.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...we(e)});class ac extends Re{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){const o=this._getOrReturnCtx(t);return oe(o,{code:Y.invalid_type,expected:re.date,received:o.parsedType}),Te}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return oe(o,{code:Y.invalid_date}),Te}const r=new On;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Y.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Y.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ve.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ac({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:pe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:pe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ac.create=e=>new ac({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ye.ZodDate,...we(e)});class nb extends Re{_parse(t){if(this._getType(t)!==re.symbol){const r=this._getOrReturnCtx(t);return oe(r,{code:Y.invalid_type,expected:re.symbol,received:r.parsedType}),Te}return Un(t.data)}}nb.create=e=>new nb({typeName:ye.ZodSymbol,...we(e)});class Th extends Re{_parse(t){if(this._getType(t)!==re.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:Y.invalid_type,expected:re.undefined,received:r.parsedType}),Te}return Un(t.data)}}Th.create=e=>new Th({typeName:ye.ZodUndefined,...we(e)});class Ih extends Re{_parse(t){if(this._getType(t)!==re.null){const r=this._getOrReturnCtx(t);return oe(r,{code:Y.invalid_type,expected:re.null,received:r.parsedType}),Te}return Un(t.data)}}Ih.create=e=>new Ih({typeName:ye.ZodNull,...we(e)});class $f extends Re{constructor(){super(...arguments),this._any=!0}_parse(t){return Un(t.data)}}$f.create=e=>new $f({typeName:ye.ZodAny,...we(e)});class uc extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Un(t.data)}}uc.create=e=>new uc({typeName:ye.ZodUnknown,...we(e)});class Ia extends Re{_parse(t){const n=this._getOrReturnCtx(t);return oe(n,{code:Y.invalid_type,expected:re.never,received:n.parsedType}),Te}}Ia.create=e=>new Ia({typeName:ye.ZodNever,...we(e)});class rb extends Re{_parse(t){if(this._getType(t)!==re.undefined){const r=this._getOrReturnCtx(t);return oe(r,{code:Y.invalid_type,expected:re.void,received:r.parsedType}),Te}return Un(t.data)}}rb.create=e=>new rb({typeName:ye.ZodVoid,...we(e)});class Mi extends Re{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==re.array)return oe(n,{code:Y.invalid_type,expected:re.array,received:n.parsedType}),Te;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,u=n.data.length<i.exactLength.value;(a||u)&&(oe(n,{code:a?Y.too_big:Y.too_small,minimum:u?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(oe(n,{code:Y.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(oe(n,{code:Y.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>i.type._parseAsync(new mo(n,a,n.path,u)))).then(a=>On.mergeArray(r,a));const o=[...n.data].map((a,u)=>i.type._parseSync(new mo(n,a,n.path,u)));return On.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Mi({...this._def,minLength:{value:t,message:pe.toString(n)}})}max(t,n){return new Mi({...this._def,maxLength:{value:t,message:pe.toString(n)}})}length(t,n){return new Mi({...this._def,exactLength:{value:t,message:pe.toString(n)}})}nonempty(t){return this.min(1,t)}}Mi.create=(e,t)=>new Mi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...we(t)});function Sf(e){if(e instanceof bt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Oa.create(Sf(r))}return new bt({...e._def,shape:()=>t})}else return e instanceof Mi?new Mi({...e._def,type:Sf(e.element)}):e instanceof Oa?Oa.create(Sf(e.unwrap())):e instanceof cc?cc.create(Sf(e.unwrap())):e instanceof vo?vo.create(e.items.map(t=>Sf(t))):e}class bt extends Re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ve.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==re.object){const c=this._getOrReturnCtx(t);return oe(c,{code:Y.invalid_type,expected:re.object,received:c.parsedType}),Te}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ia&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||u.push(c);const s=[];for(const c of a){const l=o[c],f=i.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new mo(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Ia){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of u)s.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")u.length>0&&(oe(i,{code:Y.unrecognized_keys,keys:u}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of u){const f=i.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new mo(i,f,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of s){const f=await l.key;c.push({key:f,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>On.mergeObjectSync(r,c)):On.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return pe.errToObj,new bt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,u;const s=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=pe.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new bt({...this._def,unknownKeys:"strip"})}passthrough(){return new bt({...this._def,unknownKeys:"passthrough"})}extend(t){return new bt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new bt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ye.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new bt({...this._def,catchall:t})}pick(t){const n={};return Ve.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new bt({...this._def,shape:()=>n})}omit(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new bt({...this._def,shape:()=>n})}deepPartial(){return Sf(this)}partial(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new bt({...this._def,shape:()=>n})}required(t){const n={};return Ve.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Oa;)o=o._def.innerType;n[r]=o}}),new bt({...this._def,shape:()=>n})}keyof(){return BK(Ve.objectKeys(this.shape))}}bt.create=(e,t)=>new bt({shape:()=>e,unknownKeys:"strip",catchall:Ia.create(),typeName:ye.ZodObject,...we(t)}),bt.strictCreate=(e,t)=>new bt({shape:()=>e,unknownKeys:"strict",catchall:Ia.create(),typeName:ye.ZodObject,...we(t)}),bt.lazycreate=(e,t)=>new bt({shape:e,unknownKeys:"strip",catchall:Ia.create(),typeName:ye.ZodObject,...we(t)});class Oh extends Re{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new Ei(u.ctx.common.issues));return oe(n,{code:Y.invalid_union,unionErrors:a}),Te}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const s of r){const c={...n,common:{...n.common,issues:[]},parent:null},l=s._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(s=>new Ei(s));return oe(n,{code:Y.invalid_union,unionErrors:u}),Te}}get options(){return this._def.options}}Oh.create=(e,t)=>new Oh({options:e,typeName:ye.ZodUnion,...we(t)});const ib=e=>e instanceof Eh?ib(e.schema):e instanceof xi?ib(e.innerType()):e instanceof Rh?[e.value]:e instanceof Tu?e.options:e instanceof Mh?Object.keys(e.enum):e instanceof xh?ib(e._def.innerType):e instanceof Th?[void 0]:e instanceof Ih?[null]:null;class ob extends Re{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.object)return oe(n,{code:Y.invalid_type,expected:re.object,received:n.parsedType}),Te;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(oe(n,{code:Y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Te)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=ib(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of a){if(i.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new ob({typeName:ye.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...we(r)})}}function lE(e,t){const n=_u(e),r=_u(t);if(e===t)return{valid:!0,data:e};if(n===re.object&&r===re.object){const i=Ve.objectKeys(t),o=Ve.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=lE(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===re.array&&r===re.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],u=t[o],s=lE(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===re.date&&r===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ch extends Re{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(sE(o)||sE(a))return Te;const u=lE(o.value,a.value);return u.valid?((cE(o)||cE(a))&&n.dirty(),{status:n.value,value:u.data}):(oe(r,{code:Y.invalid_intersection_types}),Te)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ch.create=(e,t,n)=>new Ch({left:e,right:t,typeName:ye.ZodIntersection,...we(n)});class vo extends Re{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.array)return oe(r,{code:Y.invalid_type,expected:re.array,received:r.parsedType}),Te;if(r.data.length<this._def.items.length)return oe(r,{code:Y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Te;!this._def.rest&&r.data.length>this._def.items.length&&(oe(r,{code:Y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const s=this._def.items[u]||this._def.rest;return s?s._parse(new mo(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>On.mergeArray(n,a)):On.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new vo({...this._def,rest:t})}}vo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vo({items:e,typeName:ye.ZodTuple,rest:null,...we(t)})};class wh extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.object)return oe(r,{code:Y.invalid_type,expected:re.object,received:r.parsedType}),Te;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new mo(r,u,r.path,u)),value:a._parse(new mo(r,r.data[u],r.path,u))});return r.common.async?On.mergeObjectAsync(n,i):On.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Re?new wh({keyType:t,valueType:n,typeName:ye.ZodRecord,...we(r)}):new wh({keyType:Ri.create(),valueType:t,typeName:ye.ZodRecord,...we(n)})}}class ab extends Re{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.map)return oe(r,{code:Y.invalid_type,expected:re.map,received:r.parsedType}),Te;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new mo(r,u,r.path,[c,"key"])),value:o._parse(new mo(r,s,r.path,[c,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const s of a){const c=await s.key,l=await s.value;if(c.status==="aborted"||l.status==="aborted")return Te;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const s of a){const c=s.key,l=s.value;if(c.status==="aborted"||l.status==="aborted")return Te;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}ab.create=(e,t,n)=>new ab({valueType:t,keyType:e,typeName:ye.ZodMap,...we(n)});class sc extends Re{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.set)return oe(r,{code:Y.invalid_type,expected:re.set,received:r.parsedType}),Te;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(oe(r,{code:Y.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(oe(r,{code:Y.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(s){const c=new Set;for(const l of s){if(l.status==="aborted")return Te;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const u=[...r.data.values()].map((s,c)=>o._parse(new mo(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new sc({...this._def,minSize:{value:t,message:pe.toString(n)}})}max(t,n){return new sc({...this._def,maxSize:{value:t,message:pe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}sc.create=(e,t)=>new sc({valueType:e,minSize:null,maxSize:null,typeName:ye.ZodSet,...we(t)});class Tf extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.function)return oe(n,{code:Y.invalid_type,expected:re.function,received:n.parsedType}),Te;function r(u,s){return Qy({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Xy(),$h].filter(c=>!!c),issueData:{code:Y.invalid_arguments,argumentsError:s}})}function i(u,s){return Qy({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Xy(),$h].filter(c=>!!c),issueData:{code:Y.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof If?Un(async(...u)=>{const s=new Ei([]),c=await this._def.args.parseAsync(u,o).catch(d=>{throw s.addIssue(r(u,d)),s}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(d=>{throw s.addIssue(i(l,d)),s})}):Un((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new Ei([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new Ei([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Tf({...this._def,args:vo.create(t).rest(uc.create())})}returns(t){return new Tf({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Tf({args:t||vo.create([]).rest(uc.create()),returns:n||uc.create(),typeName:ye.ZodFunction,...we(r)})}}class Eh extends Re{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Eh.create=(e,t)=>new Eh({getter:e,typeName:ye.ZodLazy,...we(t)});class Rh extends Re{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return oe(n,{received:n.data,code:Y.invalid_literal,expected:this._def.value}),Te}return{status:"valid",value:t.data}}get value(){return this._def.value}}Rh.create=(e,t)=>new Rh({value:e,typeName:ye.ZodLiteral,...we(t)});function BK(e,t){return new Tu({values:e,typeName:ye.ZodEnum,...we(t)})}class Tu extends Re{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{expected:Ve.joinValues(r),received:n.parsedType,code:Y.invalid_type}),Te}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return oe(n,{received:n.data,code:Y.invalid_enum_value,options:r}),Te}return Un(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Tu.create(t)}exclude(t){return Tu.create(this.options.filter(n=>!t.includes(n)))}}Tu.create=BK;class Mh extends Re{_parse(t){const n=Ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==re.string&&r.parsedType!==re.number){const i=Ve.objectValues(n);return oe(r,{expected:Ve.joinValues(i),received:r.parsedType,code:Y.invalid_type}),Te}if(n.indexOf(t.data)===-1){const i=Ve.objectValues(n);return oe(r,{received:r.data,code:Y.invalid_enum_value,options:i}),Te}return Un(t.data)}get enum(){return this._def.values}}Mh.create=(e,t)=>new Mh({values:e,typeName:ye.ZodNativeEnum,...we(t)});class If extends Re{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.promise&&n.common.async===!1)return oe(n,{code:Y.invalid_type,expected:re.promise,received:n.parsedType}),Te;const r=n.parsedType===re.promise?n.data:Promise.resolve(n.data);return Un(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}If.create=(e,t)=>new If({type:e,typeName:ye.ZodPromise,...we(t)});class xi extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{oe(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const a=u=>{const s=i.refinement(u,o);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Te:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Te:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!eb(a))return a;const u=i.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>eb(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Ve.assertNever(i)}}xi.create=(e,t,n)=>new xi({schema:e,typeName:ye.ZodEffects,effect:t,...we(n)}),xi.createWithPreprocess=(e,t,n)=>new xi({schema:t,effect:{type:"preprocess",transform:e},typeName:ye.ZodEffects,...we(n)});class Oa extends Re{_parse(t){return this._getType(t)===re.undefined?Un(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Oa.create=(e,t)=>new Oa({innerType:e,typeName:ye.ZodOptional,...we(t)});class cc extends Re{_parse(t){return this._getType(t)===re.null?Un(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}cc.create=(e,t)=>new cc({innerType:e,typeName:ye.ZodNullable,...we(t)});class xh extends Re{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===re.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}xh.create=(e,t)=>new xh({innerType:e,typeName:ye.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...we(t)});class ub extends Re{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return tb(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ub.create=(e,t)=>new ub({innerType:e,typeName:ye.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...we(t)});class sb extends Re{_parse(t){if(this._getType(t)!==re.nan){const r=this._getOrReturnCtx(t);return oe(r,{code:Y.invalid_type,expected:re.nan,received:r.parsedType}),Te}return{status:"valid",value:t.data}}}sb.create=e=>new sb({typeName:ye.ZodNaN,...we(e)});const QSe=Symbol("zod_brand");class qK extends Re{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class kh extends Re{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Te:o.status==="dirty"?(n.dirty(),DK(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Te:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new kh({in:t,out:n,typeName:ye.ZodPipeline})}}const zK=(e,t={},n)=>e?$f.create().superRefine((r,i)=>{var o,a;if(!e(r)){const u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,s=(a=(o=u.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...c,fatal:s})}}):$f.create(),eTe={object:bt.lazycreate};var ye;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(ye||(ye={}));const tTe=(e,t={message:`Input not instance of ${e.name}`})=>zK(n=>n instanceof e,t),ki=Ri.create,Iu=$u.create,nTe=sb.create,rTe=Su.create,KK=Sh.create,iTe=ac.create,oTe=nb.create,aTe=Th.create,uTe=Ih.create,sTe=$f.create,cTe=uc.create,lTe=Ia.create,fTe=rb.create,fE=Mi.create,Of=bt.create,dTe=bt.strictCreate,pTe=Oh.create,hTe=ob.create,mTe=Ch.create,vTe=vo.create,gTe=wh.create,yTe=ab.create,bTe=sc.create,_Te=Tf.create,$Te=Eh.create,STe=Rh.create,TTe=Tu.create,ITe=Mh.create,OTe=If.create,VK=xi.create,CTe=Oa.create,wTe=cc.create,ETe=xi.createWithPreprocess,RTe=kh.create;var Bn=Object.freeze({__proto__:null,defaultErrorMap:$h,setErrorMap:DSe,getErrorMap:Xy,makeIssue:Qy,EMPTY_PATH:USe,addIssueToContext:oe,ParseStatus:On,INVALID:Te,DIRTY:DK,OK:Un,isAborted:sE,isDirty:cE,isValid:eb,isAsync:tb,get util(){return Ve},get objectUtil(){return uE},ZodParsedType:re,getParsedType:_u,ZodType:Re,ZodString:Ri,ZodNumber:$u,ZodBigInt:Su,ZodBoolean:Sh,ZodDate:ac,ZodSymbol:nb,ZodUndefined:Th,ZodNull:Ih,ZodAny:$f,ZodUnknown:uc,ZodNever:Ia,ZodVoid:rb,ZodArray:Mi,ZodObject:bt,ZodUnion:Oh,ZodDiscriminatedUnion:ob,ZodIntersection:Ch,ZodTuple:vo,ZodRecord:wh,ZodMap:ab,ZodSet:sc,ZodFunction:Tf,ZodLazy:Eh,ZodLiteral:Rh,ZodEnum:Tu,ZodNativeEnum:Mh,ZodPromise:If,ZodEffects:xi,ZodTransformer:xi,ZodOptional:Oa,ZodNullable:cc,ZodDefault:xh,ZodCatch:ub,ZodNaN:sb,BRAND:QSe,ZodBranded:qK,ZodPipeline:kh,custom:zK,Schema:Re,ZodSchema:Re,late:eTe,get ZodFirstPartyTypeKind(){return ye},coerce:{string:e=>Ri.create({...e,coerce:!0}),number:e=>$u.create({...e,coerce:!0}),boolean:e=>Sh.create({...e,coerce:!0}),bigint:e=>Su.create({...e,coerce:!0}),date:e=>ac.create({...e,coerce:!0})},any:sTe,array:fE,bigint:rTe,boolean:KK,date:iTe,discriminatedUnion:hTe,effect:VK,enum:TTe,function:_Te,instanceof:tTe,intersection:mTe,lazy:$Te,literal:STe,map:yTe,nan:nTe,nativeEnum:ITe,never:lTe,null:uTe,nullable:wTe,number:Iu,object:Of,oboolean:()=>KK().optional(),onumber:()=>Iu().optional(),optional:CTe,ostring:()=>ki().optional(),pipeline:RTe,preprocess:ETe,promise:OTe,record:gTe,set:bTe,strictObject:dTe,string:ki,symbol:oTe,transformer:VK,tuple:vTe,undefined:aTe,union:pTe,unknown:cTe,void:fTe,NEVER:Te,ZodIssueCode:Y,quotelessJson:jSe,ZodError:Ei});function MTe(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,[a,u]=j.useState((i==null?void 0:i.embed_url)??"");function s(d){u(d),Zy(d)||o(void 0)}const[c,l]=j.useState(a),f=j.useCallback(d=>j.startTransition(()=>l(d)),[]);return bh(a,300,f),_.jsxs(w.Field,{footer:_.jsx(xTe,{displayedUrl:a,debouncedUrl:c,content:i,onContentChange:o}),children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"cloud"})}),_.jsx(w.FieldLabel,{htmlFor:t,children:Dn(r)}),_.jsx(w.FieldControl,{children:_.jsx(w.TextInput,{id:t,readOnly:n,placeholder:po(r),value:a,onValueChange:s,variant:Zy(a)?"link":"normal",endAdornment:_.jsx(w.Button,{startIcon:_.jsx(w.Icon,{name:"close"}),variant:"secondary",size:"small",disabled:!a,onClick:()=>s("")})})})]})}function xTe(e){const{displayedUrl:t,debouncedUrl:n,content:r,onContentChange:i}=e;return Zy(t)?n===(r==null?void 0:r.embed_url)?_.jsx(dE,{content:r}):_.jsx(kTe,{url:n,onError:()=>i(void 0),children:_.jsx(j.Suspense,{fallback:r&&_.jsx(dE,{content:r}),children:_.jsx(ATe,{url:n,onContentChange:i})})}):null}class kTe extends j.Component{constructor(){super(...arguments);ad(this,"state",{hasError:!1})}static getDerivedStateFromError(n){return{hasError:HK(n)}}componentDidUpdate(n){this.state.hasError&&this.props.url!==n.url&&(aE.clear(GK),this.setState({hasError:!1}))}componentDidCatch(n){HK(n)&&this.props.onError()}render(){return this.state.hasError?_.jsx(w.FieldFooter,{children:_.jsx(w.EmptyEmbed,{title:"There is no embed data available."})}):this.props.children}}function HK(e){return iE(e)&&!xSe(e)}function dE(e){const{content:t}=e;return _.jsx(w.FieldFooter,{children:_.jsx(w.EmbedPreview,{...PTe(t)})})}function ATe(e){const{url:t,onContentChange:n}=e,r=FTe({url:t,onContentChange:n});return _.jsx(dE,{content:r})}function FTe(e){const{url:t,onContentChange:n}=e,{embeds:r}=Od(),i=oE(GK,[t,r.url]),o=rE(n);return j.useEffect(()=>o(i),[i,o]),i}function GK(e,t){const n=new URL(t);return n.search=new URLSearchParams({url:e}).toString(),Gy(n.toString(),{okType:NTe(e)})}function NTe(e){return Bn.object({type:Bn.string(),version:Bn.string().or(Bn.number()).nullish(),title:Bn.string().nullish(),author_name:Bn.string().nullish(),author_url:Bn.string().nullish(),provider_name:Bn.string().nullish(),provider_url:Bn.string().nullish(),cache_age:Bn.string().or(Bn.number()).nullish(),thumbnail_url:Bn.string().nullish(),thumbnail_width:Bn.number().nullish(),thumbnail_height:Bn.number().nullish(),html:Bn.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}})}function PTe(e){let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t="View this post"+(e.provider_name?` on ${e.provider_name}`:"");break;default:t="Open"+(e.provider_name?` on ${e.provider_name}`:"")}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}}function WTe(e){const{content:t,field:n,id:r}=e,[i,o]=j.useState(!1),[a,u]=j.useState(!1);return bh(i,300,()=>u(i)),_.jsxs(w.Field,{onMouseOverChange:o,children:[_.jsx(w.Tooltip,{title:"Coming soon",content:"This feature is currently in development and will be available soon. Stay tuned for updates!",side:"bottom",open:a,children:_.jsx(LTe,{})}),_.jsx(w.FieldIcon,{disabled:!0,children:_.jsx(w.Icon,{name:"notes"})}),_.jsx(w.FieldLabel,{htmlFor:r,children:Dn(n)}),_.jsx(w.FieldControl,{disabled:!0,children:_.jsx(w.TextArea,{id:r,onChange:()=>{},placeholder:po(n),readOnly:!0,value:t!=null&&t.position?`${t.position.lat}, ${t.position.lng}`:""})})]})}const LTe=j.forwardRef(function(t,n){return _.jsx("div",{ref:n,style:{width:50,position:"absolute",top:40,left:30}})}),Ah="__MAIN_THUMBNAIL__";function YK(e,t,n){const r=e.name===Ah?void 0:e.name;let i;return t?bu(n)?i=[n.width,n.height]:bu(e.width)||bu(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}x${i[1]??"auto"}px`:void 0]}function jTe(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:Ah}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function DTe(e,t){var a,u;const{__TYPE__:n,thumbnails:r,...i}=t,o=(u=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:u.map(({name:s})=>r==null?void 0:r[s]);return[i,...o??[]]}function UTe(e,t,n,r){const i=r.length===0?void 0:r;return e===Ah?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function JK(e,t){const{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function ZK(e,t,n,r,i){const o=new URL(e);if(i){const{x:a,y:u,width:s,height:c}=t;o.searchParams.set("rect",[a,u,s,c].join(",")),o.searchParams.set("w",n.toString()),o.searchParams.set("h",r.toString())}return o.toString()}function XK(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.set("w","800"),t.searchParams.set("h","800"),t.searchParams.set("auto","compress,format"),t.searchParams.set("fit","max"),t.toString()}function QK(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.delete("fm"),t.searchParams.set("w","300"),t.searchParams.set("auto","compress,format"),t.toString()}const eV=({contentView:e,constraints:t,croppedImage:n})=>{const[r,i]=JK(e.origin,t),o=ZK(e.origin.url,n,r,i,!0);return{...e,width:r,height:i,url:o,edit:{...e.edit,zoom:n.zoom,crop:{x:n.x,y:n.y}}}},BTe=({field:e,content:t,thumbnail:n,croppedImage:r})=>{var u,s,c,l;if(n===Ah){const f=eV({contentView:t,constraints:(u=e.config)==null?void 0:u.constraint,croppedImage:r});return f.url===t.url?t:{...t,...f}}const i=(c=(s=e.config)==null?void 0:s.thumbnails)==null?void 0:c.find(f=>f.name===n),o=(l=t.thumbnails)==null?void 0:l[n];if(!i||!o)return t;const a=eV({contentView:o,constraints:i,croppedImage:r});return a.url===o.url?t:{...t,thumbnails:{...t.thumbnails,[n]:a}}},qTe=({initialSize:e,constraints:t})=>{const n=t!=null&&t.width&&(t!=null&&t.height)?t.width/t.height:e.width/e.height,[r,i]=e.width<e.height?[e.width,Math.round(e.width/n)]:[Math.round(e.height*n),e.height],o=Math.max(r/e.width,i/e.height,1);return{width:Math.round(r/o),height:Math.round(i/o)}},zTe=({contentView:e,constraints:t})=>{const n=qTe({initialSize:e.origin,constraints:t}),r=e.edit.zoom??1,i=Math.round(n.width/r),o=Math.round(n.height/r);return{...e.edit.crop,width:i,height:o,zoom:r}},tV={x:0,y:0,width:0,height:0,zoom:1},KTe=({selectedImage:{thumbnail:e,contentView:t}})=>e.width&&e.height?e.width/e.height:t?t.origin.width/t.origin.height:1,VTe=({trigger:e,initialImages:t,initialOption:n,onClose:r})=>{var I;const[i,o]=_e.useState({}),[a,u]=_e.useState({}),[s,c]=_e.useState(!1),[l,f]=_e.useState(!1),[d,p]=_e.useState(n),h=t[d],v=M=>{if(!h)return;const R=h.thumbnail.name,U=i[R]??tV;o({...i,[R]:{...U,zoom:M}})},g=M=>{if(!h)return;const R=h.thumbnail.name,U=i[R]??tV;o({...i,[R]:{...U,...M}})},b=M=>{if(!h)return;const R=h.thumbnail.name,U=a[R];u({...a,[R]:{...U,crop:M}})},S=M=>{if(!h)return;const R=h.thumbnail.name,U=a[R]??{};u({...a,[R]:{...U,aspectRatio:M}})},O=i[(h==null?void 0:h.thumbnail.name)??""],y=s?O??((h==null?void 0:h.contentView)&&zTe({contentView:h.contentView,constraints:h.thumbnail})):void 0,C=a[(h==null?void 0:h.thumbnail.name)??""];return _.jsxs(w.Dialog,{trigger:e,onAnimationEnd:()=>f(!0),open:s,onOpenChange:M=>{M?(p(n),o({}),u({})):(f(!1),r({option:d,croppedImages:i})),c(M)},children:[_.jsx(w.DialogHeader,{icon:"photo",title:"Image editor"}),_.jsx(w.DialogOptions,{value:String(d),onValueChange:M=>p(Number(M)),children:t.map((M,R)=>_.jsx(w.DialogOptionsItem,{value:String(R),icon:"photo",title:M.labels[0]??"Main",subtitle:M.labels[1]??""},M.thumbnail.name))}),h&&_.jsx(w.DialogContent,{children:l&&_.jsx(w.CropperControls,{image:((I=h.contentView)==null?void 0:I.origin.url)??"",crop:(C==null?void 0:C.crop)??{x:0,y:0},onCropChange:b,zoom:(O==null?void 0:O.zoom)??1,onZoomChange:v,aspectRatio:KTe({selectedImage:h,cropper:C}),onAspectRatioChange:S,initialCroppedArea:y,onCropAreaChange:g},h.thumbnail.name)})]})},HTe=" https://prismic.io/docs/guides/manage-images#maximum-file-size",GTe=" https://prismic.io/docs/guides/manage-images#supported-media",nV=Of({id:ki(),kind:ki(),extension:ki(),filename:ki(),width:Iu().optional(),height:Iu().optional(),last_modified:Iu(),url:ki()}),YTe=Of({total:Iu(),cursor:ki().optional(),items:fE(nV)}),rV=30;function pE(e,t,n,r){const i=new URLSearchParams({assetType:"image",limit:`${rV}`,...n!==""&&{cursor:n}});return Gy(`${e}?${i.toString()}`,{headers:{repository:t},credentials:WK(r!=="false"),okType:YTe})}aE.registerFetcherConfig(pE,{cacheCapacity:100,revalidationStrategy:{type:"never"}});function JTe(e){const{url:t,repository:n,dev:r}=e,[i,o]=j.useState(),[a,u]=j.useState([]),[s,c]=j.useState(a),l=oE(pE,[t,n,i??"",String(r)]);s!==l.items&&(c(l.items),u(p=>[...p,...l.items]));function f(){l.total!==0&&o(l.cursor)}function d(p){const h=[...p,...a];u([]),NSe(pE,[t,n,i??"",String(r)],{total:h.length,items:h,cursor:void 0})}return{media:a,limit:rV,onHasReachedBottom:f,response:l,updateMedia:d}}function ZTe(e){const{onFilesSelected:t}=e,[n,r]=j.useTransition(),[i,o]=j.useState(!1);return bh(n,100,()=>o(n)),_.jsx(w.ErrorBoundary,{errorImageSrc:w.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",renderError:a=>_.jsx(w.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:a}),children:_.jsx(j.Suspense,{children:_.jsxs(w.FileDropZone,{onFilesSelected:t,overlay:_.jsx(eIe,{}),children:[_.jsx(XTe,{...e,startTransition:r}),_.jsx(w.Box,{position:"relative",width:"100%",justifyContent:"center",children:_.jsx(w.Toast,{anchor:_.jsx(w.Box,{position:"fixed",bottom:72}),loadingIndicator:!0,open:i,title:"Loading media ...",seconds:1})})]})})})}function XTe(e){const{assets:t,uploadingFiles:n,onFilesSelected:r,onSuccessFiles:i,onFailedFiles:o,onTryAgain:a,onMediaSelected:u,startTransition:s}=e,{media:c,limit:l,onHasReachedBottom:f,response:d,updateMedia:p}=JTe(t);return j.useEffect(()=>{const h=n.filter(g=>g.status==="success").map(g=>g.response),v=n.filter(g=>g.status==="failed");h.length>0&&(p(h),i()),v.length>0&&o(v)},[o,i,p,n]),c.length===0?_.jsx(QTe,{onFilesSelected:r}):_.jsxs(tIe,{onScrollToBottom:()=>{d.total===l&&s(f)},children:[_.jsx(w.Box,{flexDirection:"column",gap:6,children:n.map((h,v)=>_.jsx(w.UploadProgress,{file:h.file,failed:h.status==="failed",onTryAgain:()=>a(h)},`${h.file.name}${v}`))}),_.jsx(w.Masonry,{items:c,getItemInfo:nIe,children:h=>_.jsx(j.Suspense,{fallback:_.jsx(w.Skeleton,{width:"100%",height:"100%"}),children:_.jsx(w.MasonryMedia,{url:QK(h.url),onClick:()=>u({...h,width:h.width??2e3,height:h.height??2e3})})})})]})}function QTe(e){const{onFilesSelected:t}=e;return _.jsx(w.Box,{justifyContent:"center",flexDirection:"column",height:"100%",padding:24,children:_.jsx(w.Box,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey2",borderRadius:4,padding:{inline:80},children:_.jsxs(w.BlankSlate,{children:[_.jsx(w.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple12"}),_.jsx(w.BlankSlateTitle,{size:"big",children:"Drop files here or"}),_.jsx(w.BlankSlateDescription,{children:_.jsxs(w.Text,{color:"grey11",align:"center",variant:"normal",children:["Explore our documentation to find out the"," ",_.jsx(w.TextLink,{underline:!0,color:"grey11",href:HTe,children:"maximum size"})," ","and"," ",_.jsx(w.TextLink,{underline:!0,color:"grey11",href:GTe,children:"supported image formats"})," ","for uploads in the media library."]})}),_.jsx(w.BlankSlateActions,{children:_.jsx(w.FileUploadTrigger,{title:"Upload Media",onFilesSelected:t})})]})})})}function eIe(){return _.jsx(w.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:_.jsxs(w.BlankSlate,{children:[_.jsx(w.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple12"}),_.jsx(w.BlankSlateTitle,{size:"big",children:"Drop files here"}),_.jsx(w.BlankSlateDescription,{children:"Drop your files to upload them instantly to your media library"})]})})}function tIe(e){const{children:t,onScrollToBottom:n}=e;return _.jsx(w.ScrollArea,{style:{height:"100%",paddingInline:w.tokens.space[24],paddingBlock:w.tokens.space[16],gap:w.tokens.space[16]},onScrollToBottom:n,children:t})}function nIe(e){return{key:e.id,aspectRatio:(e.width??2e3)/(e.height??2e3)}}let cb;const rIe=new Uint8Array(16);function iIe(){if(!cb&&(cb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cb(rIe)}const hn=[];for(let e=0;e<256;++e)hn.push((e+256).toString(16).slice(1));function oIe(e,t=0){return(hn[e[t+0]]+hn[e[t+1]]+hn[e[t+2]]+hn[e[t+3]]+"-"+hn[e[t+4]]+hn[e[t+5]]+"-"+hn[e[t+6]]+hn[e[t+7]]+"-"+hn[e[t+8]]+hn[e[t+9]]+"-"+hn[e[t+10]]+hn[e[t+11]]+hn[e[t+12]]+hn[e[t+13]]+hn[e[t+14]]+hn[e[t+15]]).toLowerCase()}const iV={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function aIe(e,t,n){if(iV.randomUUID&&!t&&!e)return iV.randomUUID();e=e||{};const r=e.random||(e.rng||iIe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return oIe(r)}function uIe(e){const{file:t,url:n,repository:r,dev:i}=e,o=new FormData;return o.append(t.name,t),Gy(n,{headers:{repository:r,"Content-Type":"multipart/form-data"},method:"POST",body:o,credentials:WK(i),okType:nV})}function sIe(e){const{config:t}=e,[n,r]=j.useState([]);function i(c){c.forEach(l=>{var f,d;return uIe({file:l.file,url:((f=t.assets)==null?void 0:f.url)??"",repository:((d=t.assets)==null?void 0:d.repository)??"",dev:t.env==="dev"}).then(p=>{r(h=>h.map(v=>v.id===l.id?{...v,status:"success",response:p}:v))}).catch(()=>{r(p=>p.map(h=>h.id===l.id?{...h,status:"failed"}:h))})})}const{onFailedFiles:o,onTryAgain:a}=cIe({setUploadingFiles:r,tryPostMedia:i});function u(c){const l=c.map(f=>({id:aIe(),file:f,status:"loading"}));r(f=>[...f,...l]),i(l)}function s(){r(c=>c.filter(l=>l.status!=="success"))}return{onFilesSelected:u,uploadingFiles:n,onSuccessFiles:s,onFailedFiles:o,onTryAgain:a}}function cIe(e){const{setUploadingFiles:t,tryPostMedia:n}=e,r=j.useRef();function i(a){const u=()=>t(s=>s.filter(c=>!a.includes(c)));r.current=window.setTimeout(u,3e3)}function o(a){clearTimeout(r.current),t(u=>u.map(s=>s.id===a.id?{...a,status:"loading"}:s)),n([a])}return{onTryAgain:o,onFailedFiles:i}}const lIe=Of({id:ki(),width:Iu(),height:Iu(),urls:Of({full:ki(),small:ki().transform(QK)})}),fIe=Of({results:fE(lIe)}).transform(e=>e.results);function oV(e,t){const n=new URLSearchParams({page:"1",per_page:"30",query:t});return Gy(`${e}/search/photos?${n.toString()}`,{okType:fIe})}aE.registerFetcherConfig(oV,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function dIe(e,t){return oE(oV,[e,t])}const pIe=e=>{const{onMediaSelected:t}=e,[n,r]=j.useState(""),[i,o]=j.useState(n),[a,u]=j.useTransition(),s=j.useCallback(c=>u(()=>o(c)),[]);return bh(n,200,s),_.jsxs(_.Fragment,{children:[_.jsx(w.Box,{padding:{inline:24,top:16},flexDirection:"column",children:_.jsx(w.SearchInput,{value:n,placeholder:"Search on Unsplash.com",onValueChange:r})}),_.jsx(vIe,{children:_.jsx(w.ErrorBoundary,{errorImageSrc:w.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",renderError:c=>_.jsx(w.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:c}),children:_.jsx(j.Suspense,{fallback:_.jsx(w.MasonrySkeleton,{}),children:_.jsx(hIe,{term:i,isUpdating:a,onMediaSelected:t})})})})]})},hIe=e=>{const{term:t,isUpdating:n,onMediaSelected:r}=e,i=Od(),o=dIe(i.unsplash.url,t||"fruit"),a=mIe(n);return o.length?_.jsx(w.Masonry,{items:o,getItemInfo:gIe,style:a,children:u=>_.jsx(w.MasonryMedia,{url:u.urls.small,onClick:()=>r({id:u.id,url:u.urls.full,width:u.width,height:u.height})})}):_.jsxs(w.BlankSlate,{style:{marginTop:"auto",marginBottom:"auto",...a},children:[_.jsx(w.BlankSlateImage,{children:_.jsx("img",{src:w.dialogErrorImage,alt:"No results"})}),_.jsx(w.BlankSlateTitle,{size:"big",children:"Oh no ..."}),_.jsx(w.BlankSlateDescription,{children:"The search returned no result."})]})};function mIe(e){return{opacity:e?.4:1,transitionProperty:e?"opacity":"none",transitionDuration:w.tokens.transitionDuration[300],transitionTimingFunction:w.tokens.transitionTimingFunction.easeInOut}}const vIe=({children:e})=>_.jsx(w.ScrollArea,{style:{height:"100%",paddingInline:w.tokens.space[24],paddingTop:w.tokens.space[4]},children:e});function gIe(e){return{key:e.id,aspectRatio:e.width/e.height}}function aV(e){const{trigger:t,onMediaSelected:n}=e,r=Od(),{onFilesSelected:i,uploadingFiles:o,onSuccessFiles:a,onFailedFiles:u,onTryAgain:s}=sIe({config:r}),[c,l]=j.useState(!1),[f,d]=j.useState(r.assets?"media":"unsplash"),p=h=>{if(h!=="media"&&h!=="unsplash")throw new Error(`Invalid option ${h}.`);d(h)};return _.jsxs(w.Dialog,{trigger:t,open:c,onOpenChange:l,children:[_.jsx(w.DialogHeader,{icon:"folder",title:"Add an image"}),_.jsxs(w.DialogOptions,{value:f,onValueChange:p,children:[r.assets&&_.jsx(w.DialogOptionsItem,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),_.jsx(w.DialogOptionsItem,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"}),_.jsx(w.Box,{flexDirection:"column",justifyContent:"end",flexGrow:1,animation:"fadeIn",children:_.jsx(w.FileUploadTrigger,{startIcon:_.jsx(w.Icon,{name:"cloudUpload"}),title:"Upload media",onFilesSelected:i})})]}),_.jsx(w.DialogContent,{children:_.jsx(yIe,{config:r,option:f,uploadingFiles:o,onSuccessFiles:a,onFailedFiles:u,onFilesSelected:i,onTryAgain:s,onMediaSelected:h=>{l(!1),n==null||n(h)}})})]})}function yIe(e){const{config:t,option:n,onMediaSelected:r,...i}=e;switch(n){case"media":return t.assets?_.jsx(ZTe,{assets:{...t.assets,dev:t.env==="dev"},onMediaSelected:r,...i}):null;case"unsplash":return _.jsx(pIe,{onMediaSelected:r})}}function bIe(e,t){const n={};for(const r in e)n[r]=t(e[r],r);return n}function _Ie(e,t,n,r){var u,s,c,l,f,d;if(!n){const p=(u=t.config)==null?void 0:u.thumbnails,h=p&&Object.fromEntries(p.map(v=>[v.name,lb(r,v)]));return{__TYPE__:"ImageContent",...lb(r,(s=t.config)==null?void 0:s.constraint),thumbnails:h}}if(e===Ah){const p=lb(r,(c=t.config)==null?void 0:c.constraint);return p.url===n.url?n:{...n,...p}}const i=(f=(l=t.config)==null?void 0:l.thumbnails)==null?void 0:f.find(p=>p.name===e);if(!i)return n;const o=(d=n.thumbnails)==null?void 0:d[e],a=lb(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:bIe(n.thumbnails??{},(p,h)=>h===e?a:p)}}function lb(e,t){const{width:n,height:r,rect:i}=$Ie(e,t),o=Boolean((t==null?void 0:t.width)||(t==null?void 0:t.height));return{url:ZK(e.url,i,n,r,o),origin:{id:e.id,url:e.url,width:e.width,height:e.height},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function $Ie(e,t){const[n,r]=JK(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2),u=Math.round(n/i),s=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:u,height:s}}}const SIe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var C,I;const[o,a]=j.useState(0),[u,s]=j.useTransition(),c=TIe(t),l=c[o],f=e?DTe(t,e):void 0,d=f==null?void 0:f[o],p=Dn(t),h=l?YK(l,e,d).filter(bu):[],v=e&&!i?"visible":"hidden";function g(M){if(!l)return;const R=_Ie(l.name,t,e,M);R!==e&&s(()=>r(R))}function b(M){s(()=>a(M))}const S=c.map((M,R)=>{const U=f==null?void 0:f[R];return{thumbnail:M,contentView:U,labels:YK(M,e,U)}}),O=({option:M,croppedImages:R})=>{if(a(M),!e)return;const U=Object.entries(R).reduce((q,[N,Z])=>BTe({field:t,content:q,thumbnail:N,croppedImage:Z}),e);U!==e&&s(()=>r(U))},y=((I=(C=d==null?void 0:d.url)==null?void 0:C.split("?")[0])==null?void 0:I.slice(-4))===".svg";return _.jsxs(w.Card,{color:"grey2",variant:"dashed",children:[_.jsxs(w.CardHeader,{children:[_.jsxs(w.CardHeaderTitle,{children:[p,h.length!==0&&_.jsx(w.Text,{color:"grey11",component:"span",children:` • ${h.join(" • ")}`})]}),_.jsxs(w.CardHeaderActions,{style:{visibility:v},children:[_.jsx(VTe,{trigger:_.jsx(w.Button,{startIcon:_.jsx(w.Icon,{name:"crop"}),disabled:y,children:"Crop & Resize"}),initialImages:S,initialOption:o,onClose:O}),_.jsx(aV,{trigger:_.jsx(w.Button,{startIcon:_.jsx(w.Icon,{name:"imageSearch"}),children:"Replace"}),onMediaSelected:g}),_.jsx(w.Button,{onClick:()=>{a(0),r(void 0)},startIcon:_.jsx(w.Icon,{name:"delete"}),children:"Clear"})]})]}),_.jsx(j.Suspense,{fallback:_.jsx("div",{style:{height:466}}),children:l&&e&&f?_.jsx(IIe,{allContentViews:f,content:e,contentView:d,id:n,onContentChange:r,onPageChange:b,page:o,readOnly:i,thumbnailName:l.name,isUpdating:u}):_.jsx(OIe,{onMediaSelected:g,readOnly:i,isUpdating:u})})]})};function TIe(e){return j.useMemo(()=>jTe(e),[e])}const IIe=e=>{const{allContentViews:t,content:n,contentView:r,id:i,onContentChange:o,onPageChange:a,page:u,readOnly:s,thumbnailName:c,isUpdating:l}=e;return _.jsxs(w.CardContent,{children:[_.jsx(w.Carousel,{getItemSource:CIe,items:t,onPageChange:a,page:u,style:{height:400},children:f=>(f==null?void 0:f.url)&&_.jsx(w.CarouselItem,{src:XK(f.url),alt:f.alt??void 0,isUpdating:l},`${c}_${f.url}`)}),_.jsxs(w.Field,{labelPosition:"side",children:[_.jsx(w.FieldLabel,{htmlFor:i,children:"Alt text"}),_.jsx(w.FieldControl,{children:_.jsx(w.TextInput,{id:i,onValueChange:f=>{r&&o(UTe(c,n,r,f))},placeholder:"Short description for the visually impaired",readOnly:s||!r,value:(r==null?void 0:r.alt)??""})})]})]})},OIe=({onMediaSelected:e,readOnly:t,isUpdating:n})=>_.jsx(w.CardContent,{children:_.jsx(w.Card,{color:"grey3",variant:"outlined",children:_.jsx(w.CardContent,{style:{paddingBlock:parseFloat(w.tokens.space[48])},children:_.jsxs(w.BlankSlate,{children:[_.jsx(w.BlankSlateIcon,{name:"cloudUpload"}),_.jsx(w.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!t&&_.jsx(w.BlankSlateActions,{children:_.jsx(aV,{trigger:_.jsx(w.Button,{disabled:n,children:"Select image"}),onMediaSelected:e})})]})})})});function CIe(e){return e!=null&&e.url?XK(e.url):void 0}function wIe(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e;return _.jsxs(w.Field,{children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"notes"})}),_.jsx(w.FieldLabel,{htmlFor:r,children:Dn(n)}),_.jsx(w.FieldControl,{children:_.jsx(w.TextArea,{id:r,placeholder:po(n),readOnly:o,value:(t==null?void 0:t.value)??"",onChange:a=>{i(EIe(a))}})})]})}function EIe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function RIe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function MIe(e){const{hasLink:t,onUnlink:n,selectEnabled:r,selectedType:i,onValueChange:o}=e;return _.jsxs(_.Fragment,{children:[_.jsxs(w.Select,{value:i,variant:"secondary",size:"small",icon:xIe(i),disabled:!r,onValueChange:o,placeholder:"Choose link type",children:[_.jsx(w.SelectItem,{value:"web",icon:"public",children:"Link to web page"}),_.jsx(w.SelectItem,{value:"document",icon:"description",children:"Link to Prismic page"})]}),_.jsx(w.Button,{startIcon:_.jsx(w.Icon,{name:"close"}),variant:"secondary",size:"small",disabled:!t,onClick:n})]})}function xIe(e){if(e)switch(e){case"document":return"description";case"web":return"public";case"media":return"image"}}function kIe(e){var S,O,y;const{field:t,content:n,onContentChange:r}=e,{env:i}=Od(),o=i==="prod";function a(){var C,I;return(C=t.config)!=null&&C.select?uV[(I=t.config)==null?void 0:I.select]:o?"ExternalLink":n==null?void 0:n.value.__TYPE__}const[u,s]=j.useState(()=>a()),c=u?AIe[u]:void 0,l=o&&((n==null?void 0:n.value.__TYPE__)==="DocumentLink"||((S=t.config)==null?void 0:S.select)==="document"),f=(n==null?void 0:n.value.__TYPE__)&&["FileLink","ImageLink"].includes(n==null?void 0:n.value.__TYPE__),d=((O=t.config)==null?void 0:O.select)&&t.config.select==="media";function p(){return n?n.value.__TYPE__==="DocumentLink"?n.value.id:n.value.__TYPE__==="ExternalLink"?n.value.url:n.value.name:""}function h(C){if(C)switch(u){case"ExternalLink":return{__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:C}};case"DocumentLink":return{__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:C}};default:return}}function v(C){r(h(C))}function g(C){s(uV[C]),v("")}const b=!o&&!((y=t.config)!=null&&y.select);return{contentType:u,selectType:c,isUnsupportedField:d||f||l,fieldValue:p(),onValueChange:v,onTypeChange:g,placeholder:po(t),isTypeSelectEnabled:b}}const AIe={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},uV={document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function FIe(e){const{content:t,field:n,id:r,onContentChange:i,readOnly:o}=e,[a,u]=j.useState(!1),[s,c]=j.useState(!1),{contentType:l,selectType:f,isUnsupportedField:d,fieldValue:p,onValueChange:h,onTypeChange:v,placeholder:g,isTypeSelectEnabled:b}=kIe({content:t,field:n,onContentChange:i});if(d)return _.jsx(PIe,{id:r,field:n,content:t});const S=Zy(p),O=(a||s)&&Boolean(S),y=o||l==="DocumentLink"||!l;return _.jsx(w.LinkDescriptionPopover,{url:S,title:S?NIe(S):"",open:O,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,onMouseOverChange:c,anchor:_.jsxs(w.Field,{onMouseOverChange:u,children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"link"})}),_.jsx(w.FieldLabel,{htmlFor:r,children:Dn(n)}),_.jsx(w.FieldControl,{children:_.jsx(w.TextInput,{id:r,onValueChange:h,placeholder:g,readOnly:y,value:p??"",variant:S?"link":"normal",onFocus:()=>u(!0),onBlur:()=>u(!1),endAdornment:_.jsx(MIe,{hasLink:Boolean(p),onUnlink:()=>h(""),selectEnabled:b,selectedType:f,onValueChange:v})})})]})})}function NIe(e){return e.host.split(".").slice(0,-1).filter(t=>t!=="www").map(RIe).join("")}function PIe({id:e,field:t,content:n}){const[r,i]=j.useState(!1),[o,a]=j.useState(!1);bh(r,300,()=>a(r));const u=(n==null?void 0:n.value.__TYPE__)==="DocumentLink"?n==null?void 0:n.value.id:n==null?void 0:n.value.url;return _.jsxs(w.Field,{onMouseOverChange:i,children:[_.jsx(w.Tooltip,{title:"Coming soon",content:"This feature is currently in development and will be available soon. Stay tuned for updates!",side:"bottom",open:o,children:_.jsx(WIe,{})}),_.jsx(w.FieldIcon,{disabled:!0,children:_.jsx(w.Icon,{name:"link"})}),_.jsx(w.FieldLabel,{htmlFor:e,children:Dn(t)}),_.jsx(w.FieldControl,{disabled:!0,children:_.jsx(w.TextArea,{id:e,onChange:()=>{},placeholder:po(t),readOnly:!0,value:u})})]})}const WIe=j.forwardRef(function(t,n){return _.jsx("div",{ref:n,style:{width:50,position:"absolute",top:40,left:30}})}),LIe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var u,s;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return _.jsxs(w.Field,{children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"pin"})}),_.jsx(w.FieldLabel,{htmlFor:n,children:Dn(t)}),_.jsx(w.FieldControl,{children:_.jsx(w.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,placeholder:po(t),readOnly:i,onValueChange:c=>r(jIe(c))})})]})};function jIe(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function mn(e){this.content=e}mn.prototype={constructor:mn,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),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new mn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new mn(n)},addToStart:function(e,t){return new mn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new mn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new mn(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=mn.from(e),e.size?new mn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=mn.from(e),e.size?new mn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=mn.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}},mn.from=function(e){if(e instanceof mn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new mn(t)};function sV(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),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=sV(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function cV(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),u=t.child(--o),s=a.nodeSize;if(a==u){n-=s,r-=s;continue}if(!a.sameMarkup(u))return{a:n,b:r};if(a.isText&&a.text!=u.text){let c=0,l=Math.min(a.text.length,u.text.length);for(;c<l&&a.text[a.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||u.content.size){let c=cV(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class K{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&r(s,i+u,o||null,a)!==!1&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+=typeof i=="function"?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new K(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 o=0,a=0;a<n;o++){let u=this.content[o],s=a+u.nodeSize;s>t&&((a<t||s>n)&&(u.isText?u=u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u=u.cut(Math.max(0,t-a-1),Math.min(u.content.size,n-a-1))),r.push(u),i+=u.nodeSize),a=s}return new K(r,i)}cutByIndex(t,n){return t==n?K.empty:t==0&&n==this.content.length?this:new K(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new K(i,o)}addToStart(t){return new K([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new K(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))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(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return sV(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return cV(this,t,n,r)}findIndex(t,n=-1){if(t==0)return fb(0,t);if(t==this.size)return fb(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?fb(r+1,a):fb(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return K.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new K(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return K.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new K(n||t,r)}static from(t){if(!t)return K.empty;if(t instanceof K)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new K([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}K.empty=new K([],0);const hE={index:0,offset:0};function fb(e,t){return hE.index=e,hE.offset=t,hE}function db(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 r=0;r<e.length;r++)if(!db(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!db(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let tt=class dM{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&db(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return dM.none;if(t instanceof dM)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};tt.none=[];class pb extends Error{}class ae{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=fV(this.content,t+this.openStart,n);return r&&new ae(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(lV(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ae.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(K.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new ae(t,r,i)}}ae.empty=new ae(K.empty,0,0);function lV(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:u}=e.findIndex(n);if(i==t||o.isText){if(u!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(lV(o.content,t-i-1,n-i-1)))}function fV(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=fV(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function DIe(e,t,n){if(n.openStart>e.depth)throw new pb("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new pb("Inconsistent open depths");return dV(e,t,n,0)}function dV(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=dV(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,u=a.content;return fc(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=UIe(n,e);return fc(o,hV(e,a,u,t,r))}else return fc(o,hb(e,t,r))}function pV(e,t){if(!t.type.compatibleContent(e.type))throw new pb("Cannot join "+t.type.name+" onto "+e.type.name)}function mE(e,t,n){let r=e.node(n);return pV(r,t.node(n)),r}function lc(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 Fh(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(lc(e.nodeAfter,r),o++));for(let u=o;u<a;u++)lc(i.child(u),r);t&&t.depth==n&&t.textOffset&&lc(t.nodeBefore,r)}function fc(e,t){return e.type.checkContent(t),e.copy(t)}function hV(e,t,n,r,i){let o=e.depth>i&&mE(e,t,i+1),a=r.depth>i&&mE(n,r,i+1),u=[];return Fh(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(pV(o,a),lc(fc(o,hV(e,t,n,r,i+1)),u)):(o&&lc(fc(o,hb(e,t,i+1)),u),Fh(t,n,i,u),a&&lc(fc(a,hb(n,r,i+1)),u)),Fh(r,null,i,u),new K(u)}function hb(e,t,n){let r=[];if(Fh(null,e,n,r),e.depth>n){let i=mE(e,t,n+1);lc(fc(i,hb(e,t,n+1)),r)}return Fh(t,null,n,r),new K(r)}function UIe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(K.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Nh{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return tt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new mb(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u),a.isText))break;o=c-1,i+=s+1}return new Nh(n,r,o)}static resolveCached(t,n){for(let i=0;i<vE.length;i++){let o=vE[i];if(o.pos==n&&o.doc==t)return o}let r=vE[gE]=Nh.resolve(t,n);return gE=(gE+1)%BIe,r}}let vE=[],gE=0,BIe=12;class mb{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}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)}}const qIe=Object.create(null);let dc=class pM{constructor(t,n,r,i=tt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||K.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&db(this.attrs,n||t.defaultAttrs||qIe)&&tt.sameSet(this.marks,r||tt.none)}copy(t=null){return t==this.content?this:new pM(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new pM(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return ae.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),c=i.node(a).content.cut(i.pos-u,o.pos-u);return new ae(c,i.depth-a,o.depth-a)}replace(t,n,r){return DIe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Nh.resolveCached(this,t)}resolveNoCache(t){return Nh.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),mV(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=K.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=tt.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!tt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=K.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};dc.prototype.text=void 0;class vb extends dc{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mV(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new vb(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new vb(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function mV(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class pc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new zIe(t,n);if(r.next==null)return pc.empty;let i=vV(r);r.next&&r.err("Unexpected trailing text");let o=ZIe(JIe(i));return XIe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return K.from(u.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:u,next:s}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||s.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
30
+ `)}}pc.empty=new pc(!0);class zIe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function vV(e){let t=[];do t.push(KIe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function KIe(e){let t=[];do t.push(VIe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function VIe(e){let t=YIe(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=HIe(e,t);else break;return t}function gV(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function HIe(e,t){let n=gV(e),r=n;return e.eat(",")&&(e.next!="}"?r=gV(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function GIe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function YIe(e){if(e.eat("(")){let t=vV(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=GIe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function JIe(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,u,s){let c={term:s,to:u};return t[a].push(c),c}function i(a,u){a.forEach(s=>s.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(o(c,u)),[]);if(a.type=="seq")for(let s=0;;s++){let c=o(a.exprs[s],u);if(s==a.exprs.length-1)return c;i(c,u=n())}else if(a.type=="star"){let s=n();return r(u,s),i(o(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(o(a.expr,u),s),i(o(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let s=u;for(let c=0;c<a.min;c++){let l=n();i(o(a.expr,s),l),s=l}if(a.max==-1)i(o(a.expr,s),s);else for(let c=a.min;c<a.max;c++){let l=n();r(s,l),i(o(a.expr,s),l),s=l}return[r(s)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function yV(e,t){return t-e}function bV(e,t){let n=[];return r(t),n.sort(yV);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];!u&&n.indexOf(s)==-1&&r(s)}}}function ZIe(e){let t=Object.create(null);return n(bV(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:u,to:s})=>{if(!u)return;let c;for(let l=0;l<i.length;l++)i[l][0]==u&&(c=i[l][1]);bV(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new pc(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(yV);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function XIe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:s,next:c}=i.next[u];a.push(s.name),o&&!(s.isText||s.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function _V(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 $V(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function SV(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new QIe(e[n]);return t}let TV=class FH{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=SV(r.attrs),this.defaultAttrs=_V(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==pc.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:$V(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new dc(this,this.computeAttrs(t),K.from(n),tt.setFrom(r))}createChecked(t=null,n,r){return n=K.from(n),this.checkContent(n),new dc(this,this.computeAttrs(t),n,tt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=K.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(K.empty,!0);return o?new dc(this,t,n.append(o),tt.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:tt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new FH(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class QIe{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class gb{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=SV(i.attrs),this.excluded=null;let o=_V(this.attrs);this.instance=o?new tt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new tt(this,$V(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new gb(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class e1e{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=mn.from(t.nodes),n.marks=mn.from(t.marks||{}),this.nodes=TV.compile(this.spec.nodes,this),this.marks=gb.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=pc.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?IV(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:IV(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof TV){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new vb(r,r.defaultAttrs,t,tt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return dc.fromJSON(this,t)}markFromJSON(t){return tt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function IV(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let u in e.marks){let s=e.marks[u];(i=="_"||s.spec.group&&s.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Cf{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new EV(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new EV(this,n,!0);return r.addAll(t,n.from,n.to),ae.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(r1e(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(u.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(u.charCodeAt(t.length)!=61||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let u=n[a];if((u.priority==null?50:u.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=RV(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=RV(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Cf(t,Cf.schemaRules(t)))}}const OV={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},t1e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},CV={ol:!0,ul:!0},yb=1,bb=2,Ph=4;function wV(e,t,n){return t!=null?(t?yb:0)|(t==="full"?bb:0):e&&e.whitespace=="pre"?yb|bb:n&~Ph}class _b{constructor(t,n,r,i,o,a,u){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=tt.none,this.stashMarks=[],this.match=a||(u&Ph?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(K.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&yb)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=K.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(K.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):o1e(i.type,t))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!OV.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class EV{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=wV(null,n.preserveWhitespace,0)|(r?Ph:0);i?o=new _b(i.type,i.attrs,tt.none,tt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new _b(null,null,tt.none,tt.none,!0,null,a):o=new _b(t.schema.topNodeType,null,tt.none,tt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let r=this.readStyles(i1e(n));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(t);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&bb||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&yb)r.options&bb?n=n.replace(/\r\n?/g,`
31
+ `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;CV.hasOwnProperty(r)&&this.parser.normalizeLists&&n1e(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:t1e.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let a,u=this.top,s=this.needsBlock;if(OV.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
32
+ `))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=tt.none,r=tt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(s=>this.insertNode(s));else{let s=t;typeof n.contentElement=="string"?s=t.querySelector(n.contentElement):typeof n.contentElement=="function"?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=r==null?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=wV(t,i,o.options);o.options&Ph&&o.content.length==0&&(a|=Ph),this.nodes.push(new _b(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));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(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(u,s)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;s>=o;s--)if(a(u-1,s))return!0;return!1}else{let l=s>0||s==0&&i?this.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!l||l.name!=c&&l.groups.indexOf(c)==-1)return!1;s--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=a1e(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let a=i.popFromStashMark(t);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==n)break}}}function n1e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&CV.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function r1e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function i1e(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function RV(e){let t={};for(let n in e)t[n]=e[n];return t}function o1e(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=u=>{o.push(u);for(let s=0;s<u.edgeCount;s++){let{type:c,next:l}=u.edge(s);if(c==t||o.indexOf(l)<0&&a(l))return!0}};if(a(i.contentMatch))return!0}}function a1e(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class go{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=yE(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let u=0,s=0;for(;u<o.length&&s<a.marks.length;){let c=a.marks[s];if(!this.marks[c.type.name]){s++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,s++}for(;u<o.length;)i=o.pop()[1];for(;s<a.marks.length;){let c=a.marks[s++],l=this.serializeMark(c,a.isInline,n);l&&(o.push([c,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=go.renderSpec(yE(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&go.renderSpec(yE(r),i(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){c=2;for(let l in s)if(s[l]!=null){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let l=c;l<n.length;l++){let f=n[l];if(f===0){if(l<n.length-1||l>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:d,contentDOM:p}=go.renderSpec(t,f,r);if(u.appendChild(d),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new go(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=MV(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return MV(t.marks)}}function MV(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function yE(e){return e.document||window.document}const xV=65535,kV=Math.pow(2,16);function u1e(e,t){return e+t*kV}function AV(e){return e&xV}function s1e(e){return(e-(e&xV))/kV}const FV=1,NV=2,$b=4,PV=8;class bE{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&PV)>0}get deletedBefore(){return(this.delInfo&(FV|$b))>0}get deletedAfter(){return(this.delInfo&(NV|$b))>0}get deletedAcross(){return(this.delInfo&$b)>0}}class Yr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Yr.empty)return Yr.empty}recover(t){let n=0,r=AV(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+s1e(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:u1e(u/3,t-s),v=t==s?NV:t==f?FV:$b;return(n<0?t!=s:t!=f)&&(v|=PV),new bE(p,v,h)}i+=l-c}return r?t+i:new bE(t+i,0,null)}touches(t,n){let r=0,i=AV(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o],l=s+c;if(t<=l&&u==i*3)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Yr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Yr.empty:new Yr(t<0?[0,-t,0]:[0,0,t])}}Yr.empty=new Yr([]);class wf{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new wf(this.maps,this.mirror,t,n)}copy(){return new wf(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new wf;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],u=a.mapResult(t,n);if(u.recover!=null){let s=this.getMirror(o);if(s!=null&&s>o&&s<this.to){o=s,t=this.maps[s].recover(u.recover);continue}}i|=u.delInfo,t=u.pos}return r?t:new bE(t,i,null)}}const _E=Object.create(null);class ar{getMap(){return Yr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=_E[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in _E)throw new RangeError("Duplicate use of step JSON ID "+t);return _E[t]=n,n.prototype.jsonID=t,n}}class Dt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Dt(t,null)}static fail(t){return new Dt(null,t)}static fromReplace(t,n,r,i){try{return Dt.ok(t.replace(n,r,i))}catch(o){if(o instanceof pb)return Dt.fail(o.message);throw o}}}function $E(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy($E(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return K.fromArray(r)}class Ou extends ar{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ae($E(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Dt.fromReplace(t,this.from,this.to,o)}invert(){return new yo(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 Ou(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ou&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ou(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 new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ou(n.from,n.to,t.markFromJSON(n.mark))}}ar.jsonID("addMark",Ou);class yo extends ar{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ae($E(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Dt.fromReplace(t,this.from,this.to,r)}invert(){return new Ou(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 yo(n.pos,r.pos,this.mark)}merge(t){return t instanceof yo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new yo(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 new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new yo(n.from,n.to,t.markFromJSON(n.mark))}}ar.jsonID("removeMark",yo);class Cu extends ar{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Dt.fromReplace(t,this.pos,this.pos+1,new ae(K.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Cu(this.pos,n.marks[i]);return new Cu(this.pos,this.mark)}}return new Ef(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Cu(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 new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Cu(n.pos,t.markFromJSON(n.mark))}}ar.jsonID("addNodeMark",Cu);class Ef extends ar{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Dt.fromReplace(t,this.pos,this.pos+1,new ae(K.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Cu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ef(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 new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ef(n.pos,t.markFromJSON(n.mark))}}ar.jsonID("removeNodeMark",Ef);class Cn extends ar{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&SE(t,this.from,this.to)?Dt.fail("Structure replace would overwrite content"):Dt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Yr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Cn(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Cn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Cn)||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?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Cn(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?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Cn(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Cn(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}ar.jsonID("replace",Cn);class Jt extends ar{constructor(t,n,r,i,o,a,u=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=u}apply(t){if(this.structure&&(SE(t,this.from,this.gapFrom)||SE(t,this.gapTo,this.to)))return Dt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Dt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Dt.fromReplace(t,this.from,this.to,r):Dt.fail("Content does not fit in gap")}getMap(){return new Yr([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 Jt(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=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Jt(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}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 new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Jt(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}ar.jsonID("replaceAround",Jt);function SE(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function c1e(e,t,n,r){let i=[],o=[],a,u;e.doc.nodesBetween(t,n,(s,c,l)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&l.type.allowsMarkType(r.type)){let d=Math.max(c,t),p=Math.min(c+s.nodeSize,n),h=r.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(h)||(a&&a.to==d&&a.mark.eq(f[v])?a.to=p:i.push(a=new yo(d,p,f[v])));u&&u.to==d?u.to=p:o.push(u=new Ou(d,p,r))}}),i.forEach(s=>e.step(s)),o.forEach(s=>e.step(s))}function l1e(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,u)=>{if(!a.isInline)return;o++;let s=null;if(r instanceof gb){let c=a.marks,l;for(;l=r.isInSet(c);)(s||(s=[])).push(l),c=l.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(u+a.nodeSize,n);for(let l=0;l<s.length;l++){let f=s[l],d;for(let p=0;p<i.length;p++){let h=i[p];h.step==o-1&&f.eq(i[p].style)&&(d=h)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(u,t),to:c,step:o})}}}),i.forEach(a=>e.step(new yo(a.from,a.to,a.style)))}function f1e(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],a=t+1;for(let u=0;u<i.childCount;u++){let s=i.child(u),c=a+s.nodeSize,l=r.matchType(s.type);if(!l)o.push(new Cn(a,c,ae.empty));else{r=l;for(let f=0;f<s.marks.length;f++)n.allowsMarkType(s.marks[f].type)||e.step(new yo(a,c,s.marks[f]))}a=c}if(!r.validEnd){let u=r.fillBefore(K.empty,!0);e.replace(a,a,new ae(u,0,0))}for(let u=o.length-1;u>=0;u--)e.step(o[u])}function d1e(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Rf(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!d1e(i,o,a))break}return null}function p1e(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),u=i.after(o+1),s=a,c=u,l=K.empty,f=0;for(let h=o,v=!1;h>n;h--)v||r.index(h)>0?(v=!0,l=K.from(r.node(h).copy(l)),f++):s--;let d=K.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)<i.end(h)?(v=!0,d=K.from(i.node(h).copy(d)),p++):c++;e.step(new Jt(s,c,a,u,new ae(l.append(d),f,p),l.size-f,!0))}function TE(e,t,n=null,r=e){let i=h1e(e,t),o=i&&m1e(r,t);return o?i.map(WV).concat({type:t,attrs:n}).concat(o.map(WV)):null}function WV(e){return{type:e,attrs:null}}function h1e(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function m1e(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;s&&c<i;c++)s=s.matchType(n.child(c).type);return!s||!s.validEnd?null:a}function v1e(e,t,n){let r=K.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let u=n[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=K.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new Jt(i,o,i,o,new ae(r,0,0),n.length,!0))}function g1e(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&y1e(e.doc,e.mapping.slice(o).map(u),r)){e.clearIncompatible(e.mapping.slice(o).map(u,1),r);let s=e.mapping.slice(o),c=s.map(u,1),l=s.map(u+a.nodeSize,1);return e.step(new Jt(c,l,c+1,l-1,new ae(K.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function y1e(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function b1e(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Jt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ae(K.from(a),0,0),1,!0))}function Mf(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,l=n-2;c>o;c--,l--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[l+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let v=r&&r[l]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(p))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function _1e(e,t,n=1,r){let i=e.doc.resolve(t),o=K.empty,a=K.empty;for(let u=i.depth,s=i.depth-n,c=n-1;u>s;u--,c--){o=K.from(i.node(u).copy(o));let l=r&&r[c];a=K.from(l?l.type.create(l.attrs,a):i.node(u).copy(a))}e.step(new Cn(t,t,new ae(o.append(a),n,n),!0))}function wu(e,t){let n=e.resolve(t),r=n.index();return LV(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function LV(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function jV(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&LV(o,a)&&r.node(i).canReplace(u,u+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function $1e(e,t,n){let r=new Cn(t-n,t+n,ae.empty,!0);e.step(r)}function S1e(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 i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function T1e(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,s=r.index(a)+(u>0?1:0),c=r.node(a),l=!1;if(o==1)l=c.canReplace(s,s,i);else{let f=c.contentMatchAt(s).findWrapping(i.firstChild.type);l=f&&c.canReplaceWith(s,s,f[0])}if(l)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function IE(e,t,n=t,r=ae.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return DV(i,o,r)?new Cn(t,n,r):new I1e(i,o,r).fit()}function DV(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class I1e{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=K.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=K.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let s=new ae(o,a,u);return t>-1?new Jt(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new Cn(r.pos,i.pos,s):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=OE(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:s,match:c}=this.frontier[u],l,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(K.from(a),!1)):o&&s.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:f};if(n==2&&a&&(l=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=OE(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=OE(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ae(Wh(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ae(Wh(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,u=r?r.content:a.content,s=a.openStart-t,c=0,l=[],{match:f,type:d}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));f=f.matchFragment(i)}let p=u.size+t-(a.content.size-a.openEnd);for(;c<u.childCount;){let v=u.child(c),g=f.matchType(v.type);if(!g)break;c++,(c>1||s==0||v.content.size)&&(f=g,l.push(UV(v.mark(d.allowedMarks(v.marks)),c==1?s:0,c==u.childCount?p:-1)))}let h=c==u.childCount;h||(p=-1),this.placed=Lh(this.placed,n,K.from(l)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,g=u;v<p;v++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content}this.unplaced=h?t==0?ae.empty:new ae(Wh(a.content,t-1,1),t-1,p<0?a.openEnd:t-1):new ae(Wh(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!CE(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=CE(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=CE(t,u,c,s,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Lh(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Lh(this.placed,this.depth,K.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(K.empty,!0);n.childCount&&(this.placed=Lh(this.placed,this.frontier.length,n))}}function Wh(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Wh(e.firstChild.content,t-1,n)))}function Lh(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Lh(e.lastChild.content,t-1,n)))}function OE(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function UV(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,UV(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(K.empty,!0)))),e.copy(r)}function CE(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!O1e(n,o.content,a)?u:null}function O1e(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function C1e(e){return e.spec.defining||e.spec.definingForContent}function w1e(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(DV(i,o,r))return e.step(new Cn(t,n,r));let a=qV(i,e.doc.resolve(n));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let d=i.depth,p=i.pos-1;d>0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(d)>-1?u=d:i.before(d)==p&&a.splice(1,0,-d)}let s=a.indexOf(u),c=[],l=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(c.push(h),p==r.openStart)break;d=h.content}for(let d=l-1;d>=0;d--){let p=c[d].type,h=C1e(p);if(h&&i.node(s).type!=p)l=d;else if(h||!p.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+l+1)%(r.openStart+1),h=c[p];if(h)for(let v=0;v<a.length;v++){let g=a[(v+s)%a.length],b=!0;g<0&&(b=!1,g=-g);let S=i.node(g-1),O=i.index(g-1);if(S.canReplaceWith(O,O,h.type,h.marks))return e.replace(i.before(g),b?o.after(g):n,new ae(BV(r.content,0,r.openStart,p),p,r.openEnd))}}let f=e.steps.length;for(let d=a.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=a[d];p<0||(t=i.before(p),n=o.after(p))}}function BV(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(BV(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),a=o.fillBefore(e).append(e);e=a.append(o.matchFragment(a).fillBefore(K.empty,!0))}return e}function E1e(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=S1e(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new ae(K.from(r),0,0))}function R1e(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=qV(r,i);for(let a=0;a<o.length;a++){let u=o[a],s=a==o.length-1;if(s&&u==0||r.node(u).type.contentMatch.validEnd)return e.delete(r.start(u),i.end(u));if(u>0&&(s||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return e.delete(r.before(u),i.after(u))}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)return e.delete(r.before(a),n);e.delete(t,n)}function qV(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<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;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class xf extends ar{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Dt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Dt.fromReplace(t,this.pos,this.pos+1,new ae(K.from(i),0,n.isLeaf?0:1))}getMap(){return Yr.empty}invert(t){return new xf(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 xf(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 new RangeError("Invalid input for AttrStep.fromJSON");return new xf(n.pos,n.attr,n.value)}}ar.jsonID("attr",xf);let kf=class extends Error{};kf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},kf.prototype=Object.create(Error.prototype),kf.prototype.constructor=kf,kf.prototype.name="TransformError";class M1e{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new wf}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new kf(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=ae.empty){let i=IE(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new ae(K.from(r),0,0))}delete(t,n){return this.replace(t,n,ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return w1e(this,t,n,r),this}replaceRangeWith(t,n,r){return E1e(this,t,n,r),this}deleteRange(t,n){return R1e(this,t,n),this}lift(t,n){return p1e(this,t,n),this}join(t,n=1){return $1e(this,t,n),this}wrap(t,n){return v1e(this,t,n),this}setBlockType(t,n=t,r,i=null){return g1e(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return b1e(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new xf(t,n,r)),this}addNodeMark(t,n){return this.step(new Cu(t,n)),this}removeNodeMark(t,n){if(!(n instanceof tt)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ef(t,n)),this}split(t,n=1,r){return _1e(this,t,n,r),this}addMark(t,n,r){return c1e(this,t,n,r),this}removeMark(t,n,r){return l1e(this,t,n,r),this}clearIncompatible(t,n,r){return f1e(this,t,n,r),this}}const wE=Object.create(null);class Ne{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new x1e(t.min(n),t.max(n))]}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 t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let r=n.content.lastChild,i=null;for(let u=0;u<n.openEnd;u++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:s,$to:c}=a[u],l=t.mapping.slice(o);t.replaceRange(l.map(s.pos),l.map(c.pos),u?ae.empty:n),u==0&&VV(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),VV(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new De(t):Af(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let a=n<0?Af(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Af(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ai(t.node(0))}static atStart(t){return Af(t,t,0,0,1)||new Ai(t)}static atEnd(t){return Af(t,t,t.content.size,t.childCount,-1)||new Ai(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=wE[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in wE)throw new RangeError("Duplicate use of selection JSON ID "+t);return wE[t]=n,n.prototype.jsonID=t,n}getBookmark(){return De.between(this.$anchor,this.$head).getBookmark()}}Ne.prototype.visible=!0;class x1e{constructor(t,n){this.$from=t,this.$to=n}}let zV=!1;function KV(e){!zV&&!e.parent.inlineContent&&(zV=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class De extends Ne{constructor(t,n=t){KV(t),KV(n),super(t,n)}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 Ne.near(r);let i=t.resolve(n.map(this.anchor));return new De(i.parent.inlineContent?i:r,r)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof De&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Sb(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 new RangeError("Invalid input for TextSelection.fromJSON");return new De(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=Ne.findFrom(n,r,!0)||Ne.findFrom(n,-r,!0);if(o)n=o.$head;else return Ne.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Ne.findFrom(t,-r,!0)||Ne.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new De(t,n)}}Ne.jsonID("text",De);class Sb{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Sb(t.map(this.anchor),t.map(this.head))}resolve(t){return De.between(t.resolve(this.anchor),t.resolve(this.head))}}class be extends Ne{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?Ne.near(o):new be(o)}content(){return new ae(K.from(this.node),0,0)}eq(t){return t instanceof be&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new EE(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new be(t.resolve(n.anchor))}static create(t,n){return new be(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}be.prototype.visible=!1,Ne.jsonID("node",be);class EE{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Sb(r,r):new EE(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&be.isSelectable(r)?new be(n):Ne.near(n)}}class Ai extends Ne{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let r=Ne.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ai(t)}map(t){return new Ai(t)}eq(t){return t instanceof Ai}getBookmark(){return k1e}}Ne.jsonID("all",Ai);const k1e={map(){return this},resolve(e){return new Ai(e)}};function Af(e,t,n,r,i,o=!1){if(t.inlineContent)return De.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let u=t.child(a);if(u.isAtom){if(!o&&be.isSelectable(u))return be.create(e,n-(i<0?u.nodeSize:0))}else{let s=Af(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function VV(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Cn||i instanceof Jt))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(Ne.near(e.doc.resolve(a),n))}const HV=1,Tb=2,GV=4;class A1e extends M1e{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|HV)&~Tb,this.storedMarks=null,this}get selectionSet(){return(this.updated&HV)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Tb,this}ensureMarks(t){return tt.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Tb)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Tb,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||tt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(n);o=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),this.selection.empty||this.setSelection(Ne.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=GV,this}get scrolledIntoView(){return(this.updated&GV)>0}}function YV(e,t){return!t||!e?e:e.bind(t)}class jh{constructor(t,n,r){this.name=t,this.init=YV(n.init,r),this.apply=YV(n.apply,r)}}const F1e=[new jh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new jh("selection",{init(e,t){return e.selection||Ne.atStart(t.doc)},apply(e){return e.selection}}),new jh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new jh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class RE{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=F1e.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new jh(r.key,r.spec.state,r))})}}class Ff{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ff(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new A1e(this)}static create(t){let n=new RE(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Ff(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new RE(this.schema,t.plugins),r=n.fields,i=new Ff(n);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new RE(t.schema,t.plugins),o=new Ff(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=dc.fromJSON(t.schema,n.doc);else if(a.name=="selection")o.selection=Ne.fromJSON(o.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let u in r){let s=r[u],c=s.spec.state;if(s.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[a.name]=c.fromJSON.call(s,t,n[u],o);return}}o[a.name]=a.init(t,o)}}),o}}function JV(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=JV(i,t,{})),n[r]=i}return n}class Er{constructor(t){this.spec=t,this.props={},t.props&&JV(t.props,this,this.props),this.key=t.key?t.key.key:ZV("plugin")}getState(t){return t[this.key]}}const ME=Object.create(null);function ZV(e){return e in ME?e+"$"+ ++ME[e]:(ME[e]=0,e+"$")}class Fi{constructor(t="key"){this.key=ZV(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Rr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Dh=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let XV=null;const Ca=function(e,t,n){let r=XV||(XV=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},hc=function(e,t,n,r){return n&&(QV(e,t,n,r,-1)||QV(e,t,n,r,1))},N1e=/^(img|br|input|textarea|hr)$/i;function QV(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:bo(e))){let o=e.parentNode;if(!o||o.nodeType!=1||W1e(e)||N1e.test(e.nodeName)||e.contentEditable=="false")return!1;t=Rr(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?bo(e):0}else return!1}}function bo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function P1e(e,t,n){for(let r=t==0,i=t==bo(e);r||i;){if(e==n)return!0;let o=Rr(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==bo(e)}}function W1e(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)}const Ib=function(e){return e.focusNode&&hc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function mc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function L1e(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function j1e(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const _o=typeof navigator<"u"?navigator:null,e3=typeof document<"u"?document:null,Eu=_o&&_o.userAgent||"",xE=/Edge\/(\d+)/.exec(Eu),t3=/MSIE \d/.exec(Eu),kE=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Eu),ur=!!(t3||kE||xE),Ru=t3?document.documentMode:kE?+kE[1]:xE?+xE[1]:0,Ni=!ur&&/gecko\/(\d+)/i.test(Eu);Ni&&+(/Firefox\/(\d+)/.exec(Eu)||[0,0])[1];const AE=!ur&&/Chrome\/(\d+)/.exec(Eu),wn=!!AE,D1e=AE?+AE[1]:0,qn=!ur&&!!_o&&/Apple Computer/.test(_o.vendor),Nf=qn&&(/Mobile\/\w+/.test(Eu)||!!_o&&_o.maxTouchPoints>2),Jr=Nf||(_o?/Mac/.test(_o.platform):!1),U1e=_o?/Win/.test(_o.platform):!1,Pi=/Android \d/.test(Eu),Ob=!!e3&&"webkitFontSmoothing"in e3.documentElement.style,B1e=Ob?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function q1e(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Mu(e,t){return typeof e=="number"?e:e[t]}function z1e(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 n3(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let a=n||e.dom;a;a=Dh(a)){if(a.nodeType!=1)continue;let u=a,s=u==o.body,c=s?q1e(o):z1e(u),l=0,f=0;if(t.top<c.top+Mu(r,"top")?f=-(c.top-t.top+Mu(i,"top")):t.bottom>c.bottom-Mu(r,"bottom")&&(f=t.bottom-c.bottom+Mu(i,"bottom")),t.left<c.left+Mu(r,"left")?l=-(c.left-t.left+Mu(i,"left")):t.right>c.right-Mu(r,"right")&&(l=t.right-c.right+Mu(i,"right")),l||f)if(s)o.defaultView.scrollBy(l,f);else{let d=u.scrollLeft,p=u.scrollTop;f&&(u.scrollTop+=f),l&&(u.scrollLeft+=l);let h=u.scrollLeft-d,v=u.scrollTop-p;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(s)break}}function K1e(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let u=e.root.elementFromPoint(o,a);if(!u||u==e.dom||!e.dom.contains(u))continue;let s=u.getBoundingClientRect();if(s.top>=n-20){r=u,i=s.top;break}}return{refDOM:r,refTop:i,stack:r3(e.dom)}}function r3(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Dh(r));return t}function V1e({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;i3(n,r==0?0:r-t)}function i3(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Pf=null;function H1e(e){if(e.setActive)return e.setActive();if(Pf)return e.focus(Pf);let t=r3(e);e.focus(Pf==null?{get preventScroll(){return Pf={preventScroll:!0},!0}}:void 0),Pf||(Pf=!1,i3(t,0))}function o3(e,t){let n,r=2e8,i,o=0,a=t.top,u=t.top,s,c;for(let l=e.firstChild,f=0;l;l=l.nextSibling,f++){let d;if(l.nodeType==1)d=l.getClientRects();else if(l.nodeType==3)d=Ca(l).getClientRects();else continue;for(let p=0;p<d.length;p++){let h=d[p];if(h.top<=a&&h.bottom>=u){a=Math.max(h.bottom,a),u=Math.min(h.top,u);let v=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(v<r){n=l,r=v,i=v&&n.nodeType==3?{left:h.right<t.left?h.right:h.left,top:t.top}:t,l.nodeType==1&&v&&(o=f+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!s&&h.left<=t.left&&h.right>=t.left&&(s=l,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(o=f+1)}}return!n&&s&&(n=s,i=c,r=0),n&&n.nodeType==3?G1e(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:o3(n,i)}function G1e(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let o=xu(r,1);if(o.top!=o.bottom&&FE(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function FE(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Y1e(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function J1e(e,t,n){let{node:r,offset:i}=o3(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function Z1e(e,t,n,r){let i=-1;for(let o=t,a=!1;o!=e.dom;){let u=e.docView.nearestDesc(o,!0);if(!u)return null;if(u.dom.nodeType==1&&(u.node.isBlock&&u.parent&&!a||!u.contentDOM)){let s=u.dom.getBoundingClientRect();if(u.node.isBlock&&u.parent&&!a&&(a=!0,s.left>r.left||s.top>r.top?i=u.posBefore:(s.right<r.left||s.bottom<r.top)&&(i=u.posAfter)),!u.contentDOM&&i<0)return(u.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?u.posBefore:u.posAfter}o=u.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function a3(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)),o=i;;){let a=e.childNodes[o];if(a.nodeType==1){let u=a.getClientRects();for(let s=0;s<u.length;s++){let c=u[s];if(FE(t,c))return a3(a,t,c)}}if((o=(o+1)%r)==i)break}return e}function X1e(e,t){let n=e.dom.ownerDocument,r,i=0,o=j1e(n,t.left,t.top);o&&({node:r,offset:i}=o);let a=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),u;if(!a||!e.dom.contains(a.nodeType!=1?a.parentNode:a)){let c=e.dom.getBoundingClientRect();if(!FE(t,c)||(a=a3(e.dom,t,c),!a))return null}if(qn)for(let c=a;r&&c;c=Dh(c))c.draggable&&(r=void 0);if(a=Y1e(a,t),r){if(Ni&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let c=r.childNodes[i],l;c.nodeName=="IMG"&&(l=c.getBoundingClientRect()).right<=t.left&&l.bottom>t.top&&i++}r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(u=Z1e(e,r,i,t))}u==null&&(u=J1e(e,a,t));let s=e.docView.nearestDesc(a,!0);return{pos:u,inside:s?s.posAtStart-s.border:-1}}function u3(e){return e.top<e.bottom||e.left<e.right}function xu(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(u3(r))return r}return Array.prototype.find.call(n,u3)||e.getBoundingClientRect()}const Q1e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function s3(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),a=Ob||Ni;if(r.nodeType==3)if(a&&(Q1e.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let s=xu(Ca(r,i,i),n);if(Ni&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=xu(Ca(r,i-1,i-1),-1);if(c.top==s.top){let l=xu(Ca(r,i,i+1),-1);if(l.top!=s.top)return Uh(l,l.left<c.left)}}return s}else{let s=i,c=i,l=n<0?1:-1;return n<0&&!i?(c++,l=-1):n>=0&&i==r.nodeValue.length?(s--,l=1):n<0?s--:c++,Uh(xu(Ca(r,s,c),l),l<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==bo(r))){let s=r.childNodes[i-1];if(s.nodeType==1)return NE(s.getBoundingClientRect(),!1)}if(o==null&&i<bo(r)){let s=r.childNodes[i];if(s.nodeType==1)return NE(s.getBoundingClientRect(),!0)}return NE(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==bo(r))){let s=r.childNodes[i-1],c=s.nodeType==3?Ca(s,bo(s)-(a?0:1)):s.nodeType==1&&(s.nodeName!="BR"||!s.nextSibling)?s:null;if(c)return Uh(xu(c,1),!1)}if(o==null&&i<bo(r)){let s=r.childNodes[i];for(;s.pmViewDesc&&s.pmViewDesc.ignoreForCoords;)s=s.nextSibling;let c=s?s.nodeType==3?Ca(s,0,a?0:1):s.nodeType==1?s:null:null;if(c)return Uh(xu(c,-1),!0)}return Uh(xu(r.nodeType==3?Ca(r):r,-n),n>=0)}function Uh(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 NE(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 c3(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 eOe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return c3(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let u=e.docView.nearestDesc(o,!0);if(!u)break;if(u.node.isBlock){o=u.contentDOM||u.dom;break}o=u.dom.parentNode}let a=s3(e,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let s;if(u.nodeType==1)s=u.getClientRects();else if(u.nodeType==3)s=Ca(u,0,u.nodeValue.length).getClientRects();else continue;for(let c=0;c<s.length;c++){let l=s[c];if(l.bottom>l.top+1&&(n=="up"?a.top-l.top>(l.bottom-a.top)*2:l.bottom-a.bottom>(a.bottom-l.top)*2))return!1}}return!0})}const tOe=/[\u0590-\u08ac]/;function nOe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,u=e.domSelection();return!tOe.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:a:c3(e,t,()=>{let{focusNode:s,focusOffset:c,anchorNode:l,anchorOffset:f}=e.domSelectionRange(),d=u.caretBidiLevel;u.modify("move",n,"character");let p=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:v}=e.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||s==h&&c==v;try{u.collapse(l,f),s&&(s!=l||c!=f)&&u.extend&&u.extend(s,c)}catch{}return d!=null&&(u.caretBidiLevel=d),g})}let l3=null,f3=null,d3=!1;function rOe(e,t,n){return l3==t&&f3==n?d3:(l3=t,f3=n,d3=n=="up"||n=="down"?eOe(e,t,n):nOe(e,t,n))}const Zr=0,p3=1,vc=2,$o=3;class Bh{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Zr,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.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(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let o,a;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>Rr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],u=o+a.size;if(u>t||a instanceof v3){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof h3&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Rr(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Rr(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(i==-1&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Rr(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let l=u+1;l<this.children.length;l++){let f=this.children[l];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Rr(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),a=Math.max(t,n);for(let d=0,p=0;d<this.children.length;d++){let h=this.children[d],v=p+h.size;if(o>p&&a<v)return h.setSelection(t-p-h.border,n-p-h.border,r,i);p=v}let u=this.domFromPos(t,t?-1:1),s=n==t?u:this.domFromPos(n,n?-1:1),c=r.getSelection(),l=!1;if((Ni||qn)&&t==n){let{node:d,offset:p}=u;if(d.nodeType==3){if(l=!!(p&&d.nodeValue[p-1]==`
33
+ `),l&&p==d.nodeValue.length)for(let h=d,v;h;h=h.parentNode){if(v=h.nextSibling){v.nodeName=="BR"&&(u=s={node:v.parentNode,offset:Rr(v)+1});break}let g=h.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let h=d.childNodes[p-1];l=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(Ni&&c.focusNode&&c.focusNode!=s.node&&c.focusNode.nodeType==1){let d=c.focusNode.childNodes[c.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||l&&qn)&&hc(u.node,u.offset,c.anchorNode,c.anchorOffset)&&hc(s.node,s.offset,c.focusNode,c.focusOffset))return;let f=!1;if((c.extend||t==n)&&!l){c.collapse(u.node,u.offset);try{t!=n&&c.extend(s.node,s.offset),f=!0}catch{}}if(!f){if(t>n){let p=u;u=s,s=p}let d=document.createRange();d.setEnd(s.node,s.offset),d.setStart(u.node,u.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?vc:p3,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=$o:o.markDirty(t-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?vc:$o}r=a}this.dirty=vc}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?vc:p3;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class h3 extends Bh{constructor(t,n,r,i){let o,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(a.nodeType!=1){let u=document.createElement("span");u.appendChild(a),a=u}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Zr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class iOe extends Bh{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class gc extends Bh{constructor(t,n,r,i){super(t,[],r,i),this.mark=n}static create(t,n,r,i){let o=i.nodeViews[n.type.name],a=o&&o(n,i,r);return(!a||!a.dom)&&(a=go.renderSpec(document,n.type.spec.toDOM(n,r))),new gc(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&$o||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return this.dirty!=$o&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Zr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Zr}}slice(t,n,r){let i=gc.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=LE(o,n,a,r)),t>0&&(o=LE(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class ku extends Bh{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>{if(!s)return a;if(s.parent)return s.parent.posBeforeChild(s)},r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!l)l=document.createTextNode(n.text);else if(l.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else l||({dom:l,contentDOM:f}=go.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&l.nodeName!="BR"&&(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=b3(l,r,n),c?s=new oOe(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new Cb(t,n,r,i,l,d,o):new ku(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){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 n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>K.empty)}return t}matchesNode(t,n,r){return this.dirty==Zr&&t.eq(this.node)&&WE(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,a=o&&o.pos>-1?o:null,u=o&&o.pos<0,s=new uOe(this,a&&a.node,t);lOe(this.node,this.innerDeco,(c,l,f)=>{c.spec.marks?s.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!f&&s.syncToMarks(l==this.node.childCount?tt.none:this.node.child(l).marks,r,t),s.placeWidget(c,t,i)},(c,l,f,d)=>{s.syncToMarks(c.marks,r,t);let p;s.findNodeMatch(c,l,f,d)||u&&t.state.selection.from>i&&t.state.selection.to<i+c.nodeSize&&(p=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(c,l,f,p,t)||s.updateNextNode(c,l,f,t,d,i)||s.addNode(c,l,f,t,i),i+=c.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==vc)&&(a&&this.protectLocalComposition(t,a),g3(this.contentDOM,this.children,t),Nf&&fOe(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof De)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=dOe(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let u=a.nodeValue,s=pOe(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}else return{node:a,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new iOe(this,o,n,i);t.input.compositionNodes.push(a),this.children=LE(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==$o||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Zr}updateOuterDeco(t){if(WE(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=y3(this.dom,this.nodeDOM,PE(this.outerDeco,this.node,n),PE(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function m3(e,t,n,r,i){b3(r,t,e);let o=new ku(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Cb extends ku{constructor(t,n,r,i,o,a,u){super(t,n,r,i,o,null,a,u,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==$o||this.dirty!=Zr&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Zr||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Zr,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Cb(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=$o)}get domAtom(){return!1}}class v3 extends Bh{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Zr&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class oOe extends ku{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(this.dirty==$o)return!1;if(this.spec.update){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function g3(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let a=t[o],u=a.dom;if(u.parentNode==e){for(;u!=r;)r=_3(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(u,r);if(a instanceof gc){let s=r?r.previousSibling:e.lastChild;g3(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}for(;r;)r=_3(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const qh=function(e){e&&(this.nodeName=e)};qh.prototype=Object.create(null);const yc=[new qh];function PE(e,t,n){if(e.length==0)return yc;let r=n?yc[0]:new qh,i=[r];for(let o=0;o<e.length;o++){let a=e[o].type.attrs;if(a){a.nodeName&&i.push(r=new qh(a.nodeName));for(let u in a){let s=a[u];s!=null&&(n&&i.length==1&&i.push(r=new qh(t.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+s:u=="style"?r.style=(r.style?r.style+";":"")+s:u!="nodeName"&&(r[u]=s))}}}return i}function y3(e,t,n,r){if(n==yc&&r==yc)return t;let i=t;for(let o=0;o<r.length;o++){let a=r[o],u=n[o];if(o){let s;u&&u.nodeName==a.nodeName&&i!=e&&(s=i.parentNode)&&s.nodeName.toLowerCase()==a.nodeName||(s=document.createElement(a.nodeName),s.pmIsDeco=!0,s.appendChild(i),u=yc[0]),i=s}aOe(i,u||yc[0],a)}return i}function aOe(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 o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function b3(e,t,n){return y3(e,e,yc,PE(t,n,e.nodeType!=1))}function WE(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 _3(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class uOe{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=sOe(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let i=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&t[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Zr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){let c=this.top.children[s];if(c.matchesMark(t[o])&&!this.isLocked(c.dom)){u=s;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let s=gc.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return a.dirty==$o&&a.dom==a.contentDOM&&(a.dirty=vc),a.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o,a){for(let u=this.index;u<this.top.children.length;u++){let s=this.top.children[u];if(s instanceof ku){let c=this.preMatch.matched.get(s);if(c!=null&&c!=o)return!1;let l=s.dom,f,d=this.isLocked(l)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&s.dirty!=$o&&WE(n,s.outerDeco));if(!d&&s.update(t,n,r,i))return this.destroyBetween(this.index,u),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(s,t,n,r,i,a)))return this.top.children[this.index]=f,f.dirty=vc,f.updateChildren(i,a+1),f.dirty=Zr,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let u=ku.create(this.top,n,r,i,o,a);if(!u.contentDOM)return null;u.children=t.children,t.children=[],t.destroy();for(let s of u.children)s.parent=u;return u}addNode(t,n,r,i,o){let a=ku.create(this.top,t,n,r,i,o);a.contentDOM&&a.updateChildren(i,o+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new h3(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof gc;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Cb)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((qn||wn)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new v3(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function sOe(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,a=[];e:for(;i>0;){let u;for(;;)if(r){let c=n.children[r-1];if(c instanceof gc)n=c,r=c.children.length;else{u=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=u.node;if(s){if(s!=e.child(i-1))break;--i,o.set(u,i),a.push(u)}}return{index:i,matched:o,matches:a.reverse()}}function cOe(e,t){return e.type.side-t.type.side}function lOe(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let l=e.child(c);r(l,i,t.forChild(o,l),c),o+=l.nodeSize}return}let a=0,u=[],s=null;for(let c=0;;){if(a<i.length&&i[a].to==o){let h=i[a++],v;for(;a<i.length&&i[a].to==o;)(v||(v=[h])).push(i[a++]);if(v){v.sort(cOe);for(let g=0;g<v.length;g++)n(v[g],c,!!s)}else n(h,c,!!s)}let l,f;if(s)f=-1,l=s,s=null;else if(c<e.childCount)f=c,l=e.child(c++);else break;for(let h=0;h<u.length;h++)u[h].to<=o&&u.splice(h--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)u.push(i[a++]);let d=o+l.nodeSize;if(l.isText){let h=d;a<i.length&&i[a].from<h&&(h=i[a].from);for(let v=0;v<u.length;v++)u[v].to<h&&(h=u[v].to);h<d&&(s=l.cut(h-o),l=l.cut(0,h-o),d=h,f=-1)}let p=l.isInline&&!l.isLeaf?u.filter(h=>!h.inline):u.slice();r(l,p,t.forChild(o,l),f),o=d}}function fOe(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 dOe(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=bo(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function pOe(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let a=e.child(i++),u=o;if(o+=a.nodeSize,!a.isText)continue;let s=a.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;s+=c.text}if(o>=n){let c=u<r?s.lastIndexOf(t,r-u-1):-1;if(c>=0&&c+t.length+u>=n)return u+c;if(n==r&&s.length>=r+t.length-u&&s.slice(r-u,r-u+t.length)==t)return r}}return-1}function LE(e,t,n,r,i){let o=[];for(let a=0,u=0;a<e.length;a++){let s=e[a],c=u,l=u+=s.size;c>=n||l<=t?o.push(s):(c<t&&o.push(s.slice(0,t-c,r)),i&&(o.push(i),i=void 0),l>n&&o.push(s.slice(n-c,s.size,r)))}return o}function jE(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,c;if(Ib(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&be.isSelectable(l)&&i.parent&&!(l.isInline&&P1e(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new be(a==f?u:r.resolve(f))}}else{let l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;s=r.resolve(l)}if(!c){let l=t=="pointer"||e.state.selection.head<u.pos&&!o?1:-1;c=UE(e,s,u,l)}return c}function $3(e){return e.editable?e.hasFocus():E3(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function wa(e,t=!1){let n=e.state.selection;if(O3(e,n),!!$3(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&wn){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&hc(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)mOe(e);else{let{anchor:r,head:i}=n,o,a;S3&&!(n instanceof De)&&(n.$from.parent.inlineContent||(o=T3(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=T3(e,n.to))),e.docView.setSelection(r,i,e.root,t),S3&&(o&&I3(o),a&&I3(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&hOe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const S3=qn||wn&&D1e<63;function T3(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(qn&&i&&i.contentEditable=="false")return DE(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return DE(i);if(o)return DE(o)}}function DE(e){return e.contentEditable="true",qn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function I3(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function hOe(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(()=>{(!$3(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function mOe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Rr(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&ur&&Ru<=11&&(r.disabled=!0,r.disabled=!1)}function O3(e,t){if(t instanceof be){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(C3(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else C3(e)}function C3(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function UE(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||De.between(t,n,r)}function w3(e){return e.editable&&!e.hasFocus()?!1:E3(e)}function E3(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function vOe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return hc(t.node,t.offset,n.anchorNode,n.anchorOffset)}function BE(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Ne.findFrom(o,t)}function bc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function R3(e,t,n){let r=e.state.selection;if(r instanceof De){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let i=BE(e.state,t);return i&&i instanceof be?bc(e,i):!1}else if(!(Jr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM?be.isSelectable(o)?bc(e,new be(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):Ob?bc(e,new De(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof be&&r.node.isInline)return bc(e,new De(t>0?r.$to:r.$from));{let i=BE(e.state,t);return i?bc(e,i):!1}}}function wb(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function zh(e){let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function Kh(e,t){return t<0?gOe(e):M3(e)}function gOe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(Ni&&n.nodeType==1&&r<wb(n)&&zh(n.childNodes[r])&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(zh(u))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(x3(n))break;{let u=n.previousSibling;for(;u&&zh(u);)i=n.parentNode,o=Rr(u),u=u.previousSibling;if(u)n=u,r=wb(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?qE(e,n,r):i&&qE(e,i,o)}function M3(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=wb(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(zh(u))o=n,a=++r;else break}else{if(x3(n))break;{let u=n.nextSibling;for(;u&&zh(u);)o=u.parentNode,a=Rr(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=wb(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&qE(e,o,a)}function x3(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function qE(e,t,n){let r=e.domSelection();if(Ib(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&wa(e)},50)}function k3(e,t){let n=e.state.doc.resolve(t);if(!(wn||U1e)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function A3(e,t,n){let r=e.state.selection;if(r instanceof De&&!r.empty||n.indexOf("s")>-1||Jr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=BE(e.state,t);if(a&&a instanceof be)return bc(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof Ai?Ne.near(a,t):Ne.findFrom(a,t);return u?bc(e,u):!1}return!1}function F3(e,t){if(!(e.state.selection instanceof De))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 o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function N3(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function yOe(e){if(!qn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;N3(e,r,"true"),setTimeout(()=>N3(e,r,"false"),20)}return!1}function bOe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function _Oe(e,t){let n=t.keyCode,r=bOe(t);if(n==8||Jr&&n==72&&r=="c")return F3(e,-1)||Kh(e,-1);if(n==46&&!t.shiftKey||Jr&&n==68&&r=="c")return F3(e,1)||Kh(e,1);if(n==13||n==27)return!0;if(n==37||Jr&&n==66&&r=="c"){let i=n==37?k3(e,e.state.selection.from)=="ltr"?-1:1:-1;return R3(e,i,r)||Kh(e,i)}else if(n==39||Jr&&n==70&&r=="c"){let i=n==39?k3(e,e.state.selection.from)=="ltr"?1:-1:1;return R3(e,i,r)||Kh(e,i)}else{if(n==38||Jr&&n==80&&r=="c")return A3(e,-1,r)||Kh(e,-1);if(n==40||Jr&&n==78&&r=="c")return yOe(e)||A3(e,1,r)||M3(e);if(r==(Jr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function P3(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=e.someProp("clipboardSerializer")||go.fromSchema(e.state.schema),u=z3(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=B3[c.nodeName.toLowerCase()]);){for(let p=l.length-1;p>=0;p--){let h=u.createElement(l[p]);for(;s.firstChild;)h.appendChild(s.firstChild);s.appendChild(h),f++}c=s.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,`
34
+
35
+ `);return{dom:s,text:d}}function W3(e,t,n,r,i){let o=i.parent.type.spec.code,a,u;if(!n&&!t)return null;let s=t&&(r||o||!n);if(s){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return t?new ae(K.from(e.state.schema.text(t.replace(/\r\n?/g,`
36
+ `))),0,0):ae.empty;let f=e.someProp("clipboardTextParser",d=>d(t,i,r,e));if(f)u=f;else{let d=i.marks(),{schema:p}=e.state,h=go.fromSchema(p);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let g=a.appendChild(document.createElement("p"));v&&g.appendChild(h.serializeNode(p.text(v,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=TOe(n),Ob&&IOe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let f=+l[3];f>0;f--){let d=a.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;a=d}if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||Cf.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!$Oe.test(d.parentNode.nodeName)?{ignore:!0}:null}})),l)u=OOe(U3(u,+l[1],+l[2]),l[4]);else if(u=ae.maxOpen(SOe(u.content,i),!0),u.openStart||u.openEnd){let f=0,d=0;for(let p=u.content.firstChild;f<u.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=u.content.lastChild;d<u.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);u=U3(u,f,d)}return e.someProp("transformPasted",f=>{u=f(u,e)}),u}const $Oe=/^(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 SOe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(u=>{if(!a)return;let s=i.findWrapping(u.type),c;if(!s)return a=null;if(c=a.length&&o.length&&j3(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=D3(a[a.length-1],o.length));let l=L3(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return K.from(a)}return e}function L3(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,K.from(e));return e}function j3(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=j3(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(K.from(L3(n,e,i+1))))}}function D3(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,D3(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(K.empty,!0);return e.copy(n.append(r))}function zE(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return e.childCount>1&&(o=0),i<r-1&&(u=zE(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(K.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function U3(e,t,n){return t<e.openStart&&(e=new ae(zE(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(zE(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const B3={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let q3=null;function z3(){return q3||(q3=document.implementation.createHTMLDocument("title"))}function TOe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=z3().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&B3[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function IOe(e){let t=e.querySelectorAll(wn?"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==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function OOe(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:o,openEnd:a}=e;for(let u=r.length-2;u>=0;u-=2){let s=n.nodes[r[u]];if(!s||s.hasRequiredAttrs())break;i=K.from(s.create(r[u+1],i)),o++,a++}return new ae(i,o,a)}const zn={},Kn={},COe={touchstart:!0,touchmove:!0};class wOe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function EOe(e){for(let t in zn){let n=zn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{MOe(e,r)&&!VE(e,r)&&(e.editable||!(r.type in Kn))&&n(e,r)},COe[t]?{passive:!0}:void 0)}qn&&e.dom.addEventListener("input",()=>null),KE(e)}function Au(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ROe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function KE(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>VE(e,r))})}function VE(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function MOe(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 xOe(e,t){!VE(e,t)&&zn[t.type]&&(e.editable||!(t.type in Kn))&&zn[t.type](e,t)}Kn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!V3(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Pi&&wn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Nf&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,mc(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||_Oe(e,n)?n.preventDefault():Au(e,"key")},Kn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Kn.keypress=(e,t)=>{let n=t;if(V3(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Jr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof De)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Eb(e){return{left:e.clientX,top:e.clientY}}function kOe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function HE(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,u=>a>o.depth?u(e,n,o.nodeAfter,o.before(a),i,!0):u(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function Wf(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function AOe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&be.isSelectable(r)?(Wf(e,new be(n),"pointer"),!0):!1}function FOe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof be&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(be.isSelectable(u)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?(Wf(e,be.create(e.state.doc,i),"pointer"),!0):!1}function NOe(e,t,n,r,i){return HE(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?FOe(e,n):AOe(e,n))}function POe(e,t,n,r){return HE(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function WOe(e,t,n,r){return HE(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||LOe(e,n,r)}function LOe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Wf(e,De.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)Wf(e,De.create(r,u+1,u+1+a.content.size),"pointer");else if(be.isSelectable(a))Wf(e,be.create(r,u),"pointer");else continue;return!0}}function GE(e){return Rb(e)}const K3=Jr?"metaKey":"ctrlKey";zn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=GE(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&kOe(n,e.input.lastClick)&&!n[K3]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(Eb(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new jOe(e,a,n,!!r)):(o=="doubleClick"?POe:WOe)(e,a.pos,a.inside,n)?n.preventDefault():Au(e,"pointer"))};class jOe{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[K3],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}const u=i?null:r.target,s=u?t.docView.nearestDesc(u,!0):null;this.target=s?s.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof be&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ni&&!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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Au(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>wa(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Eb(t))),this.updateAllowDefault(t),this.allowDefault||!n?Au(this.view,"pointer"):NOe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||qn&&this.mightDrag&&!this.mightDrag.node.isAtom||wn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Wf(this.view,Ne.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):Au(this.view,"pointer")}move(t){this.updateAllowDefault(t),Au(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}zn.touchstart=e=>{e.input.lastTouch=Date.now(),GE(e),Au(e,"pointer")},zn.touchmove=e=>{e.input.lastTouch=Date.now(),Au(e,"pointer")},zn.contextmenu=e=>GE(e);function V3(e,t){return e.composing?!0:qn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const DOe=Pi?5e3:-1;Kn.compositionstart=Kn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),Rb(e,!0),e.markCursor=null;else if(Rb(e),Ni&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){e.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}H3(e,DOe)},Kn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionID++,H3(e,20))};function H3(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Rb(e),t))}function G3(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=UOe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function UOe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Rb(e,t=!1){if(!(Pi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),G3(e),t||e.docView&&e.docView.dirty){let n=jE(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function BOe(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)}const Lf=ur&&Ru<15||Nf&&B1e<604;zn.copy=Kn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Lf?null:n.clipboardData,a=r.content(),{dom:u,text:s}=P3(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):BOe(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function qOe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function zOe(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?Vh(e,r.value,null,i,t):Vh(e,r.textContent,r.innerHTML,i,t)},50)}function Vh(e,t,n,r,i){let o=W3(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",s=>s(e,i,o||ae.empty)))return!0;if(!o)return!1;let a=qOe(o),u=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(o);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Kn.paste=(e,t)=>{let n=t;if(e.composing&&!Pi)return;let r=Lf?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Vh(e,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():zOe(e,n)};class KOe{constructor(t,n){this.slice=t,this.move=n}}const Y3=Jr?"altKey":"ctrlKey";zn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Eb(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof be?i.to-1:i.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(be.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=e.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(be.create(e.state.doc,c.posBefore)))}}let a=e.state.selection.content(),{dom:u,text:s}=P3(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Lf?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Lf||n.dataTransfer.setData("text/plain",s),e.dragging=new KOe(a,!n[Y3])},zn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Kn.dragover=Kn.dragenter=(e,t)=>t.preventDefault(),Kn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Eb(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a,e)}):a=W3(e,n.dataTransfer.getData(Lf?"Text":"text/plain"),Lf?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[Y3]);if(e.someProp("handleDrop",h=>h(e,n,a||ae.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?T1e(e.state.doc,o.pos,a):o.pos;s==null&&(s=o.pos);let c=e.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&be.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new be(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,g,b,S)=>h=S),c.setSelection(UE(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},zn.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())&&wa(e)},20))},zn.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(),e.focused=!1)},zn.beforeinput=(e,t)=>{if(wn&&Pi&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,mc(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Kn)zn[e]=Kn[e];function Hh(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}class YE{constructor(t,n){this.toDOM=t,this.spec=n||_c,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Mr(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof YE&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Hh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Fu{constructor(t,n){this.attrs=t,this.spec=n||_c}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Mr(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Fu&&Hh(this.attrs,t.attrs)&&Hh(this.spec,t.spec)}static is(t){return t.type instanceof Fu}destroy(){}}let VOe=class NH{constructor(t,n){this.attrs=t,this.spec=n||_c}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Mr(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof NH&&Hh(this.attrs,t.attrs)&&Hh(this.spec,t.spec)}destroy(){}};class Mr{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Mr(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Mr(t,t,new YE(n,r))}static inline(t,n,r,i){return new Mr(t,n,new Fu(r,i))}static node(t,n,r,i){return new Mr(t,n,new VOe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fu}}const jf=[],_c={};class Pt{constructor(t,n){this.local=t.length?t:jf,this.children=n.length?n:jf}static create(t,n){return n.length?Mb(n,t,0,_c):En}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let u=this.children[a]+1;this.children[a+2].findInner(t-u,n-u,r,i+u,o)}}map(t,n,r){return this==En||t.maps.length==0?this:this.mapInner(t,n,0,0,r||_c)}mapInner(t,n,r,i,o){let a;for(let u=0;u<this.local.length;u++){let s=this.local[u].map(t,r,i);s&&s.type.valid(n,s)?(a||(a=[])).push(s):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?HOe(this.children,a||[],t,n,r,i,o):a?new Pt(a.sort($c),jf):En}add(t,n){return n.length?this==En?Pt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((u,s)=>{let c=s+r,l;if(l=Z3(n,u,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<s;)o+=3;i[o]==s?i[o+2]=i[o+2].addInner(u,l,c+1):i.splice(o,0,s,s+u.nodeSize,Mb(l,u,c+1,_c)),o+=3}});let a=J3(o?X3(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Pt(a.length?this.local.concat(a).sort($c):this.local,i||this.children)}remove(t){return t.length==0||this==En?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+n,s=r[o+1]+n;for(let l=0,f;l<t.length;l++)(f=t[l])&&f.from>u&&f.to<s&&(t[l]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,u+1);c!=En?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let u=0;u<i.length;u++)i[u].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Pt(i,r):En}forChild(t,n){if(this==En)return this;if(n.isLeaf)return Pt.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=t){this.children[u]==t&&(r=this.children[u+2]);break}let o=t+1,a=o+n.content.size;for(let u=0;u<this.local.length;u++){let s=this.local[u];if(s.from<a&&s.to>o&&s.type instanceof Fu){let c=Math.max(o,s.from)-o,l=Math.min(a,s.to)-o;c<l&&(i||(i=[])).push(s.copy(c,l))}}if(i){let u=new Pt(i.sort($c),jf);return r?new Nu([u,r]):u}return r||En}eq(t){if(this==t)return!0;if(!(t instanceof Pt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return JE(this.localsInner(t))}localsInner(t){if(this==En)return jf;if(t.inlineContent||!this.local.some(Fu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Fu||n.push(this.local[r]);return n}}Pt.empty=new Pt([],[]),Pt.removeOverlap=JE;const En=Pt.empty;class Nu{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,_c));return Nu.from(r)}forChild(t,n){if(n.isLeaf)return Pt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=En&&(o instanceof Nu?r=r.concat(o.members):r.push(o))}return Nu.from(r)}eq(t){if(!(t instanceof Nu)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?JE(r?n:n.sort($c)):jf}static from(t){switch(t.length){case 0:return En;case 1:return t[0];default:return new Nu(t.every(n=>n instanceof Pt)?t:t.reduce((n,r)=>n.concat(r instanceof Pt?r:r.members),[]))}}}function HOe(e,t,n,r,i,o,a){let u=e.slice();for(let c=0,l=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((d,p,h,v)=>{let g=v-h-(p-d);for(let b=0;b<u.length;b+=3){let S=u[b+1];if(S<0||d>S+l-f)continue;let O=u[b]+l-f;p>=O?u[b+1]=d<=O?-2:-1:h>=i&&g&&(u[b]+=g,u[b+1]+=g)}f+=g}),l=n.maps[c].map(l,-1)}let s=!1;for(let c=0;c<u.length;c+=3)if(u[c+1]<0){if(u[c+1]==-2){s=!0,u[c+1]=-1;continue}let l=n.map(e[c]+o),f=l-i;if(f<0||f>=r.content.size){s=!0;continue}let d=n.map(e[c+1]+o,-1),p=d-i,{index:h,offset:v}=r.content.findIndex(f),g=r.maybeChild(h);if(g&&v==f&&v+g.nodeSize==p){let b=u[c+2].mapInner(n,g,l+1,e[c]+o+1,a);b!=En?(u[c]=f,u[c+1]=p,u[c+2]=b):(u[c+1]=-2,s=!0)}else s=!0}if(s){let c=GOe(u,e,t,n,i,o,a),l=Mb(c,r,0,a);t=l.local;for(let f=0;f<u.length;f+=3)u[f+1]<0&&(u.splice(f,3),f-=3);for(let f=0,d=0;f<l.children.length;f+=3){let p=l.children[f];for(;d<u.length&&u[d]<p;)d+=3;u.splice(d,0,l.children[f],l.children[f+1],l.children[f+2])}}return new Pt(t.sort($c),u)}function J3(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 Mr(i.from+t,i.to+t,i.type))}return n}function GOe(e,t,n,r,i,o,a){function u(s,c){for(let l=0;l<s.local.length;l++){let f=s.local[l].map(r,i,c);f?n.push(f):a.onRemove&&a.onRemove(s.local[l].spec)}for(let l=0;l<s.children.length;l+=3)u(s.children[l+2],s.children[l]+c+1)}for(let s=0;s<e.length;s+=3)e[s+1]==-1&&u(e[s+2],t[s]+o+1);return n}function Z3(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function X3(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Mb(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=Z3(e,u,s+n);if(c){o=!0;let l=Mb(c,u,n+s+1,r);l!=En&&i.push(s,s+u.nodeSize,l)}});let a=J3(o?X3(e):e,-n).sort($c);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new Pt(a,i):En}function $c(e,t){return e.from-t.from||e.to-t.to}function JE(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 o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),Q3(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Q3(t,i,r.copy(o.from,r.to)));break}}}return t}function Q3(e,t,n){for(;t<e.length&&$c(n,e[t])>0;)t++;e.splice(t,0,n)}function ZE(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=En&&t.push(r)}),e.cursorWrapper&&t.push(Pt.create(e.state.doc,[e.cursorWrapper.deco])),Nu.from(t)}const YOe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},JOe=ur&&Ru<=11;class ZOe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class XOe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ZOe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);ur&&Ru<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),JOe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,YOe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);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(w3(this.view)){if(this.suppressingSelectionUpdates)return wa(this.view);if(ur&&Ru<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&hc(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=Dh(o))n.add(o);for(let o=t.anchorNode;o;o=Dh(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&w3(t)&&!this.ignoreSelectionChange(r),o=-1,a=-1,u=!1,s=[];if(t.editable)for(let l=0;l<n.length;l++){let f=this.registerMutation(n[l],s);f&&(o=o<0?f.from:Math.min(f.from,o),a=a<0?f.to:Math.max(f.to,a),f.typeOver&&(u=!0))}if(Ni&&s.length>1){let l=s.filter(f=>f.nodeName=="BR");if(l.length==2){let f=l[0],d=l[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Ib(r)&&(c=jE(t))&&c.eq(Ne.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,wa(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,a),QOe(t)),this.handleDOMChange(o,a,u,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||wa(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let l=0;l<t.addedNodes.length;l++)n.push(t.addedNodes[l]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(ur&&Ru<=11&&t.addedNodes.length)for(let l=0;l<t.addedNodes.length;l++){let{previousSibling:f,nextSibling:d}=t.addedNodes[l];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d)}let a=i&&i.parentNode==t.target?Rr(i)+1:0,u=r.localPosFromDOM(t.target,a,-1),s=o&&o.parentNode==t.target?Rr(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,s,1);return{from:u,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let e4=new WeakMap,t4=!1;function QOe(e){if(!e4.has(e)&&(e4.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ni,t4)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."),t4=!0}}function eCe(e){let t;function n(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,u=e.domAtPos(e.state.selection.anchor);return hc(u.node,u.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function tCe(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:a,to:u}=e.docView.parseRange(t,n),s=e.domSelectionRange(),c,l=s.anchorNode;if(l&&e.dom.contains(l.nodeType==1?l:l.parentNode)&&(c=[{node:l,offset:s.anchorOffset}],Ib(s)||c.push({node:s.focusNode,offset:s.focusOffset})),wn&&e.input.lastKeyCode===8)for(let g=o;g>i;g--){let b=r.childNodes[g-1],S=b.pmViewDesc;if(b.nodeName=="BR"&&!S){o=g;break}if(!S||S.size)break}let f=e.state.doc,d=e.someProp("domParser")||Cf.fromSchema(e.state.schema),p=f.resolve(a),h=null,v=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:nCe,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=g),h={anchor:g+a,head:b+a}}return{doc:v,sel:h,from:a,to:u}}function nCe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(qn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||qn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const rCe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function iCe(e,t,n,r,i){if(t<0){let R=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,U=jE(e,R);if(U&&!e.state.selection.eq(U)){if(wn&&Pi&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",N=>N(e,mc(13,"Enter"))))return;let q=e.state.tr.setSelection(U);R=="pointer"?q.setMeta("pointer",!0):R=="key"&&q.scrollIntoView(),e.composing&&q.setMeta("composition",e.input.compositionID),e.dispatch(q)}return}let o=e.state.doc.resolve(t),a=o.sharedDepth(n);t=o.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u=e.state.selection,s=tCe(e,t,n),c=e.state.doc,l=c.slice(s.from,s.to),f,d;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,d="end"):(f=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let p=uCe(l.content,s.doc.content,s.from,f,d);if((Nf&&e.input.lastIOSEnter>Date.now()-225||Pi)&&i.some(R=>R.nodeType==1&&!rCe.test(R.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",R=>R(e,mc(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&u instanceof De&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(s.sel&&s.sel.anchor!=s.sel.head))p={start:u.from,endA:u.to,endB:u.to};else{if(s.sel){let R=n4(e,e.state.doc,s.sel);if(R&&!R.eq(e.state.selection)){let U=e.state.tr.setSelection(R);e.composing&&U.setMeta("composition",e.input.compositionID),e.dispatch(U)}}return}if(wn&&e.cursorWrapper&&s.sel&&s.sel.anchor==e.cursorWrapper.deco.from&&s.sel.head==s.sel.anchor){let R=p.endB-p.start;s.sel={anchor:s.sel.anchor+R,head:s.sel.anchor+R}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof De&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=s.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=s.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),ur&&Ru<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>s.from&&s.doc.textBetween(p.start-s.from-1,p.start-s.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let h=s.doc.resolveNoCache(p.start-s.from),v=s.doc.resolveNoCache(p.endB-s.from),g=c.resolve(p.start),b=h.sameParent(v)&&h.parent.inlineContent&&g.end()>=p.endA,S;if((Nf&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!b&&h.pos<s.doc.content.size&&!h.sameParent(v)&&(S=Ne.findFrom(s.doc.resolve(h.pos+1),1,!0))&&S.head==v.pos)&&e.someProp("handleKeyDown",R=>R(e,mc(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&aCe(c,p.start,p.endA,h,v)&&e.someProp("handleKeyDown",R=>R(e,mc(8,"Backspace")))){Pi&&wn&&e.domObserver.suppressSelectionUpdates();return}wn&&Pi&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),Pi&&!b&&h.start()!=v.start()&&v.parentOffset==0&&h.depth==v.depth&&s.sel&&s.sel.anchor==s.sel.head&&s.sel.head==p.endA&&(p.endB-=2,v=s.doc.resolveNoCache(p.endB-s.from),setTimeout(()=>{e.someProp("handleKeyDown",function(R){return R(e,mc(13,"Enter"))})},20));let O=p.start,y=p.endA,C,I,M;if(b){if(h.pos==v.pos)ur&&Ru<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>wa(e),20)),C=e.state.tr.delete(O,y),I=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(M=oCe(h.parent.content.cut(h.parentOffset,v.parentOffset),g.parent.content.cut(g.parentOffset,p.endA-g.start()))))C=e.state.tr,M.type=="add"?C.addMark(O,y,M.mark):C.removeMark(O,y,M.mark);else if(h.parent.child(h.index()).isText&&h.index()==v.index()-(v.textOffset?0:1)){let R=h.parent.textBetween(h.parentOffset,v.parentOffset);if(e.someProp("handleTextInput",U=>U(e,O,y,R)))return;C=e.state.tr.insertText(R,O,y)}}if(C||(C=e.state.tr.replace(O,y,s.doc.slice(p.start-s.from,p.endB-s.from))),s.sel){let R=n4(e,C.doc,s.sel);R&&!(wn&&Pi&&e.composing&&R.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(R.head==O||R.head==C.mapping.map(y)-1)||ur&&R.empty&&R.head==O)&&C.setSelection(R)}I&&C.ensureMarks(I),e.composing&&C.setMeta("composition",e.input.compositionID),e.dispatch(C.scrollIntoView())}function n4(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:UE(e,t.resolve(n.anchor),t.resolve(n.head))}function oCe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,a,u,s;for(let l=0;l<r.length;l++)i=r[l].removeFromSet(i);for(let l=0;l<n.length;l++)o=n[l].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],a="add",s=l=>l.mark(u.addToSet(l.marks));else if(i.length==0&&o.length==1)u=o[0],a="remove",s=l=>l.mark(u.removeFromSet(l.marks));else return null;let c=[];for(let l=0;l<t.childCount;l++)c.push(s(t.child(l)));if(K.from(c).eq(e))return{mark:u,type:a}}function aCe(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||XE(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=e.resolve(XE(o,!0,!0));return!a.parent.isTextblock||a.pos>n||XE(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function XE(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 o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function uCe(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a,b:u}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let s=Math.max(0,o-Math.min(a,u));r-=a+s-o}if(a<o&&e.size<t.size){let s=r<=o&&r>=a?o-r:0;o-=s,u=o+(u-a),a=o}else if(u<o){let s=r<=o&&r>=u?o-r:0;o-=s,a=o+(a-u),u=o}return{start:o,endA:a,endB:u}}class sCe{constructor(t,n){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 wOe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(u4),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=o4(this),i4(this),this.nodeViews=a4(this),this.docView=m3(this.state.doc,r4(this),ZE(this),this.dom,this),this.domObserver=new XOe(this,(r,i,o,a)=>iCe(this,r,i,o,a)),this.domObserver.start(),EOe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&KE(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(u4),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){let r=this.state,i=!1,o=!1;t.storedMarks&&this.composing&&(G3(this),o=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let d=a4(this);lCe(d,this.nodeViews)&&(this.nodeViews=d,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&KE(this),this.editable=o4(this),i4(this);let u=ZE(this),s=r4(this),c=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=i||!this.docView.matchesNode(t.doc,s,u);(l||!t.selection.eq(r.selection))&&(o=!0);let f=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&K1e(this);if(o){this.domObserver.stop();let d=l&&(ur||wn)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&cCe(r.selection,t.selection);if(l){let p=wn?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,s,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=m3(t.doc,s,u,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&vOe(this))?wa(this,d):(O3(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&V1e(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof be){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&n3(this,n.getBoundingClientRect(),t)}else n3(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let u=this.directPlugins[a].props[t];if(u!=null&&(i=n?n(u):u))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let u=o[a].props[t];if(u!=null&&(i=n?n(u):u))return i}}hasFocus(){if(ur){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&H1e(this.dom),wa(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return X1e(this,t)}coordsAtPos(t,n=1){return s3(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return rOe(this,n||this.state,t)}pasteHTML(t,n){return Vh(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Vh(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(ROe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ZE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return xOe(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return qn&&this.root.nodeType===11&&L1e(this.dom.ownerDocument)==this.dom?eCe(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function r4(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 r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Mr.node(0,e.state.doc.content.size,t)]}function i4(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:Mr.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function o4(e){return!e.someProp("editable",t=>t(e.state)===!1)}function cCe(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 a4(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function lCe(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function u4(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Pu={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:"'"},xb={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},fCe=typeof navigator<"u"&&/Mac/.test(navigator.platform),dCe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),vn=0;vn<10;vn++)Pu[48+vn]=Pu[96+vn]=String(vn);for(var vn=1;vn<=24;vn++)Pu[vn+111]="F"+vn;for(var vn=65;vn<=90;vn++)Pu[vn]=String.fromCharCode(vn+32),xb[vn]=String.fromCharCode(vn);for(var QE in Pu)xb.hasOwnProperty(QE)||(xb[QE]=Pu[QE]);function pCe(e){var t=fCe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||dCe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?xb:Pu)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const hCe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function mCe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u++){let s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))hCe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function vCe(e){let t=Object.create(null);for(let n in e)t[mCe(n)]=e[n];return t}function eR(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 gCe(e){return new Er({props:{handleKeyDown:yCe(e)}})}function yCe(e){let t=vCe(e);return function(n,r){let i=pCe(r),o,a=t[eR(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=t[eR(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Pu[r.keyCode])&&o!=i){let u=t[eR(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const bCe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function _Ce(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const $Ce=(e,t,n)=>{let r=_Ce(e,n);if(!r)return!1;let i=s4(r);if(!i){let a=r.blockRange(),u=a&&Rf(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&f4(e,i,t))return!0;if(r.parent.content.size==0&&(Df(o,"end")||be.isSelectable(o))){let a=IE(e.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Df(o,"end")?Ne.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):be.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Df(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}const SCe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=s4(r)}let a=o&&o.nodeBefore;return!a||!be.isSelectable(a)?!1:(t&&t(e.tr.setSelection(be.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function s4(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 TCe(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const ICe=(e,t,n)=>{let r=TCe(e,n);if(!r)return!1;let i=c4(r);if(!i)return!1;let o=i.nodeAfter;if(f4(e,i,t))return!0;if(r.parent.content.size==0&&(Df(o,"start")||be.isSelectable(o))){let a=IE(e.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Df(o,"start")?Ne.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):be.create(u.doc,u.mapping.map(i.pos))),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},OCe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=c4(r)}let a=o&&o.nodeAfter;return!a||!be.isSelectable(a)?!1:(t&&t(e.tr.setSelection(be.create(e.doc,o.pos)).scrollIntoView()),!0)};function c4(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}const CCe=(e,t)=>{let n=e.selection,r=n instanceof be,i;if(r){if(n.node.isTextblock||!wu(e.doc,n.from))return!1;i=n.from}else if(i=jV(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(be.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},wCe=(e,t)=>{let n=e.selection,r;if(n instanceof be){if(n.node.isTextblock||!wu(e.doc,n.to))return!1;r=n.to}else if(r=jV(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},ECe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Rf(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},RCe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
37
+ `).scrollIntoView()),!0)};function l4(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const MCe=(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),o=n.indexAfter(-1),a=l4(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let u=n.after(),s=e.tr.replaceWith(u,u,a.createAndFill());s.setSelection(Ne.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},xCe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ai||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=l4(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=e.tr.insert(a,o.createAndFill());u.setSelection(De.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},kCe=(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 o=n.before();if(Mf(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Rf(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},ACe=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(be.create(e.doc,i))),!0)};function FCe(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||wu(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function f4(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(FCe(e,t,n))return!0;let u=t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let f=t.pos+i.nodeSize,d=K.empty;for(let v=o.length-1;v>=0;v--)d=K.from(o[v].create(null,d));d=K.from(r.copy(d));let p=e.tr.step(new Jt(t.pos-1,f,t.pos,f,new ae(d,1,0),o.length,!0)),h=f+2*o.length;wu(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let s=Ne.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&Rf(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&Df(i,"start",!0)&&Df(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=K.empty;for(let b=d.length-1;b>=0;b--)v=K.from(d[b].copy(v));let g=e.tr.step(new Jt(t.pos-d.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new ae(v,d.length,0),0,!0));n(g.scrollIntoView())}return!0}}return!1}function d4(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(De.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const NCe=d4(-1),PCe=d4(1);function WCe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&TE(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function p4(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[o];n.doc.nodesBetween(a,u,(s,c)=>{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(e,t)))if(s.type==e)i=!0;else{let l=n.doc.resolve(c),f=l.index();i=l.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[a];o.setBlockType(u,s,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function LCe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=!1,s=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let l=n.doc.resolve(a.start-2);s=new mb(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new mb(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=TE(s,e,t,a);return c?(r&&r(jCe(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function jCe(e,t,n,r,i){let o=K.empty;for(let l=n.length-1;l>=0;l--)o=K.from(n[l].type.create(n[l].attrs,o));e.step(new Jt(t.start-(r?2:0),t.end,t.start,t.end,new ae(o,0,0),n.length,!0));let a=0;for(let l=0;l<n.length;l++)n[l].type==i&&(a=l+1);let u=n.length-a,s=t.start+n.length-(r?2:0),c=t.parent;for(let l=t.startIndex,f=t.endIndex,d=!0;l<f;l++,d=!1)!d&&Mf(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function DCe(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?UCe(t,n,e,o):BCe(t,n,o):!0:!1}}function UCe(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Jt(o-1,a,o,a,new ae(K.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new mb(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=Rf(r);if(u==null)return!1;i.lift(r,u);let s=i.mapping.map(o,-1)-1;return wu(i.doc,s)&&i.join(s),t(i.scrollIntoView()),!0}function BCe(e,t,n){let r=e.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,v=n.startIndex;h>v;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,s=n.endIndex==i.childCount,c=o.node(-1),l=o.index(-1);if(!c.canReplace(l+(u?0:1),l+1,a.content.append(s?K.empty:K.from(i))))return!1;let f=o.pos,d=f+a.nodeSize;return r.step(new Jt(f-(u?1:0),d+(s?1:0),f+1,d-1,new ae((u?K.empty:K.from(i.copy(K.empty))).append(s?K.empty:K.from(i.copy(K.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function qCe(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,s=u.child(a-1);if(s.type!=e)return!1;if(n){let c=s.lastChild&&s.lastChild.type==u.type,l=K.from(c?e.create():null),f=new ae(K.from(e.create(null,K.from(u.type.create(null,l)))),c?3:1,0),d=o.start,p=o.end;n(t.tr.step(new Jt(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function kb(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Ab{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([u,s])=>[u,(...l)=>{const f=s(...l)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(!s&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),u.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,p])=>[d,(...v)=>{const g=this.buildProps(c,n),b=p(...v)(g);return u.push(b),f}])),run:l};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([s,c])=>[s,(...l)=>c(...l)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);const u={tr:t,editor:i,view:a,state:kb({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([s,c])=>[s,(...l)=>c(...l)(u)]))}};return u}}class zCe{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function ce(e,t,n){return e.config[t]===void 0&&e.parent?ce(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?ce(e.parent,t,n):null}):e.config[t]}function Fb(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function h4(e){const t=[],{nodeExtensions:n,markExtensions:r}=Fb(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=ce(a,"addGlobalAttributes",u);if(!s)return;s().forEach(l=>{l.types.forEach(f=>{Object.entries(l.attributes).forEach(([d,p])=>{t.push({type:f,name:d,attribute:{...o,...p}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=ce(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const d={...o,...f};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,t.push({type:a.name,name:l,attribute:d})})}),t}function Zt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function xt(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}i==="class"?r[i]=[r[i],o].join(" "):i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function tR(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>xt(n,r),{})}function m4(e){return typeof e=="function"}function Me(e,t=void 0,...n){return m4(e)?t?e.bind(t)(...n):e(...n):e}function KCe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function VCe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function v4(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(n):VCe(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function g4(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&KCe(n)?!1:n!=null))}function y4(e,t){var n;const r=h4(e),{nodeExtensions:i,markExtensions:o}=Fb(e),a=(n=i.find(c=>ce(c,"topNode")))===null||n===void 0?void 0:n.name,u=Object.fromEntries(i.map(c=>{const l=r.filter(b=>b.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},d=e.reduce((b,S)=>{const O=ce(S,"extendNodeSchema",f);return{...b,...O?O(c):{}}},{}),p=g4({...d,content:Me(ce(c,"content",f)),marks:Me(ce(c,"marks",f)),group:Me(ce(c,"group",f)),inline:Me(ce(c,"inline",f)),atom:Me(ce(c,"atom",f)),selectable:Me(ce(c,"selectable",f)),draggable:Me(ce(c,"draggable",f)),code:Me(ce(c,"code",f)),defining:Me(ce(c,"defining",f)),isolating:Me(ce(c,"isolating",f)),attrs:Object.fromEntries(l.map(b=>{var S;return[b.name,{default:(S=b==null?void 0:b.attribute)===null||S===void 0?void 0:S.default}]}))}),h=Me(ce(c,"parseHTML",f));h&&(p.parseDOM=h.map(b=>v4(b,l)));const v=ce(c,"renderHTML",f);v&&(p.toDOM=b=>v({node:b,HTMLAttributes:tR(b,l)}));const g=ce(c,"renderText",f);return g&&(p.toText=g),[c.name,p]})),s=Object.fromEntries(o.map(c=>{const l=r.filter(g=>g.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},d=e.reduce((g,b)=>{const S=ce(b,"extendMarkSchema",f);return{...g,...S?S(c):{}}},{}),p=g4({...d,inclusive:Me(ce(c,"inclusive",f)),excludes:Me(ce(c,"excludes",f)),group:Me(ce(c,"group",f)),spanning:Me(ce(c,"spanning",f)),code:Me(ce(c,"code",f)),attrs:Object.fromEntries(l.map(g=>{var b;return[g.name,{default:(b=g==null?void 0:g.attribute)===null||b===void 0?void 0:b.default}]}))}),h=Me(ce(c,"parseHTML",f));h&&(p.parseDOM=h.map(g=>v4(g,l)));const v=ce(c,"renderHTML",f);return v&&(p.toDOM=g=>v({mark:g,HTMLAttributes:tR(g,l)})),[c.name,p]}));return new e1e({topNode:a,nodes:u,marks:s})}function nR(e,t){return t.nodes[e]||t.marks[e]||null}function b4(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const HCe=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,u)=>{var s,c;const l=((c=(s=i.type.spec).toText)===null||c===void 0?void 0:c.call(s,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-o))}),n};function rR(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class iR{constructor(t){this.find=t.find,this.handler=t.handler}}const GCe=(e,t)=>{if(rR(t))return t.exec(e);const n=t(e);if(!n)return null;const 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 oR(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:u}=e,{view:s}=n;if(s.composing)return!1;const c=s.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(d=>d.type.spec.code))return!1;let l=!1;const f=HCe(c)+o;return a.forEach(d=>{if(l)return;const p=GCe(f,d.find);if(!p)return;const h=s.state.tr,v=kb({state:s.state,transaction:h}),g={from:r-(p[0].length-o.length),to:i},{commands:b,chain:S,can:O}=new Ab({editor:n,state:v});d.handler({state:v,range:g,match:p,commands:b,chain:S,can:O})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function YCe(e){const{editor:t,rules:n}=e,r=new Er({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return oR({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&oR({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?oR({editor:t,from:a.pos,to:a.pos,text:`
38
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function JCe(e){return typeof e=="number"}class ZCe{constructor(t){this.find=t.find,this.handler=t.handler}}const XCe=(e,t)=>{if(rR(t))return[...e.matchAll(t)];const n=t(e);return n?n.map(r=>{const i=[r.text];return i.index=r.index,i.input=e,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function QCe(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:a,chain:u,can:s}=new Ab({editor:t,state:n}),c=[];return n.doc.nodesBetween(r,i,(f,d)=>{if(!f.isTextblock||f.type.spec.code)return;const p=Math.max(r,d),h=Math.min(i,d+f.content.size),v=f.textBetween(p-d,h-d,void 0,"");XCe(v,o.find).forEach(b=>{if(b.index===void 0)return;const S=p+b.index+1,O=S+b[0].length,y={from:n.tr.mapping.map(S),to:n.tr.mapping.map(O)},C=o.handler({state:n,range:y,match:b,commands:a,chain:u,can:s});c.push(C)})}),c.every(f=>f!==null)}function ewe(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map(u=>new Er({view(s){const c=l=>{var f;r=!((f=s.dom.parentElement)===null||f===void 0)&&f.contains(l.target)?s.dom.parentElement:null};return window.addEventListener("dragstart",c),{destroy(){window.removeEventListener("dragstart",c)}}},props:{handleDOMEvents:{drop:s=>(o=r===s.dom.parentElement,!1),paste:(s,c)=>{var l;const f=(l=c.clipboardData)===null||l===void 0?void 0:l.getData("text/html");return i=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(s,c,l)=>{const f=s[0],d=f.getMeta("uiEvent")==="paste"&&!i,p=f.getMeta("uiEvent")==="drop"&&!o;if(!d&&!p)return;const h=c.doc.content.findDiffStart(l.doc.content),v=c.doc.content.findDiffEnd(l.doc.content);if(!JCe(h)||!v||h===v.b)return;const g=l.tr,b=kb({state:l,transaction:g});if(!(!QCe({editor:t,state:b,from:Math.max(h-1,0),to:v.b-1,rule:u})||!g.steps.length))return g}}))}function twe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class Sc{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=Sc.resolve(t),this.schema=y4(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:nR(r.name,this.schema)};r.type==="mark"&&(!((i=Me(ce(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=ce(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=ce(r,"onCreate",o);u&&this.editor.on("create",u);const s=ce(r,"onUpdate",o);s&&this.editor.on("update",s);const c=ce(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const l=ce(r,"onTransaction",o);l&&this.editor.on("transaction",l);const f=ce(r,"onFocus",o);f&&this.editor.on("focus",f);const d=ce(r,"onBlur",o);d&&this.editor.on("blur",d);const p=ce(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(t){const n=Sc.sort(Sc.flatten(t)),r=twe(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ce(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=ce(r,"priority")||100,a=ce(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:nR(n.name,this.schema)},i=ce(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=Sc.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:t,type:nR(a.name,this.schema)},s=[],c=ce(a,"addKeyboardShortcuts",u);let l={};if(a.type==="mark"&&a.config.exitable&&(l.ArrowRight=()=>Yh.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([g,b])=>[g,()=>b({editor:t})]));l={...l,...v}}const f=gCe(l);s.push(f);const d=ce(a,"addInputRules",u);b4(a,t.options.enableInputRules)&&d&&r.push(...d());const p=ce(a,"addPasteRules",u);b4(a,t.options.enablePasteRules)&&p&&i.push(...p());const h=ce(a,"addProseMirrorPlugins",u);if(h){const v=h();s.push(...v)}return s}).flat();return[YCe({editor:t,rules:r}),...ewe({editor:t,rules:i}),...o]}get attributes(){return h4(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=Fb(this.extensions);return Object.fromEntries(n.filter(r=>!!ce(r,"addNodeView")).map(r=>{const i=this.attributes.filter(s=>s.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:Zt(r.name,this.schema)},a=ce(r,"addNodeView",o);if(!a)return[];const u=(s,c,l,f)=>{const d=tR(s,i);return a()({editor:t,node:s,getPos:l,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,u]}))}}function nwe(e){return Object.prototype.toString.call(e).slice(8,-1)}function aR(e){return nwe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Nb(e,t){const n={...e};return aR(e)&&aR(t)&&Object.keys(t).forEach(r=>{aR(t[r])?r in e?n[r]=Nb(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class sr{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(ce(this,"addOptions",{name:this.name}))),this.storage=Me(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new sr(t)}configure(t={}){const n=this.extend();return n.options=Nb(this.options,t),n.storage=Me(ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new sr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(ce(n,"addOptions",{name:n.name})),n.storage=Me(ce(n,"addStorage",{name:n.name,options:n.options})),n}}function _4(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
39
+
40
+ `,textSerializers:a={}}=n||{};let u="",s=!0;return e.nodesBetween(r,i,(c,l,f,d)=>{var p;const h=a==null?void 0:a[c.type.name];h?(c.isBlock&&!s&&(u+=o,s=!0),f&&(u+=h({node:c,pos:l,parent:f,index:d,range:t}))):c.isText?(u+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,i-l),s=!1):c.isBlock&&!s&&(u+=o,s=!0)}),u}function $4(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const rwe=sr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Er({key:new Fi("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(l=>l.$from.pos)),u=Math.max(...o.map(l=>l.$to.pos)),s=$4(n);return _4(r,{from:a,to:u},{textSerializers:s})}}})]}}),iwe=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),owe=(e=!1)=>({commands:t})=>t.setContent("",e),awe=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(u,s)=>{if(u.type.isText)return;const{doc:c,mapping:l}=t,f=c.resolve(l.map(s)),d=c.resolve(l.map(s+u.nodeSize)),p=f.blockRange(d);if(!p)return;const h=Rf(p);if(u.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,v)}(h||h===0)&&t.lift(p,h)})}),!0},uwe=e=>t=>e(t),swe=()=>({state:e,dispatch:t})=>xCe(e,t),cwe=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const u=i.before(o),s=i.after(o);e.delete(u,s).scrollIntoView()}return!0}return!1},lwe=e=>({tr:t,state:n,dispatch:r})=>{const i=Zt(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const s=o.before(a),c=o.after(a);t.delete(s,c).scrollIntoView()}return!0}return!1},fwe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},dwe=()=>({state:e,dispatch:t})=>bCe(e,t),pwe=()=>({commands:e})=>e.keyboardShortcut("Enter"),hwe=()=>({state:e,dispatch:t})=>MCe(e,t);function Pb(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:rR(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function uR(e,t,n={}){return e.find(r=>r.type===t&&Pb(r.attrs,n))}function mwe(e,t,n={}){return!!uR(e,t,n)}function sR(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=uR([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,u=o+1,s=a+r.node.nodeSize;for(uR([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;u<e.parent.childCount&&mwe([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function Wu(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}const vwe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Wu(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=sR(s,o,t);if(f&&f.from<=c&&f.to>=l){const d=De.create(a,f.from,f.to);n.setSelection(d)}}return!0},gwe=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function cR(e){return e instanceof De}function Ea(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function S4(e,t=null){if(!t)return null;const n=Ne.atStart(e),r=Ne.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?De.create(e,Ea(0,i,o),Ea(e.content.size,i,o)):De.create(e,Ea(t,i,o),Ea(t,i,o))}function lR(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const ywe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{lR()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!cR(n.state.selection))return a(),!0;const u=S4(i.doc,e)||n.state.selection,s=n.state.selection.eq(u);return o&&(s||i.setSelection(u),s&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},bwe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),_we=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function T4(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function Wb(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)&&e.length>0?K.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Wb("",t,n)}if(typeof e=="string"){const r=Cf.fromSchema(t);return n.slice?r.parseSlice(T4(e),n.parseOptions).content:r.parse(T4(e),n.parseOptions)}return Wb("",t,n)}function $we(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Cn||i instanceof Jt))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(Ne.near(e.doc.resolve(a),n))}const Swe=e=>e.toString().startsWith("<"),Twe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const a=Wb(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:s}=typeof e=="number"?{from:e,to:e}:e,c=!0,l=!0;if((Swe(a)?a:[a]).forEach(d=>{d.check(),c=c?d.isText&&d.marks.length===0:!1,l=l?d.isBlock:!1}),u===s&&l){const{parent:d}=r.doc.resolve(u);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(u-=1,s+=1)}c?Array.isArray(t)?r.insertText(t.map(d=>d.text||"").join(""),u,s):typeof t=="object"&&t&&t.text?r.insertText(t.text,u,s):r.insertText(t,u,s):r.replaceWith(u,s,a),n.updateSelection&&$we(r,r.steps.length-1,-1)}return!0},Iwe=()=>({state:e,dispatch:t})=>CCe(e,t),Owe=()=>({state:e,dispatch:t})=>wCe(e,t),Cwe=()=>({state:e,dispatch:t})=>$Ce(e,t),wwe=()=>({state:e,dispatch:t})=>ICe(e,t);function I4(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Ewe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u+=1){const s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))lR()||I4()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${s}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const Rwe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=Ewe(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),s=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,u))});return s==null||s.steps.forEach(c=>{const l=c.map(r.mapping);l&&i&&r.maybeStep(l)}),!0};function Gh(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?Zt(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const p=Math.max(r,d),h=Math.min(i,d+f.nodeSize);u.push({node:f,from:p,to:h})});const s=i-r,c=u.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Pb(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=s}const Mwe=(e,t={})=>({state:n,dispatch:r})=>{const i=Zt(e,n.schema);return Gh(n,i,t)?ECe(n,r):!1},xwe=()=>({state:e,dispatch:t})=>kCe(e,t),kwe=e=>({state:t,dispatch:n})=>{const r=Zt(e,t.schema);return DCe(r)(t,n)},Awe=()=>({state:e,dispatch:t})=>RCe(e,t);function Lb(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function O4(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const Fwe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=Lb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=Zt(e,r.schema)),u==="mark"&&(a=Wu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{r.doc.nodesBetween(s.$from.pos,s.$to.pos,(c,l)=>{o&&o===c.type&&n.setNodeMarkup(l,void 0,O4(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(O4(f.attrs,t)))})})}),!0):!1},Nwe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Pwe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),Wwe=()=>({state:e,dispatch:t})=>SCe(e,t),Lwe=()=>({state:e,dispatch:t})=>OCe(e,t),jwe=()=>({state:e,dispatch:t})=>ACe(e,t),Dwe=()=>({state:e,dispatch:t})=>PCe(e,t),Uwe=()=>({state:e,dispatch:t})=>NCe(e,t);function C4(e,t,n={}){return Wb(e,t,{slice:!1,parseOptions:n})}const Bwe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=C4(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function qwe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function zwe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function fR(e){return t=>zwe(t.$from,e)}function Kwe(e,t){const n=go.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function Vwe(e,t){const n=Sc.resolve(e);return y4(n,t)}function Hwe(e,t){const n={from:0,to:e.content.size};return _4(e,n,t)}function jb(e,t){const n=Wu(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,s=>{a.push(...s.marks)});const u=a.find(s=>s.type.name===n.name);return u?{...u.attrs}:{}}function Gwe(e,t){const n=Zt(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function Ywe(e,t){const n=Lb(typeof t=="string"?t:t.name,e.schema);return n==="node"?Gwe(e,t):n==="mark"?jb(e,t):{}}function w4(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=sR(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function Db(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function dR(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Wu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Pb(f.attrs,n,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,h=d.pos;e.doc.nodesBetween(p,h,(v,g)=>{if(!v.isText&&!v.marks.length)return;const b=Math.max(p,g),S=Math.min(h,g+v.nodeSize),O=S-b;a+=O,u.push(...v.marks.map(y=>({mark:y,from:b,to:S})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Pb(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(s>0?s+c:s)>=a}function Jwe(e,t,n={}){if(!t)return Gh(e,null,n)||dR(e,null,n);const r=Lb(t,e.schema);return r==="node"?Gh(e,t,n):r==="mark"?dR(e,t,n):!1}function E4(e,t){const{nodeExtensions:n}=Fb(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Me(ce(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Zwe(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function Xwe(e){return e instanceof be}function Qwe(e,t,n){const i=e.state.doc.content.size,o=Ea(t,0,i),a=Ea(n,0,i),u=e.coordsAtPos(o),s=e.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p=d-f,h=l-c,b={top:c,bottom:l,left:f,right:d,width:p,height:h,x:f,y:c};return{...b,toJSON:()=>b}}function eEe(e,t,n){var r;const{selection:i}=t;let o=null;if(cR(i)&&(o=i.$cursor),o){const u=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(u)||!u.some(s=>s.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:u,$to:s})=>{let c=u.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(u.pos,s.pos,(l,f,d)=>{if(c)return!1;if(l.isInline){const p=!d||d.type.allowsMarkType(n),h=!!n.isInSet(l.marks)||!l.marks.some(v=>v.type.excludes(n));c=p&&h}return!c}),c})}const tEe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=Wu(e,r.schema);if(i)if(a){const c=jb(r,s);n.addStoredMark(s.create({...c,...t}))}else u.forEach(c=>{const l=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(l,f,(d,p)=>{const h=Math.max(p,l),v=Math.min(p+d.nodeSize,f);d.marks.find(b=>b.type===s)?d.marks.forEach(b=>{s===b.type&&n.addMark(h,v,s.create({...b.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return eEe(r,n,s)},nEe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),rEe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Zt(e,n.schema);return o.isTextblock?i().command(({commands:a})=>p4(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>p4(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},iEe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Ea(e,0,r.content.size),o=be.create(r,i);t.setSelection(o)}return!0},oEe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=De.atStart(r).from,u=De.atEnd(r).to,s=Ea(i,a,u),c=Ea(o,a,u),l=De.create(r,s,c);t.setSelection(l)}return!0},aEe=e=>({state:t,dispatch:n})=>{const r=Zt(e,t.schema);return qCe(r)(t,n)};function R4(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const uEe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:u,$to:s}=o,c=i.extensionManager.attributes,l=Db(c,u.node().type.name,u.node().attrs);if(o instanceof be&&o.node.isBlock)return!u.parentOffset||!Mf(a,u.pos)?!1:(r&&(e&&R4(n,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const f=s.parentOffset===s.parent.content.size;o instanceof De&&t.deleteSelection();const d=u.depth===0?void 0:qwe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&d?[{type:d,attrs:l}]:void 0,h=Mf(t.doc,t.mapping.map(u.pos),1,p);if(!p&&!h&&Mf(t.doc,t.mapping.map(u.pos),1,d?[{type:d}]:void 0)&&(h=!0,p=d?[{type:d,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,p),d&&!f&&!u.parentOffset&&u.parent.type!==d)){const v=t.mapping.map(u.before()),g=t.doc.resolve(v);u.node(-1).canReplaceWith(g.index(),g.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}e&&R4(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},sEe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=Zt(e,n.schema),{$from:u,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(s))return!1;const l=u.node(-1);if(l.type!==a)return!1;const f=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let g=K.empty;const b=u.index(-1)?1:u.index(-2)?2:3;for(let M=u.depth-b;M>=u.depth-3;M-=1)g=K.from(u.node(M).copy(g));const S=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,O=Db(f,u.node().type.name,u.node().attrs),y=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(O))||void 0;g=g.append(K.from(a.createAndFill(null,y)||void 0));const C=u.before(u.depth-(b-1));t.replace(C,u.after(-S),new ae(g,4-b,0));let I=-1;t.doc.nodesBetween(C,t.doc.content.size,(M,R)=>{if(I>-1)return!1;M.isTextblock&&M.content.size===0&&(I=R+1)}),I>-1&&t.setSelection(De.near(t.doc.resolve(I))),t.scrollIntoView()}return!0}const d=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,p=Db(f,l.type.name,l.attrs),h=Db(f,u.node().type.name,u.node().attrs);t.delete(u.pos,s.pos);const v=d?[{type:a,attrs:p},{type:d,attrs:h}]:[{type:a,attrs:p}];if(!Mf(t.doc,u.pos,2))return!1;if(r){const{selection:g,storedMarks:b}=n,{splittableMarks:S}=i.extensionManager,O=b||g.$to.parentOffset&&g.$from.marks();if(t.split(u.pos,2,v).scrollIntoView(),!O||!r)return!0;const y=O.filter(C=>S.includes(C.type.name));t.ensureMarks(y)}return!0},pR=(e,t)=>{const n=fR(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&wu(e.doc,n.pos)&&e.join(n.pos),!0},hR=(e,t)=>{const n=fR(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&wu(e.doc,r)&&e.join(r),!0};var cEe=Object.freeze({__proto__:null,blur:iwe,clearContent:owe,clearNodes:awe,command:uwe,createParagraphNear:swe,deleteCurrentNode:cwe,deleteNode:lwe,deleteRange:fwe,deleteSelection:dwe,enter:pwe,exitCode:hwe,extendMarkRange:vwe,first:gwe,focus:ywe,forEach:bwe,insertContent:_we,insertContentAt:Twe,joinUp:Iwe,joinDown:Owe,joinBackward:Cwe,joinForward:wwe,keyboardShortcut:Rwe,lift:Mwe,liftEmptyBlock:xwe,liftListItem:kwe,newlineInCode:Awe,resetAttributes:Fwe,scrollIntoView:Nwe,selectAll:Pwe,selectNodeBackward:Wwe,selectNodeForward:Lwe,selectParentNode:jwe,selectTextblockEnd:Dwe,selectTextblockStart:Uwe,setContent:Bwe,setMark:tEe,setMeta:nEe,setNode:rEe,setNodeSelection:iEe,setTextSelection:oEe,sinkListItem:aEe,splitBlock:uEe,splitListItem:sEe,toggleList:(e,t,n,r={})=>({editor:i,tr:o,state:a,dispatch:u,chain:s,commands:c,can:l})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,p=Zt(e,a.schema),h=Zt(t,a.schema),{selection:v,storedMarks:g}=a,{$from:b,$to:S}=v,O=b.blockRange(S),y=g||v.$to.parentOffset&&v.$from.marks();if(!O)return!1;const C=fR(I=>E4(I.type.name,f))(v);if(O.depth>=1&&C&&O.depth-C.depth<=1){if(C.node.type===p)return c.liftListItem(h);if(E4(C.node.type.name,f)&&p.validContent(C.node.content)&&u)return s().command(()=>(o.setNodeMarkup(C.pos,p),!0)).command(()=>pR(o,p)).command(()=>hR(o,p)).run()}return!n||!y||!u?s().command(()=>l().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>pR(o,p)).command(()=>hR(o,p)).run():s().command(()=>{const I=l().wrapInList(p,r),M=y.filter(R=>d.includes(R.type.name));return o.ensureMarks(M),I?!0:c.clearNodes()}).wrapInList(p,r).command(()=>pR(o,p)).command(()=>hR(o,p)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Wu(e,r.schema);return dR(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=Zt(e,r.schema),a=Zt(t,r.schema);return Gh(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=Zt(e,n.schema);return Gh(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,u=o.transform;for(let s=u.steps.length-1;s>=0;s-=1)a.step(u.steps[s].invert(u.docs[s]));if(o.text){const s=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,s))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=Wu(e,r.schema),{$from:c,empty:l,ranges:f}=u;if(!i)return!0;if(l&&a){let{from:d,to:p}=u;const h=(o=c.marks().find(g=>g.type===s))===null||o===void 0?void 0:o.attrs,v=sR(c,s,h);v&&(d=v.from,p=v.to),n.removeMark(d,p,s)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,s)});return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=Lb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=Zt(e,r.schema)),u==="mark"&&(a=Wu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{const c=s.$from.pos,l=s.$to.pos;r.doc.nodesBetween(c,l,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(p=>{if(a===p.type){const h=Math.max(d,c),v=Math.min(d+f.nodeSize,l);n.addMark(h,v,a.create({...p.attrs,...t}))}})})}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:r})=>{const i=Zt(e,n.schema);return WCe(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{const i=Zt(e,n.schema);return LCe(i,t)(n,r)}});const lEe=sr.create({name:"commands",addCommands(){return{...cEe}}}),fEe=sr.create({name:"editable",addProseMirrorPlugins(){return[new Er({key:new Fi("editable"),props:{editable:()=>this.editor.options.editable}})]}}),dEe=sr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Er({key:new Fi("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),pEe=sr.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:s,doc:c}=u,{empty:l,$anchor:f}=s,{pos:d,parent:p}=f,h=Ne.atStart(c).from===d;return!l||!h||!p.type.isTextblock||p.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.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()},i={...r},o={...r,"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 lR()||I4()?o:i},addProseMirrorPlugins(){return[new Er({key:new Fi("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(h=>h.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:a}=t.selection,u=Ne.atStart(t.doc).from,s=Ne.atEnd(t.doc).to;if(i||!(o===u&&a===s)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,d=kb({state:n,transaction:f}),{commands:p}=new Ab({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),hEe=sr.create({name:"tabindex",addProseMirrorPlugins(){return[new Er({key:new Fi("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var mEe=Object.freeze({__proto__:null,ClipboardTextSerializer:rwe,Commands:lEe,Editable:fEe,FocusEvents:dEe,Keymap:pEe,Tabindex:hEe});const vEe=`.ProseMirror {
41
41
  position: relative;
42
42
  }
43
43
 
@@ -111,38 +111,34 @@ img.ProseMirror-separator {
111
111
 
112
112
  .tippy-box[data-animation=fade][data-state=hidden] {
113
113
  opacity: 0
114
- }`;function swe(e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}let cwe=class extends F1e{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),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),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=swe(uwe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=u5(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(t){if(this.isDestroyed)return;const n=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(awe):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new pc(n,this)}createCommandManager(){this.commandManager=new $b({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=y5(this.options.content,this.schema,this.options.parseOptions),n=h5(t,this.options.autofocus);this.view=new XIe(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Sf.create({doc:t,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(a=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(a)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return DOe(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,i=typeof t=="string"?n:t;return qOe(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return POe(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
114
+ }`;function gEe(e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}let yEe=class extends zCe{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),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),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=gEe(vEe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=m4(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(t){if(this.isDestroyed)return;const n=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(mEe):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Sc(n,this)}createCommandManager(){this.commandManager=new Ab({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=C4(this.options.content,this.schema,this.options.parseOptions),n=S4(t,this.options.autofocus);this.view=new sCe(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Ff.create({doc:t,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(a=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(a)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return Ywe(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,i=typeof t=="string"?n:t;return Jwe(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Kwe(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
115
115
 
116
- `,textSerializers:r={}}=t||{};return jOe(this.state.doc,{blockSeparator:n,textSerializers:{...r,...p5(this.schema)}})}get isEmpty(){return UOe(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}};function Rb(e){return new WE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(_5(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function VE(e){return new WE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Fe(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,o)}})}function O5(e){return new WE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),u=o.doc.resolve(n.from).blockRange(),s=u&&eE(u,e.type,i);if(!s)return null;o.wrap(u,s);const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&yu(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&o.join(n.from-1)}})}let HE=class KR{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Fe(fe(this,"addOptions",{name:this.name}))),this.storage=Fe(fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new KR(t)}configure(t={}){const n=this.extend();return n.options=Ib(this.options,t),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new KR(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Fe(fe(n,"addOptions",{name:n.name})),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const s=a.find(c=>(c==null?void 0:c.type.name)===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class Jr{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Fe(fe(this,"addOptions",{name:this.name}))),this.storage=Fe(fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Jr(t)}configure(t={}){const n=this.extend();return n.options=Ib(this.options,t),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Jr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Fe(fe(n,"addOptions",{name:n.name})),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}}function Mb(e){return new U1e({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(_5(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function lwe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var cr="top",Zr="bottom",Xr="right",lr="left",xb="auto",Dh=[cr,Zr,Xr,lr],Rf="start",qh="end",fwe="clippingParents",w5="viewport",Uh="popper",dwe="reference",C5=Dh.reduce(function(e,t){return e.concat([t+"-"+Rf,t+"-"+qh])},[]),E5=[].concat(Dh,[xb]).reduce(function(e,t){return e.concat([t,t+"-"+Rf,t+"-"+qh])},[]),pwe="beforeRead",hwe="read",mwe="afterRead",vwe="beforeMain",gwe="main",ywe="afterMain",bwe="beforeWrite",_we="write",Swe="afterWrite",GE=[pwe,hwe,mwe,vwe,gwe,ywe,bwe,_we,Swe];function go(e){return e?(e.nodeName||"").toLowerCase():null}function Qr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function hc(e){var t=Qr(e).Element;return e instanceof t||e instanceof Element}function Mr(e){var t=Qr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function YE(e){if(typeof ShadowRoot>"u")return!1;var t=Qr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $we(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Mr(o)||!go(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function Twe(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(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=a.reduce(function(s,c){return s[c]="",s},{});!Mr(i)||!go(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const R5={name:"applyStyles",enabled:!0,phase:"write",fn:$we,effect:Twe,requires:["computeStyles"]};function Wi(e){return e.split("-")[0]}var mc=Math.max,kb=Math.min,Mf=Math.round;function JE(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function M5(){return!/^((?!chrome|android).)*safari/i.test(JE())}function xf(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Mr(e)&&(i=e.offsetWidth>0&&Mf(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Mf(r.height)/e.offsetHeight||1);var a=hc(e)?Qr(e):window,u=a.visualViewport,s=!M5()&&n,c=(r.left+(s&&u?u.offsetLeft:0))/i,l=(r.top+(s&&u?u.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function ZE(e){var t=xf(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 x5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&YE(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ji(e){return Qr(e).getComputedStyle(e)}function Iwe(e){return["table","td","th"].indexOf(go(e))>=0}function Mu(e){return((hc(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ab(e){return go(e)==="html"?e:e.assignedSlot||e.parentNode||(YE(e)?e.host:null)||Mu(e)}function k5(e){return!Mr(e)||ji(e).position==="fixed"?null:e.offsetParent}function Owe(e){var t=/firefox/i.test(JE()),n=/Trident/i.test(JE());if(n&&Mr(e)){var r=ji(e);if(r.position==="fixed")return null}var i=Ab(e);for(YE(i)&&(i=i.host);Mr(i)&&["html","body"].indexOf(go(i))<0;){var o=ji(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Bh(e){for(var t=Qr(e),n=k5(e);n&&Iwe(n)&&ji(n).position==="static";)n=k5(n);return n&&(go(n)==="html"||go(n)==="body"&&ji(n).position==="static")?t:n||Owe(e)||t}function XE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function zh(e,t,n){return mc(e,kb(t,n))}function wwe(e,t,n){var r=zh(e,t,n);return r>n?n:r}function A5(){return{top:0,right:0,bottom:0,left:0}}function N5(e){return Object.assign({},A5(),e)}function F5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Cwe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,N5(typeof t!="number"?t:F5(t,Dh))};function Ewe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=Wi(n.placement),s=XE(u),c=[lr,Xr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=Cwe(i.padding,n),d=ZE(o),p=s==="y"?cr:lr,h=s==="y"?Zr:Xr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],m=a[s]-n.rects.reference[s],_=Bh(o),g=_?s==="y"?_.clientHeight||0:_.clientWidth||0:0,S=v/2-m/2,b=f[p],$=g-d[l]-f[h],T=g/2-d[l]/2+S,M=zh(b,T,$),R=s;n.modifiersData[r]=(t={},t[R]=M,t.centerOffset=M-T,t)}}function Rwe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;if(i!=null&&!(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i))){if(process.env.NODE_ENV!=="production"&&(Mr(i)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!x5(t.elements.popper,i)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}t.elements.arrow=i}}const Mwe={name:"arrow",enabled:!0,phase:"main",fn:Ewe,effect:Rwe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function kf(e){return e.split("-")[1]}var xwe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function kwe(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Mf(t*i)/i||0,y:Mf(n*i)/i||0}}function P5(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,u=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,f=e.isFixed,d=a.x,p=d===void 0?0:d,h=a.y,v=h===void 0?0:h,m=typeof l=="function"?l({x:p,y:v}):{x:p,y:v};p=m.x,v=m.y;var _=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),S=lr,b=cr,$=window;if(c){var T=Bh(n),M="clientHeight",R="clientWidth";if(T===Qr(n)&&(T=Mu(n),ji(T).position!=="static"&&u==="absolute"&&(M="scrollHeight",R="scrollWidth")),T=T,i===cr||(i===lr||i===Xr)&&o===qh){b=Zr;var q=f&&T===$&&$.visualViewport?$.visualViewport.height:T[M];v-=q-r.height,v*=s?1:-1}if(i===lr||(i===cr||i===Zr)&&o===qh){S=Xr;var Y=f&&T===$&&$.visualViewport?$.visualViewport.width:T[R];p-=Y-r.width,p*=s?1:-1}}var N=Object.assign({position:u},c&&xwe),Z=l===!0?kwe({x:p,y:v}):{x:p,y:v};if(p=Z.x,v=Z.y,s){var ie;return Object.assign({},N,(ie={},ie[b]=g?"0":"",ie[S]=_?"0":"",ie.transform=($.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",ie))}return Object.assign({},N,(t={},t[b]=g?v+"px":"",t[S]=_?p+"px":"",t.transform="",t))}function Awe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,s=u===void 0?!0:u;if(process.env.NODE_ENV!=="production"){var c=ji(t.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some(function(f){return c.indexOf(f)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
117
-
118
- `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
119
-
120
- `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var l={placement:Wi(t.placement),variation:kf(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,P5(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,P5(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Nwe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Awe,data:{}};var Nb={passive:!0};function Fwe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,s=Qr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,Nb)}),u&&s.addEventListener("resize",n.update,Nb),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,Nb)}),u&&s.removeEventListener("resize",n.update,Nb)}}const Pwe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Fwe,data:{}};var Wwe={left:"right",right:"left",bottom:"top",top:"bottom"};function Fb(e){return e.replace(/left|right|bottom|top/g,function(t){return Wwe[t]})}var jwe={start:"end",end:"start"};function W5(e){return e.replace(/start|end/g,function(t){return jwe[t]})}function QE(e){var t=Qr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function eR(e){return xf(Mu(e)).left+QE(e).scrollLeft}function Lwe(e,t){var n=Qr(e),r=Mu(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=M5();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+eR(e),y:s}}function Dwe(e){var t,n=Mu(e),r=QE(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=mc(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=mc(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+eR(e),s=-r.scrollTop;return ji(i||n).direction==="rtl"&&(u+=mc(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function tR(e){var t=ji(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function j5(e){return["html","body","#document"].indexOf(go(e))>=0?e.ownerDocument.body:Mr(e)&&tR(e)?e:j5(Ab(e))}function Kh(e,t){var n;t===void 0&&(t=[]);var r=j5(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Qr(r),a=i?[o].concat(o.visualViewport||[],tR(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Kh(Ab(a)))}function nR(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function qwe(e,t){var n=xf(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=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 L5(e,t,n){return t===w5?nR(Lwe(e,n)):hc(t)?qwe(t,n):nR(Dwe(Mu(e)))}function Uwe(e){var t=Kh(Ab(e)),n=["absolute","fixed"].indexOf(ji(e).position)>=0,r=n&&Mr(e)?Bh(e):e;return hc(r)?t.filter(function(i){return hc(i)&&x5(i,r)&&go(i)!=="body"}):[]}function Bwe(e,t,n,r){var i=t==="clippingParents"?Uwe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=L5(e,c,r);return s.top=mc(l.top,s.top),s.right=kb(l.right,s.right),s.bottom=kb(l.bottom,s.bottom),s.left=mc(l.left,s.left),s},L5(e,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function D5(e){var t=e.reference,n=e.element,r=e.placement,i=r?Wi(r):null,o=r?kf(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case cr:s={x:a,y:t.y-n.height};break;case Zr:s={x:a,y:t.y+t.height};break;case Xr:s={x:t.x+t.width,y:u};break;case lr:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?XE(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case Rf:s[c]=s[c]-(t[l]/2-n[l]/2);break;case qh:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function Vh(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,u=n.boundary,s=u===void 0?fwe:u,c=n.rootBoundary,l=c===void 0?w5:c,f=n.elementContext,d=f===void 0?Uh:f,p=n.altBoundary,h=p===void 0?!1:p,v=n.padding,m=v===void 0?0:v,_=N5(typeof m!="number"?m:F5(m,Dh)),g=d===Uh?dwe:Uh,S=e.rects.popper,b=e.elements[h?g:d],$=Bwe(hc(b)?b:b.contextElement||Mu(e.elements.popper),s,l,a),T=xf(e.elements.reference),M=D5({reference:T,element:S,strategy:"absolute",placement:i}),R=nR(Object.assign({},S,M)),q=d===Uh?R:T,Y={top:$.top-q.top+_.top,bottom:q.bottom-$.bottom+_.bottom,left:$.left-q.left+_.left,right:q.right-$.right+_.right},N=e.modifiersData.offset;if(d===Uh&&N){var Z=N[i];Object.keys(Y).forEach(function(ie){var J=[Xr,Zr].indexOf(ie)>=0?1:-1,ye=[cr,Zr].indexOf(ie)>=0?"y":"x";Y[ie]+=Z[ye]*J})}return Y}function zwe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,s=n.allowedAutoPlacements,c=s===void 0?E5:s,l=kf(r),f=l?u?C5:C5.filter(function(h){return kf(h)===l}):Dh,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=d.reduce(function(h,v){return h[v]=Vh(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[Wi(v)],h},{});return Object.keys(p).sort(function(h,v){return p[h]-p[v]})}function Kwe(e){if(Wi(e)===xb)return[];var t=Fb(e);return[W5(e),t,W5(t)]}function Vwe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,s=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,v=n.allowedAutoPlacements,m=t.options.placement,_=Wi(m),g=_===m,S=s||(g||!h?[Fb(m)]:Kwe(m)),b=[m].concat(S).reduce(function(te,xe){return te.concat(Wi(xe)===xb?zwe(t,{placement:xe,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):xe)},[]),$=t.rects.reference,T=t.rects.popper,M=new Map,R=!0,q=b[0],Y=0;Y<b.length;Y++){var N=b[Y],Z=Wi(N),ie=kf(N)===Rf,J=[cr,Zr].indexOf(Z)>=0,ye=J?"width":"height",we=Vh(t,{placement:N,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),x=J?ie?Xr:lr:ie?Zr:cr;$[ye]>T[ye]&&(x=Fb(x));var k=Fb(x),E=[];if(o&&E.push(we[Z]<=0),u&&E.push(we[x]<=0,we[k]<=0),E.every(function(te){return te})){q=N,R=!1;break}M.set(N,E)}if(R)for(var O=h?3:1,F=function(xe){var ce=b.find(function(Ne){var ze=M.get(Ne);if(ze)return ze.slice(0,xe).every(function(He){return He})});if(ce)return q=ce,"break"},j=O;j>0;j--){var X=F(j);if(X==="break")break}t.placement!==q&&(t.modifiersData[r]._skip=!0,t.placement=q,t.reset=!0)}}const Hwe={name:"flip",enabled:!0,phase:"main",fn:Vwe,requiresIfExists:["offset"],data:{_skip:!1}};function q5(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 U5(e){return[cr,Xr,Zr,lr].some(function(t){return e[t]>=0})}function Gwe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Vh(t,{elementContext:"reference"}),u=Vh(t,{altBoundary:!0}),s=q5(a,r),c=q5(u,i,o),l=U5(s),f=U5(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}const Ywe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Gwe};function Jwe(e,t,n){var r=Wi(e),i=[lr,cr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[lr,Xr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function Zwe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=E5.reduce(function(l,f){return l[f]=Jwe(f,t.rects,o),l},{}),u=a[t.placement],s=u.x,c=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const Xwe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Zwe};function Qwe(e){var t=e.state,n=e.name;t.modifiersData[n]=D5({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const eCe={name:"popperOffsets",enabled:!0,phase:"read",fn:Qwe,data:{}};function tCe(e){return e==="x"?"y":"x"}function nCe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,s=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,v=h===void 0?0:h,m=Vh(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),_=Wi(t.placement),g=kf(t.placement),S=!g,b=XE(_),$=tCe(b),T=t.modifiersData.popperOffsets,M=t.rects.reference,R=t.rects.popper,q=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,Y=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Z={x:0,y:0};if(T){if(o){var ie,J=b==="y"?cr:lr,ye=b==="y"?Zr:Xr,we=b==="y"?"height":"width",x=T[b],k=x+m[J],E=x-m[ye],O=p?-R[we]/2:0,F=g===Rf?M[we]:R[we],j=g===Rf?-R[we]:-M[we],X=t.elements.arrow,te=p&&X?ZE(X):{width:0,height:0},xe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:A5(),ce=xe[J],Ne=xe[ye],ze=zh(0,M[we],te[we]),He=S?M[we]/2-O-ze-ce-Y.mainAxis:F-ze-ce-Y.mainAxis,it=S?-M[we]/2+O+ze+Ne+Y.mainAxis:j+ze+Ne+Y.mainAxis,Ft=t.elements.arrow&&Bh(t.elements.arrow),qt=Ft?b==="y"?Ft.clientTop||0:Ft.clientLeft||0:0,Ht=(ie=N==null?void 0:N[b])!=null?ie:0,xn=x+He-Ht-qt,Nr=x+it-Ht,fr=zh(p?kb(k,xn):k,x,p?mc(E,Nr):E);T[b]=fr,Z[b]=fr-x}if(u){var Q,re=b==="x"?cr:lr,ke=b==="x"?Zr:Xr,Ot=T[$],ei=$==="y"?"height":"width",Ui=Ot+m[re],Bi=Ot-m[ke],wa=[cr,lr].indexOf(_)!==-1,Ca=(Q=N==null?void 0:N[$])!=null?Q:0,Ea=wa?Ui:Ot-M[ei]-R[ei]-Ca+Y.altAxis,ti=wa?Ot+M[ei]+R[ei]-Ca-Y.altAxis:Bi,ju=p&&wa?wwe(Ea,Ot,ti):zh(p?Ea:Ui,Ot,p?ti:Bi);T[$]=ju,Z[$]=ju-Ot}t.modifiersData[r]=Z}}const rCe={name:"preventOverflow",enabled:!0,phase:"main",fn:nCe,requiresIfExists:["offset"]};function iCe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function oCe(e){return e===Qr(e)||!Mr(e)?QE(e):iCe(e)}function aCe(e){var t=e.getBoundingClientRect(),n=Mf(t.width)/e.offsetWidth||1,r=Mf(t.height)/e.offsetHeight||1;return n!==1||r!==1}function uCe(e,t,n){n===void 0&&(n=!1);var r=Mr(t),i=Mr(t)&&aCe(t),o=Mu(t),a=xf(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((go(t)!=="body"||tR(o))&&(u=oCe(t)),Mr(t)?(s=xf(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=eR(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function sCe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var s=t.get(u);s&&i(s)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function cCe(e){var t=sCe(e);return GE.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function lCe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function xu(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(i,o){return i.replace(/%s/,o)},e)}var vc='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',fCe='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',B5=["name","enabled","phase","fn","effect","requires","options"];function dCe(e){e.forEach(function(t){[].concat(Object.keys(t),B5).filter(function(n,r,i){return i.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(xu(vc,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(xu(vc,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":GE.indexOf(t.phase)<0&&console.error(xu(vc,t.name,'"phase"',"either "+GE.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(xu(vc,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(xu(vc,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(xu(vc,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(xu(vc,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+B5.map(function(r){return'"'+r+'"'}).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach(function(r){e.find(function(i){return i.name===r})==null&&console.error(xu(fCe,String(t.name),r,r))})})})}function pCe(e,t){var n=new Set;return e.filter(function(r){var i=t(r);if(!n.has(i))return n.add(i),!0})}function hCe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var z5="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",mCe="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",K5={placement:"bottom",modifiers:[],strategy:"absolute"};function V5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function vCe(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?K5:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},K5,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],d=!1,p={state:l,setOptions:function(_){var g=typeof _=="function"?_(l.options):_;v(),l.options=Object.assign({},o,l.options,g),l.scrollParents={reference:hc(u)?Kh(u):u.contextElement?Kh(u.contextElement):[],popper:Kh(s)};var S=cCe(hCe([].concat(r,l.options.modifiers)));if(l.orderedModifiers=S.filter(function(N){return N.enabled}),process.env.NODE_ENV!=="production"){var b=pCe([].concat(S,l.options.modifiers),function(N){var Z=N.name;return Z});if(dCe(b),Wi(l.options.placement)===xb){var $=l.orderedModifiers.find(function(N){var Z=N.name;return Z==="flip"});$||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var T=ji(s),M=T.marginTop,R=T.marginRight,q=T.marginBottom,Y=T.marginLeft;[M,R,q,Y].some(function(N){return parseFloat(N)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return h(),p.update()},forceUpdate:function(){if(!d){var _=l.elements,g=_.reference,S=_.popper;if(!V5(g,S)){process.env.NODE_ENV!=="production"&&console.error(z5);return}l.rects={reference:uCe(g,Bh(S),l.options.strategy==="fixed"),popper:ZE(S)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(N){return l.modifiersData[N.name]=Object.assign({},N.data)});for(var b=0,$=0;$<l.orderedModifiers.length;$++){if(process.env.NODE_ENV!=="production"&&(b+=1,b>100)){console.error(mCe);break}if(l.reset===!0){l.reset=!1,$=-1;continue}var T=l.orderedModifiers[$],M=T.fn,R=T.options,q=R===void 0?{}:R,Y=T.name;typeof M=="function"&&(l=M({state:l,options:q,name:Y,instance:p})||l)}}},update:lCe(function(){return new Promise(function(m){p.forceUpdate(),m(l)})}),destroy:function(){v(),d=!0}};if(!V5(u,s))return process.env.NODE_ENV!=="production"&&console.error(z5),p;p.setOptions(c).then(function(m){!d&&c.onFirstUpdate&&c.onFirstUpdate(m)});function h(){l.orderedModifiers.forEach(function(m){var _=m.name,g=m.options,S=g===void 0?{}:g,b=m.effect;if(typeof b=="function"){var $=b({state:l,name:_,instance:p,options:S}),T=function(){};f.push($||T)}})}function v(){f.forEach(function(m){return m()}),f=[]}return p}}var gCe=[Pwe,eCe,Nwe,R5,Xwe,Hwe,rCe,Mwe,Ywe],yCe=vCe({defaultModifiers:gCe}),bCe="tippy-box",H5="tippy-content",_Ce="tippy-backdrop",G5="tippy-arrow",Y5="tippy-svg-arrow",gc={passive:!0,capture:!0},J5=function(){return document.body};function SCe(e,t){return{}.hasOwnProperty.call(e,t)}function rR(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function iR(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Z5(e,t){return typeof e=="function"?e.apply(void 0,t):e}function X5(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function $Ce(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function TCe(e){return e.split(/\s+/).filter(Boolean)}function Af(e){return[].concat(e)}function Q5(e,t){e.indexOf(t)===-1&&e.push(t)}function ICe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function OCe(e){return e.split("-")[0]}function Pb(e){return[].slice.call(e)}function eH(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Hh(){return document.createElement("div")}function Gh(e){return["Element","Fragment"].some(function(t){return iR(e,t)})}function wCe(e){return iR(e,"NodeList")}function CCe(e){return iR(e,"MouseEvent")}function ECe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function RCe(e){return Gh(e)?[e]:wCe(e)?Pb(e):Array.isArray(e)?e:Pb(document.querySelectorAll(e))}function oR(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function tH(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function MCe(e){var t,n=Af(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function xCe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,u=i.props,s=u.interactiveBorder,c=OCe(a.placement),l=a.modifiersData.offset;if(!l)return!0;var f=c==="bottom"?l.top.y:0,d=c==="top"?l.bottom.y:0,p=c==="right"?l.left.x:0,h=c==="left"?l.right.x:0,v=o.top-r+f>s,m=r-o.bottom-d>s,_=o.left-n+p>s,g=n-o.right-h>s;return v||m||_||g})}function aR(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function nH(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var yo={isTouch:!1},rH=0;function kCe(){yo.isTouch||(yo.isTouch=!0,window.performance&&document.addEventListener("mousemove",iH))}function iH(){var e=performance.now();e-rH<20&&(yo.isTouch=!1,document.removeEventListener("mousemove",iH)),rH=e}function ACe(){var e=document.activeElement;if(ECe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function NCe(){document.addEventListener("touchstart",kCe,gc),window.addEventListener("blur",ACe)}var FCe=typeof window<"u"&&typeof document<"u",PCe=FCe?!!window.msCrypto:!1;function Nf(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function oH(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function WCe(e){return oH(`
116
+ `,textSerializers:r={}}=t||{};return Hwe(this.state.doc,{blockSeparator:n,textSerializers:{...$4(this.schema),...r}})}get isEmpty(){return Zwe(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}};function Ub(e){return new iR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Me(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(w4(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function mR(e){return new iR({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Me(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,o)}})}function Bb(e){return new iR({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=Me(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),s=a.doc.resolve(n.from).blockRange(),c=s&&TE(s,e.type,o);if(!c)return null;if(a.wrap(s,c),e.keepMarks&&e.editor){const{selection:f,storedMarks:d}=t,{splittableMarks:p}=e.editor.extensionManager,h=d||f.$to.parentOffset&&f.$from.marks();if(h){const v=h.filter(g=>p.includes(g.type.name));a.ensureMarks(v)}}if(e.keepAttributes){const f=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const l=a.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&wu(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&a.join(n.from-1)}})}let Yh=class hM{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(ce(this,"addOptions",{name:this.name}))),this.storage=Me(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new hM(t)}configure(t={}){const n=this.extend();return n.options=Nb(this.options,t),n.storage=Me(ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new hM(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(ce(n,"addOptions",{name:n.name})),n.storage=Me(ce(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const s=a.find(c=>(c==null?void 0:c.type.name)===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class cr{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Me(ce(this,"addOptions",{name:this.name}))),this.storage=Me(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new cr(t)}configure(t={}){const n=this.extend();return n.options=Nb(this.options,t),n.storage=Me(ce(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new cr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Me(ce(n,"addOptions",{name:n.name})),n.storage=Me(ce(n,"addStorage",{name:n.name,options:n.options})),n}}function qb(e){return new ZCe({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Me(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(w4(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function bEe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var zb=200,Xt=function(){};Xt.prototype.append=function(t){return t.length?(t=Xt.from(t),!this.length&&t||t.length<zb&&this.leafAppend(t)||this.length<zb&&t.leafPrepend(this)||this.appendInner(t)):this},Xt.prototype.prepend=function(t){return t.length?Xt.from(t).append(this):this},Xt.prototype.appendInner=function(t){return new _Ee(this,t)},Xt.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Xt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},Xt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Xt.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},Xt.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i},Xt.from=function(t){return t instanceof Xt?t:t&&t.length?new M4(t):Xt.empty};var M4=function(e){function t(r){e.call(this),this.values=r}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(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,u){for(var s=o;s<a;s++)if(i(this.values[s],u+s)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,u){for(var s=o-1;s>=a;s--)if(i(this.values[s],u+s)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=zb)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=zb)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Xt);Xt.empty=new M4([]);var _Ee=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),a)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,a+u)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,a+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Xt);const $Ee=500;class Wi{constructor(t,n){this.items=t,this.eventCount=n}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,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,u,s,c=[],l=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,l.push(f);return}if(i){l.push(new So(f.map));let p=f.step.map(i.slice(o)),h;p&&a.maybeStep(p).doc&&(h=a.mapping.maps[a.mapping.maps.length-1],c.push(new So(h,void 0,void 0,c.length+l.length))),o--,h&&i.appendMap(h,o)}else a.maybeStep(f.step);if(f.selection)return u=i?f.selection.map(i.slice(o)):f.selection,s=new Wi(this.items.slice(0,r).append(l.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:u}}addTransform(t,n,r,i){let o=[],a=this.eventCount,u=this.items,s=!i&&u.length?u.get(u.length-1):null;for(let l=0;l<t.steps.length;l++){let f=t.steps[l].invert(t.docs[l]),d=new So(t.mapping.maps[l],f,n),p;(p=s&&s.merge(d))&&(d=p,l?o.pop():u=u.slice(0,u.length-1)),o.push(d),n&&(a++,n=void 0),i||(s=d)}let c=a-r.depth;return c>TEe&&(u=SEe(u,c),a-=c),new Wi(u.append(o),a)}remapping(t,n){let r=new wf;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new Wi(this.items.append(t.map(n=>new So(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,u=this.eventCount;this.items.forEach(d=>{d.selection&&u--},i);let s=n;this.items.forEach(d=>{let p=o.getMirror(--s);if(p==null)return;a=Math.min(a,p);let h=o.maps[p];if(d.step){let v=t.steps[p].invert(t.docs[p]),g=d.selection&&d.selection.map(o.slice(s+1,p));g&&u++,r.push(new So(h,v,g))}else r.push(new So(h))},i);let c=[];for(let d=n;d<a;d++)c.push(new So(o.maps[d]));let l=this.items.slice(0,i).append(c).append(r),f=new Wi(l,u);return f.emptyItemCount()>$Ee&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=t)i.push(a),a.selection&&o++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let l=a.selection&&a.selection.map(n.slice(r));l&&o++;let f=new So(c.invert(),s,l),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else a.map&&r--},this.items.length,0),new Wi(Xt.from(i.reverse()),o)}}Wi.empty=new Wi(Xt.empty,0);function SEe(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class So{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new So(n.getMap().invert(),n,this.selection)}}}class Lu{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const TEe=20;function IEe(e,t,n,r){let i=n.getMeta(ju),o;if(i)return i.historyState;n.getMeta(CEe)&&(e=new Lu(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(ju))return a.getMeta(ju).redo?new Lu(e.done.addTransform(n,void 0,r,Kb(t)),e.undone,x4(n.mapping.maps[n.steps.length-1]),e.prevTime,e.prevComposition):new Lu(e.done,e.undone.addTransform(n,void 0,r,Kb(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=n.getMeta("composition"),s=e.prevTime==0||!a&&e.prevComposition!=u&&(e.prevTime<(n.time||0)-r.newGroupDelay||!OEe(n,e.prevRanges)),c=a?vR(e.prevRanges,n.mapping):x4(n.mapping.maps[n.steps.length-1]);return new Lu(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,Kb(t)),Wi.empty,c,n.time,u??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Lu(e.done.rebased(n,o),e.undone.rebased(n,o),vR(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Lu(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),vR(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function OEe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function x4(e){let t=[];return e.forEach((n,r,i,o)=>t.push(i,o)),t}function vR(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function k4(e,t,n,r){let i=Kb(t),o=ju.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,i);if(!a)return;let u=a.selection.resolve(a.transform.doc),s=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),o,i),c=new Lu(r?s:a.remaining,r?a.remaining:s,null,0,-1);n(a.transform.setSelection(u).setMeta(ju,{redo:r,historyState:c}).scrollIntoView())}let gR=!1,A4=null;function Kb(e){let t=e.plugins;if(A4!=t){gR=!1,A4=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){gR=!0;break}}return gR}const ju=new Fi("history"),CEe=new Fi("closeHistory");function wEe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Er({key:ju,state:{init(){return new Lu(Wi.empty,Wi.empty,null,0,-1)},apply(t,n,r){return IEe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?F4:r=="historyRedo"?N4:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}const F4=(e,t)=>{let n=ju.getState(e);return!n||n.done.eventCount==0?!1:(t&&k4(n,e,t,!1),!0)},N4=(e,t)=>{let n=ju.getState(e);return!n||n.undone.eventCount==0?!1:(t&&k4(n,e,t,!0),!0)},EEe=sr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>F4(e,t),redo:()=>({state:e,dispatch:t})=>N4(e,t)}},addProseMirrorPlugins(){return[wEe(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}});var lr="top",Xr="bottom",Qr="right",fr="left",yR="auto",Jh=[lr,Xr,Qr,fr],Uf="start",Zh="end",REe="clippingParents",P4="viewport",Xh="popper",MEe="reference",W4=Jh.reduce(function(e,t){return e.concat([t+"-"+Uf,t+"-"+Zh])},[]),L4=[].concat(Jh,[yR]).reduce(function(e,t){return e.concat([t,t+"-"+Uf,t+"-"+Zh])},[]),xEe="beforeRead",kEe="read",AEe="afterRead",FEe="beforeMain",NEe="main",PEe="afterMain",WEe="beforeWrite",LEe="write",jEe="afterWrite",DEe=[xEe,kEe,AEe,FEe,NEe,PEe,WEe,LEe,jEe];function To(e){return e?(e.nodeName||"").toLowerCase():null}function xr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Tc(e){var t=xr(e).Element;return e instanceof t||e instanceof Element}function ei(e){var t=xr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function bR(e){if(typeof ShadowRoot>"u")return!1;var t=xr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function UEe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!ei(o)||!To(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function BEe(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(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=a.reduce(function(s,c){return s[c]="",s},{});!ei(i)||!To(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const j4={name:"applyStyles",enabled:!0,phase:"write",fn:UEe,effect:BEe,requires:["computeStyles"]};function Io(e){return e.split("-")[0]}var Ic=Math.max,Vb=Math.min,Bf=Math.round;function _R(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function D4(){return!/^((?!chrome|android).)*safari/i.test(_R())}function qf(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&ei(e)&&(i=e.offsetWidth>0&&Bf(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Bf(r.height)/e.offsetHeight||1);var a=Tc(e)?xr(e):window,u=a.visualViewport,s=!D4()&&n,c=(r.left+(s&&u?u.offsetLeft:0))/i,l=(r.top+(s&&u?u.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function $R(e){var t=qf(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 U4(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&bR(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ra(e){return xr(e).getComputedStyle(e)}function qEe(e){return["table","td","th"].indexOf(To(e))>=0}function Du(e){return((Tc(e)?e.ownerDocument:e.document)||window.document).documentElement}function Hb(e){return To(e)==="html"?e:e.assignedSlot||e.parentNode||(bR(e)?e.host:null)||Du(e)}function B4(e){return!ei(e)||Ra(e).position==="fixed"?null:e.offsetParent}function zEe(e){var t=/firefox/i.test(_R()),n=/Trident/i.test(_R());if(n&&ei(e)){var r=Ra(e);if(r.position==="fixed")return null}var i=Hb(e);for(bR(i)&&(i=i.host);ei(i)&&["html","body"].indexOf(To(i))<0;){var o=Ra(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Qh(e){for(var t=xr(e),n=B4(e);n&&qEe(n)&&Ra(n).position==="static";)n=B4(n);return n&&(To(n)==="html"||To(n)==="body"&&Ra(n).position==="static")?t:n||zEe(e)||t}function SR(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function em(e,t,n){return Ic(e,Vb(t,n))}function KEe(e,t,n){var r=em(e,t,n);return r>n?n:r}function q4(){return{top:0,right:0,bottom:0,left:0}}function z4(e){return Object.assign({},q4(),e)}function K4(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var VEe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,z4(typeof t!="number"?t:K4(t,Jh))};function HEe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=Io(n.placement),s=SR(u),c=[fr,Qr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=VEe(i.padding,n),d=$R(o),p=s==="y"?lr:fr,h=s==="y"?Xr:Qr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],g=a[s]-n.rects.reference[s],b=Qh(o),S=b?s==="y"?b.clientHeight||0:b.clientWidth||0:0,O=v/2-g/2,y=f[p],C=S-d[l]-f[h],I=S/2-d[l]/2+O,M=em(y,I,C),R=s;n.modifiersData[r]=(t={},t[R]=M,t.centerOffset=M-I,t)}}function GEe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||U4(t.elements.popper,i)&&(t.elements.arrow=i))}const YEe={name:"arrow",enabled:!0,phase:"main",fn:HEe,effect:GEe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function zf(e){return e.split("-")[1]}var JEe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ZEe(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Bf(n*i)/i||0,y:Bf(r*i)/i||0}}function V4(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,u=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,f=e.isFixed,d=a.x,p=d===void 0?0:d,h=a.y,v=h===void 0?0:h,g=typeof l=="function"?l({x:p,y:v}):{x:p,y:v};p=g.x,v=g.y;var b=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),O=fr,y=lr,C=window;if(c){var I=Qh(n),M="clientHeight",R="clientWidth";if(I===xr(n)&&(I=Du(n),Ra(I).position!=="static"&&u==="absolute"&&(M="scrollHeight",R="scrollWidth")),I=I,i===lr||(i===fr||i===Qr)&&o===Zh){y=Xr;var U=f&&I===C&&C.visualViewport?C.visualViewport.height:I[M];v-=U-r.height,v*=s?1:-1}if(i===fr||(i===lr||i===Xr)&&o===Zh){O=Qr;var q=f&&I===C&&C.visualViewport?C.visualViewport.width:I[R];p-=q-r.width,p*=s?1:-1}}var N=Object.assign({position:u},c&&JEe),Z=l===!0?ZEe({x:p,y:v},xr(n)):{x:p,y:v};if(p=Z.x,v=Z.y,s){var ee;return Object.assign({},N,(ee={},ee[y]=S?"0":"",ee[O]=b?"0":"",ee.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",ee))}return Object.assign({},N,(t={},t[y]=S?v+"px":"",t[O]=b?p+"px":"",t.transform="",t))}function XEe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,s=u===void 0?!0:u,c={placement:Io(t.placement),variation:zf(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,V4(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,V4(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const QEe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:XEe,data:{}};var Gb={passive:!0};function eRe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,s=xr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,Gb)}),u&&s.addEventListener("resize",n.update,Gb),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,Gb)}),u&&s.removeEventListener("resize",n.update,Gb)}}const tRe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:eRe,data:{}};var nRe={left:"right",right:"left",bottom:"top",top:"bottom"};function Yb(e){return e.replace(/left|right|bottom|top/g,function(t){return nRe[t]})}var rRe={start:"end",end:"start"};function H4(e){return e.replace(/start|end/g,function(t){return rRe[t]})}function TR(e){var t=xr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function IR(e){return qf(Du(e)).left+TR(e).scrollLeft}function iRe(e,t){var n=xr(e),r=Du(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=D4();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+IR(e),y:s}}function oRe(e){var t,n=Du(e),r=TR(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Ic(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Ic(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+IR(e),s=-r.scrollTop;return Ra(i||n).direction==="rtl"&&(u+=Ic(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function OR(e){var t=Ra(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function G4(e){return["html","body","#document"].indexOf(To(e))>=0?e.ownerDocument.body:ei(e)&&OR(e)?e:G4(Hb(e))}function tm(e,t){var n;t===void 0&&(t=[]);var r=G4(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=xr(r),a=i?[o].concat(o.visualViewport||[],OR(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(tm(Hb(a)))}function CR(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function aRe(e,t){var n=qf(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=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 Y4(e,t,n){return t===P4?CR(iRe(e,n)):Tc(t)?aRe(t,n):CR(oRe(Du(e)))}function uRe(e){var t=tm(Hb(e)),n=["absolute","fixed"].indexOf(Ra(e).position)>=0,r=n&&ei(e)?Qh(e):e;return Tc(r)?t.filter(function(i){return Tc(i)&&U4(i,r)&&To(i)!=="body"}):[]}function sRe(e,t,n,r){var i=t==="clippingParents"?uRe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=Y4(e,c,r);return s.top=Ic(l.top,s.top),s.right=Vb(l.right,s.right),s.bottom=Vb(l.bottom,s.bottom),s.left=Ic(l.left,s.left),s},Y4(e,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function J4(e){var t=e.reference,n=e.element,r=e.placement,i=r?Io(r):null,o=r?zf(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case lr:s={x:a,y:t.y-n.height};break;case Xr:s={x:a,y:t.y+t.height};break;case Qr:s={x:t.x+t.width,y:u};break;case fr:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?SR(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case Uf:s[c]=s[c]-(t[l]/2-n[l]/2);break;case Zh:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function nm(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,u=n.boundary,s=u===void 0?REe:u,c=n.rootBoundary,l=c===void 0?P4:c,f=n.elementContext,d=f===void 0?Xh:f,p=n.altBoundary,h=p===void 0?!1:p,v=n.padding,g=v===void 0?0:v,b=z4(typeof g!="number"?g:K4(g,Jh)),S=d===Xh?MEe:Xh,O=e.rects.popper,y=e.elements[h?S:d],C=sRe(Tc(y)?y:y.contextElement||Du(e.elements.popper),s,l,a),I=qf(e.elements.reference),M=J4({reference:I,element:O,strategy:"absolute",placement:i}),R=CR(Object.assign({},O,M)),U=d===Xh?R:I,q={top:C.top-U.top+b.top,bottom:U.bottom-C.bottom+b.bottom,left:C.left-U.left+b.left,right:U.right-C.right+b.right},N=e.modifiersData.offset;if(d===Xh&&N){var Z=N[i];Object.keys(q).forEach(function(ee){var J=[Qr,Xr].indexOf(ee)>=0?1:-1,ve=[lr,Xr].indexOf(ee)>=0?"y":"x";q[ee]+=Z[ve]*J})}return q}function cRe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,s=n.allowedAutoPlacements,c=s===void 0?L4:s,l=zf(r),f=l?u?W4:W4.filter(function(h){return zf(h)===l}):Jh,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f);var p=d.reduce(function(h,v){return h[v]=nm(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[Io(v)],h},{});return Object.keys(p).sort(function(h,v){return p[h]-p[v]})}function lRe(e){if(Io(e)===yR)return[];var t=Yb(e);return[H4(e),t,H4(t)]}function fRe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,s=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,v=n.allowedAutoPlacements,g=t.options.placement,b=Io(g),S=b===g,O=s||(S||!h?[Yb(g)]:lRe(g)),y=[g].concat(O).reduce(function(ne,xe){return ne.concat(Io(xe)===yR?cRe(t,{placement:xe,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):xe)},[]),C=t.rects.reference,I=t.rects.popper,M=new Map,R=!0,U=y[0],q=0;q<y.length;q++){var N=y[q],Z=Io(N),ee=zf(N)===Uf,J=[lr,Xr].indexOf(Z)>=0,ve=J?"width":"height",Ie=nm(t,{placement:N,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),k=J?ee?Qr:fr:ee?Xr:lr;C[ve]>I[ve]&&(k=Yb(k));var A=Yb(k),T=[];if(o&&T.push(Ie[Z]<=0),u&&T.push(Ie[k]<=0,Ie[A]<=0),T.every(function(ne){return ne})){U=N,R=!1;break}M.set(N,T)}if(R)for(var $=h?3:1,x=function(xe){var se=y.find(function(Ae){var ze=M.get(Ae);if(ze)return ze.slice(0,xe).every(function(He){return He})});if(se)return U=se,"break"},L=$;L>0;L--){var X=x(L);if(X==="break")break}t.placement!==U&&(t.modifiersData[r]._skip=!0,t.placement=U,t.reset=!0)}}const dRe={name:"flip",enabled:!0,phase:"main",fn:fRe,requiresIfExists:["offset"],data:{_skip:!1}};function Z4(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 X4(e){return[lr,Qr,Xr,fr].some(function(t){return e[t]>=0})}function pRe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=nm(t,{elementContext:"reference"}),u=nm(t,{altBoundary:!0}),s=Z4(a,r),c=Z4(u,i,o),l=X4(s),f=X4(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}const hRe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:pRe};function mRe(e,t,n){var r=Io(e),i=[fr,lr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[fr,Qr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function vRe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=L4.reduce(function(l,f){return l[f]=mRe(f,t.rects,o),l},{}),u=a[t.placement],s=u.x,c=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const gRe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:vRe};function yRe(e){var t=e.state,n=e.name;t.modifiersData[n]=J4({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const bRe={name:"popperOffsets",enabled:!0,phase:"read",fn:yRe,data:{}};function _Re(e){return e==="x"?"y":"x"}function $Re(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,s=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,v=h===void 0?0:h,g=nm(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),b=Io(t.placement),S=zf(t.placement),O=!S,y=SR(b),C=_Re(y),I=t.modifiersData.popperOffsets,M=t.rects.reference,R=t.rects.popper,U=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,q=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Z={x:0,y:0};if(I){if(o){var ee,J=y==="y"?lr:fr,ve=y==="y"?Xr:Qr,Ie=y==="y"?"height":"width",k=I[y],A=k+g[J],T=k-g[ve],$=p?-R[Ie]/2:0,x=S===Uf?M[Ie]:R[Ie],L=S===Uf?-R[Ie]:-M[Ie],X=t.elements.arrow,ne=p&&X?$R(X):{width:0,height:0},xe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:q4(),se=xe[J],Ae=xe[ve],ze=em(0,M[Ie],ne[Ie]),He=O?M[Ie]/2-$-ze-se-q.mainAxis:x-ze-se-q.mainAxis,ut=O?-M[Ie]/2+$+ze+Ae+q.mainAxis:L+ze+Ae+q.mainAxis,Ut=t.elements.arrow&&Qh(t.elements.arrow),Qt=Ut?y==="y"?Ut.clientTop||0:Ut.clientLeft||0:0,gn=(ee=N==null?void 0:N[y])!=null?ee:0,dr=k+He-gn-Qt,Ui=k+ut-gn,ti=em(p?Vb(A,dr):A,k,p?Ic(T,Ui):T);I[y]=ti,Z[y]=ti-k}if(u){var Ro,Fa=y==="x"?lr:fr,Bi=y==="x"?Xr:Qr,pr=I[C],ni=C==="y"?"height":"width",qi=pr+g[Fa],zi=pr-g[Bi],Na=[lr,fr].indexOf(b)!==-1,Pa=(Ro=N==null?void 0:N[C])!=null?Ro:0,Wa=Na?qi:pr-M[ni]-R[ni]-Pa+q.altAxis,ri=Na?pr+M[ni]+R[ni]-Pa-q.altAxis:zi,Hu=p&&Na?KEe(Wa,pr,ri):em(p?Wa:qi,pr,p?ri:zi);I[C]=Hu,Z[C]=Hu-pr}t.modifiersData[r]=Z}}const SRe={name:"preventOverflow",enabled:!0,phase:"main",fn:$Re,requiresIfExists:["offset"]};function TRe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function IRe(e){return e===xr(e)||!ei(e)?TR(e):TRe(e)}function ORe(e){var t=e.getBoundingClientRect(),n=Bf(t.width)/e.offsetWidth||1,r=Bf(t.height)/e.offsetHeight||1;return n!==1||r!==1}function CRe(e,t,n){n===void 0&&(n=!1);var r=ei(t),i=ei(t)&&ORe(t),o=Du(t),a=qf(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((To(t)!=="body"||OR(o))&&(u=IRe(t)),ei(t)?(s=qf(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=IR(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function wRe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var s=t.get(u);s&&i(s)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function ERe(e){var t=wRe(e);return DEe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function RRe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function MRe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Q4={placement:"bottom",modifiers:[],strategy:"absolute"};function e5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function xRe(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?Q4:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},Q4,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],d=!1,p={state:l,setOptions:function(b){var S=typeof b=="function"?b(l.options):b;v(),l.options=Object.assign({},o,l.options,S),l.scrollParents={reference:Tc(u)?tm(u):u.contextElement?tm(u.contextElement):[],popper:tm(s)};var O=ERe(MRe([].concat(r,l.options.modifiers)));return l.orderedModifiers=O.filter(function(y){return y.enabled}),h(),p.update()},forceUpdate:function(){if(!d){var b=l.elements,S=b.reference,O=b.popper;if(e5(S,O)){l.rects={reference:CRe(S,Qh(O),l.options.strategy==="fixed"),popper:$R(O)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(q){return l.modifiersData[q.name]=Object.assign({},q.data)});for(var y=0;y<l.orderedModifiers.length;y++){if(l.reset===!0){l.reset=!1,y=-1;continue}var C=l.orderedModifiers[y],I=C.fn,M=C.options,R=M===void 0?{}:M,U=C.name;typeof I=="function"&&(l=I({state:l,options:R,name:U,instance:p})||l)}}}},update:RRe(function(){return new Promise(function(g){p.forceUpdate(),g(l)})}),destroy:function(){v(),d=!0}};if(!e5(u,s))return p;p.setOptions(c).then(function(g){!d&&c.onFirstUpdate&&c.onFirstUpdate(g)});function h(){l.orderedModifiers.forEach(function(g){var b=g.name,S=g.options,O=S===void 0?{}:S,y=g.effect;if(typeof y=="function"){var C=y({state:l,name:b,instance:p,options:O}),I=function(){};f.push(C||I)}})}function v(){f.forEach(function(g){return g()}),f=[]}return p}}var kRe=[tRe,bRe,QEe,j4,gRe,dRe,SRe,YEe,hRe],ARe=xRe({defaultModifiers:kRe}),FRe="tippy-box",t5="tippy-content",NRe="tippy-backdrop",n5="tippy-arrow",r5="tippy-svg-arrow",Oc={passive:!0,capture:!0},i5=function(){return document.body};function PRe(e,t){return{}.hasOwnProperty.call(e,t)}function wR(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function ER(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function o5(e,t){return typeof e=="function"?e.apply(void 0,t):e}function a5(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function WRe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function LRe(e){return e.split(/\s+/).filter(Boolean)}function Kf(e){return[].concat(e)}function u5(e,t){e.indexOf(t)===-1&&e.push(t)}function jRe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function DRe(e){return e.split("-")[0]}function Jb(e){return[].slice.call(e)}function s5(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function rm(){return document.createElement("div")}function im(e){return["Element","Fragment"].some(function(t){return ER(e,t)})}function URe(e){return ER(e,"NodeList")}function BRe(e){return ER(e,"MouseEvent")}function qRe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function zRe(e){return im(e)?[e]:URe(e)?Jb(e):Array.isArray(e)?e:Jb(document.querySelectorAll(e))}function RR(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function c5(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function KRe(e){var t,n=Kf(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function VRe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,u=i.props,s=u.interactiveBorder,c=DRe(a.placement),l=a.modifiersData.offset;if(!l)return!0;var f=c==="bottom"?l.top.y:0,d=c==="top"?l.bottom.y:0,p=c==="right"?l.left.x:0,h=c==="left"?l.right.x:0,v=o.top-r+f>s,g=r-o.bottom-d>s,b=o.left-n+p>s,S=n-o.right-h>s;return v||g||b||S})}function MR(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function l5(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Oo={isTouch:!1},f5=0;function HRe(){Oo.isTouch||(Oo.isTouch=!0,window.performance&&document.addEventListener("mousemove",d5))}function d5(){var e=performance.now();e-f5<20&&(Oo.isTouch=!1,document.removeEventListener("mousemove",d5)),f5=e}function GRe(){var e=document.activeElement;if(qRe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function YRe(){document.addEventListener("touchstart",HRe,Oc),window.addEventListener("blur",GRe)}var JRe=typeof window<"u"&&typeof document<"u",ZRe=JRe?!!window.msCrypto:!1;function Vf(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function p5(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function XRe(e){return p5(`
121
117
  %ctippy.js
122
118
 
123
- %c`+oH(e)+`
119
+ %c`+p5(e)+`
124
120
 
125
121
  %c👷‍ This is a development-only message. It will be removed in production.
126
- `)}function aH(e){return[WCe(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Yh;process.env.NODE_ENV!=="production"&&jCe();function jCe(){Yh=new Set}function Ta(e,t){if(e&&!Yh.has(t)){var n;Yh.add(t),(n=console).warn.apply(n,aH(t))}}function uR(e,t){if(e&&!Yh.has(t)){var n;Yh.add(t),(n=console).error.apply(n,aH(t))}}function LCe(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;uR(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),uR(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var uH={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},DCe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},xr=Object.assign({appendTo:J5,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},uH,DCe),qCe=Object.keys(xr),UCe=function(t){process.env.NODE_ENV!=="production"&&lH(t,[]);var n=Object.keys(t);n.forEach(function(r){xr[r]=t[r]})};function sH(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=xr[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function BCe(e,t){var n=t?Object.keys(sH(Object.assign({},xr,{plugins:t}))):qCe,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function cH(e,t){var n=Object.assign({},t,{content:Z5(t.content,[e])},t.ignoreAttributes?{}:BCe(e,t.plugins));return n.aria=Object.assign({},xr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function lH(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=$Ce(xr,Object.keys(uH)),o=!SCe(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),Ta(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
122
+ `)}function h5(e){return[XRe(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var om;process.env.NODE_ENV!=="production"&&QRe();function QRe(){om=new Set}function Ma(e,t){if(e&&!om.has(t)){var n;om.add(t),(n=console).warn.apply(n,h5(t))}}function xR(e,t){if(e&&!om.has(t)){var n;om.add(t),(n=console).error.apply(n,h5(t))}}function eMe(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;xR(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),xR(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var m5={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tMe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},kr=Object.assign({appendTo:i5,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},m5,tMe),nMe=Object.keys(kr),rMe=function(t){process.env.NODE_ENV!=="production"&&y5(t,[]);var n=Object.keys(t);n.forEach(function(r){kr[r]=t[r]})};function v5(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=kr[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function iMe(e,t){var n=t?Object.keys(v5(Object.assign({},kr,{plugins:t}))):nMe,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function g5(e,t){var n=Object.assign({},t,{content:o5(t.content,[e])},t.ignoreAttributes?{}:iMe(e,t.plugins));return n.aria=Object.assign({},kr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function y5(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=WRe(kr,Object.keys(m5)),o=!PRe(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),Ma(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
127
123
 
128
124
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
129
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var zCe=function(){return"innerHTML"};function sR(e,t){e[zCe()]=t}function fH(e){var t=Hh();return e===!0?t.className=G5:(t.className=Y5,Gh(e)?t.appendChild(e):sR(t,e)),t}function dH(e,t){Gh(t.content)?(sR(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?sR(e,t.content):e.textContent=t.content)}function cR(e){var t=e.firstElementChild,n=Pb(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(H5)}),arrow:n.find(function(r){return r.classList.contains(G5)||r.classList.contains(Y5)}),backdrop:n.find(function(r){return r.classList.contains(_Ce)})}}function pH(e){var t=Hh(),n=Hh();n.className=bCe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Hh();r.className=H5,r.setAttribute("data-state","hidden"),dH(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=cR(t),s=u.box,c=u.content,l=u.arrow;a.theme?s.setAttribute("data-theme",a.theme):s.removeAttribute("data-theme"),typeof a.animation=="string"?s.setAttribute("data-animation",a.animation):s.removeAttribute("data-animation"),a.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?s.setAttribute("role",a.role):s.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&dH(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(s.removeChild(l),s.appendChild(fH(a.arrow))):s.appendChild(fH(a.arrow)):l&&s.removeChild(l)}return{popper:t,onUpdate:i}}pH.$$tippy=!0;var KCe=1,Wb=[],lR=[];function VCe(e,t){var n=cH(e,Object.assign({},xr,sH(eH(t)))),r,i,o,a=!1,u=!1,s=!1,c=!1,l,f,d,p=[],h=X5(xn,n.interactiveDebounce),v,m=KCe++,_=null,g=ICe(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:m,reference:e,popper:Hh(),popperInstance:_,props:n,state:S,plugins:g,clearDelayTimeouts:Ea,setProps:ti,setContent:ju,show:Df,hide:P,hideWithInteractivity:A,enable:wa,disable:Ca,unmount:L,destroy:Pe};if(!n.render)return process.env.NODE_ENV!=="production"&&uR(!0,"render() function has not been supplied."),b;var $=n.render(b),T=$.popper,M=$.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+b.id,b.popper=T,e._tippy=b,T._tippy=b;var R=g.map(function(W){return W.fn(b)}),q=e.hasAttribute("aria-expanded");return Ft(),O(),x(),k("onCreate",[b]),n.showOnCreate&&Ui(),T.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",h)}),b;function Y(){var W=b.props.touch;return Array.isArray(W)?W:[W,0]}function N(){return Y()[0]==="hold"}function Z(){var W;return!!((W=b.props.render)!=null&&W.$$tippy)}function ie(){return v||e}function J(){var W=ie().parentNode;return W?MCe(W):document}function ye(){return cR(T)}function we(W){return b.state.isMounted&&!b.state.isVisible||yo.isTouch||l&&l.type==="focus"?0:rR(b.props.delay,W?0:1,xr.delay)}function x(W){W===void 0&&(W=!1),T.style.pointerEvents=b.props.interactive&&!W?"":"none",T.style.zIndex=""+b.props.zIndex}function k(W,ae,ge){if(ge===void 0&&(ge=!0),R.forEach(function(Ce){Ce[W]&&Ce[W].apply(Ce,ae)}),ge){var ve;(ve=b.props)[W].apply(ve,ae)}}function E(){var W=b.props.aria;if(W.content){var ae="aria-"+W.content,ge=T.id,ve=Af(b.props.triggerTarget||e);ve.forEach(function(Ce){var ct=Ce.getAttribute(ae);if(b.state.isVisible)Ce.setAttribute(ae,ct?ct+" "+ge:ge);else{var Hn=ct&&ct.replace(ge,"").trim();Hn?Ce.setAttribute(ae,Hn):Ce.removeAttribute(ae)}})}}function O(){if(!(q||!b.props.aria.expanded)){var W=Af(b.props.triggerTarget||e);W.forEach(function(ae){b.props.interactive?ae.setAttribute("aria-expanded",b.state.isVisible&&ae===ie()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function F(){J().removeEventListener("mousemove",h),Wb=Wb.filter(function(W){return W!==h})}function j(W){if(!(yo.isTouch&&(s||W.type==="mousedown"))){var ae=W.composedPath&&W.composedPath()[0]||W.target;if(!(b.props.interactive&&nH(T,ae))){if(Af(b.props.triggerTarget||e).some(function(ge){return nH(ge,ae)})){if(yo.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else k("onClickOutside",[b,W]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),u=!0,setTimeout(function(){u=!1}),b.state.isMounted||ce())}}}function X(){s=!0}function te(){s=!1}function xe(){var W=J();W.addEventListener("mousedown",j,!0),W.addEventListener("touchend",j,gc),W.addEventListener("touchstart",te,gc),W.addEventListener("touchmove",X,gc)}function ce(){var W=J();W.removeEventListener("mousedown",j,!0),W.removeEventListener("touchend",j,gc),W.removeEventListener("touchstart",te,gc),W.removeEventListener("touchmove",X,gc)}function Ne(W,ae){He(W,function(){!b.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&ae()})}function ze(W,ae){He(W,ae)}function He(W,ae){var ge=ye().box;function ve(Ce){Ce.target===ge&&(aR(ge,"remove",ve),ae())}if(W===0)return ae();aR(ge,"remove",f),aR(ge,"add",ve),f=ve}function it(W,ae,ge){ge===void 0&&(ge=!1);var ve=Af(b.props.triggerTarget||e);ve.forEach(function(Ce){Ce.addEventListener(W,ae,ge),p.push({node:Ce,eventType:W,handler:ae,options:ge})})}function Ft(){N()&&(it("touchstart",Ht,{passive:!0}),it("touchend",Nr,{passive:!0})),TCe(b.props.trigger).forEach(function(W){if(W!=="manual")switch(it(W,Ht),W){case"mouseenter":it("mouseleave",Nr);break;case"focus":it(PCe?"focusout":"blur",fr);break;case"focusin":it("focusout",fr);break}})}function qt(){p.forEach(function(W){var ae=W.node,ge=W.eventType,ve=W.handler,Ce=W.options;ae.removeEventListener(ge,ve,Ce)}),p=[]}function Ht(W){var ae,ge=!1;if(!(!b.state.isEnabled||Q(W)||u)){var ve=((ae=l)==null?void 0:ae.type)==="focus";l=W,v=W.currentTarget,O(),!b.state.isVisible&&CCe(W)&&Wb.forEach(function(Ce){return Ce(W)}),W.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||a)&&b.props.hideOnClick!==!1&&b.state.isVisible?ge=!0:Ui(W),W.type==="click"&&(a=!ge),ge&&!ve&&Bi(W)}}function xn(W){var ae=W.target,ge=ie().contains(ae)||T.contains(ae);if(!(W.type==="mousemove"&&ge)){var ve=ei().concat(T).map(function(Ce){var ct,Hn=Ce._tippy,Fr=(ct=Hn.popperInstance)==null?void 0:ct.state;return Fr?{popperRect:Ce.getBoundingClientRect(),popperState:Fr,props:n}:null}).filter(Boolean);xCe(ve,W)&&(F(),Bi(W))}}function Nr(W){var ae=Q(W)||b.props.trigger.indexOf("click")>=0&&a;if(!ae){if(b.props.interactive){b.hideWithInteractivity(W);return}Bi(W)}}function fr(W){b.props.trigger.indexOf("focusin")<0&&W.target!==ie()||b.props.interactive&&W.relatedTarget&&T.contains(W.relatedTarget)||Bi(W)}function Q(W){return yo.isTouch?N()!==W.type.indexOf("touch")>=0:!1}function re(){ke();var W=b.props,ae=W.popperOptions,ge=W.placement,ve=W.offset,Ce=W.getReferenceClientRect,ct=W.moveTransition,Hn=Z()?cR(T).arrow:null,Fr=Ce?{getBoundingClientRect:Ce,contextElement:Ce.contextElement||ie()}:e,qf={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Bf){var Ra=Bf.state;if(Z()){var UR=ye(),zf=UR.box;["placement","reference-hidden","escaped"].forEach(function(Oc){Oc==="placement"?zf.setAttribute("data-placement",Ra.placement):Ra.attributes.popper["data-popper-"+Oc]?zf.setAttribute("data-"+Oc,""):zf.removeAttribute("data-"+Oc)}),Ra.attributes.popper={}}}},zi=[{name:"offset",options:{offset:ve}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ct}},qf];Z()&&Hn&&zi.push({name:"arrow",options:{element:Hn,padding:3}}),zi.push.apply(zi,(ae==null?void 0:ae.modifiers)||[]),b.popperInstance=yCe(Fr,T,Object.assign({},ae,{placement:ge,onFirstUpdate:d,modifiers:zi}))}function ke(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Ot(){var W=b.props.appendTo,ae,ge=ie();b.props.interactive&&W===J5||W==="parent"?ae=ge.parentNode:ae=Z5(W,[ge]),ae.contains(T)||ae.appendChild(T),b.state.isMounted=!0,re(),process.env.NODE_ENV!=="production"&&Ta(b.props.interactive&&W===xr.appendTo&&ge.nextElementSibling!==T,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
125
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var oMe=function(){return"innerHTML"};function kR(e,t){e[oMe()]=t}function b5(e){var t=rm();return e===!0?t.className=n5:(t.className=r5,im(e)?t.appendChild(e):kR(t,e)),t}function _5(e,t){im(t.content)?(kR(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?kR(e,t.content):e.textContent=t.content)}function AR(e){var t=e.firstElementChild,n=Jb(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(t5)}),arrow:n.find(function(r){return r.classList.contains(n5)||r.classList.contains(r5)}),backdrop:n.find(function(r){return r.classList.contains(NRe)})}}function $5(e){var t=rm(),n=rm();n.className=FRe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=rm();r.className=t5,r.setAttribute("data-state","hidden"),_5(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=AR(t),s=u.box,c=u.content,l=u.arrow;a.theme?s.setAttribute("data-theme",a.theme):s.removeAttribute("data-theme"),typeof a.animation=="string"?s.setAttribute("data-animation",a.animation):s.removeAttribute("data-animation"),a.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?s.setAttribute("role",a.role):s.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&_5(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(s.removeChild(l),s.appendChild(b5(a.arrow))):s.appendChild(b5(a.arrow)):l&&s.removeChild(l)}return{popper:t,onUpdate:i}}$5.$$tippy=!0;var aMe=1,Zb=[],FR=[];function uMe(e,t){var n=g5(e,Object.assign({},kr,v5(s5(t)))),r,i,o,a=!1,u=!1,s=!1,c=!1,l,f,d,p=[],h=a5(dr,n.interactiveDebounce),v,g=aMe++,b=null,S=jRe(n.plugins),O={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:g,reference:e,popper:rm(),popperInstance:b,props:n,state:O,plugins:S,clearDelayTimeouts:Wa,setProps:ri,setContent:Hu,show:ed,hide:P,hideWithInteractivity:F,enable:Na,disable:Pa,unmount:D,destroy:Fe};if(!n.render)return process.env.NODE_ENV!=="production"&&xR(!0,"render() function has not been supplied."),y;var C=n.render(y),I=C.popper,M=C.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+y.id,y.popper=I,e._tippy=y,I._tippy=y;var R=S.map(function(W){return W.fn(y)}),U=e.hasAttribute("aria-expanded");return Ut(),$(),k(),A("onCreate",[y]),n.showOnCreate&&qi(),I.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",h)}),y;function q(){var W=y.props.touch;return Array.isArray(W)?W:[W,0]}function N(){return q()[0]==="hold"}function Z(){var W;return!!((W=y.props.render)!=null&&W.$$tippy)}function ee(){return v||e}function J(){var W=ee().parentNode;return W?KRe(W):document}function ve(){return AR(I)}function Ie(W){return y.state.isMounted&&!y.state.isVisible||Oo.isTouch||l&&l.type==="focus"?0:wR(y.props.delay,W?0:1,kr.delay)}function k(W){W===void 0&&(W=!1),I.style.pointerEvents=y.props.interactive&&!W?"":"none",I.style.zIndex=""+y.props.zIndex}function A(W,ie,me){if(me===void 0&&(me=!0),R.forEach(function(Oe){Oe[W]&&Oe[W].apply(Oe,ie)}),me){var he;(he=y.props)[W].apply(he,ie)}}function T(){var W=y.props.aria;if(W.content){var ie="aria-"+W.content,me=I.id,he=Kf(y.props.triggerTarget||e);he.forEach(function(Oe){var st=Oe.getAttribute(ie);if(y.state.isVisible)Oe.setAttribute(ie,st?st+" "+me:me);else{var Vn=st&&st.replace(me,"").trim();Vn?Oe.setAttribute(ie,Vn):Oe.removeAttribute(ie)}})}}function $(){if(!(U||!y.props.aria.expanded)){var W=Kf(y.props.triggerTarget||e);W.forEach(function(ie){y.props.interactive?ie.setAttribute("aria-expanded",y.state.isVisible&&ie===ee()?"true":"false"):ie.removeAttribute("aria-expanded")})}}function x(){J().removeEventListener("mousemove",h),Zb=Zb.filter(function(W){return W!==h})}function L(W){if(!(Oo.isTouch&&(s||W.type==="mousedown"))){var ie=W.composedPath&&W.composedPath()[0]||W.target;if(!(y.props.interactive&&l5(I,ie))){if(Kf(y.props.triggerTarget||e).some(function(me){return l5(me,ie)})){if(Oo.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else A("onClickOutside",[y,W]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),u=!0,setTimeout(function(){u=!1}),y.state.isMounted||se())}}}function X(){s=!0}function ne(){s=!1}function xe(){var W=J();W.addEventListener("mousedown",L,!0),W.addEventListener("touchend",L,Oc),W.addEventListener("touchstart",ne,Oc),W.addEventListener("touchmove",X,Oc)}function se(){var W=J();W.removeEventListener("mousedown",L,!0),W.removeEventListener("touchend",L,Oc),W.removeEventListener("touchstart",ne,Oc),W.removeEventListener("touchmove",X,Oc)}function Ae(W,ie){He(W,function(){!y.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&ie()})}function ze(W,ie){He(W,ie)}function He(W,ie){var me=ve().box;function he(Oe){Oe.target===me&&(MR(me,"remove",he),ie())}if(W===0)return ie();MR(me,"remove",f),MR(me,"add",he),f=he}function ut(W,ie,me){me===void 0&&(me=!1);var he=Kf(y.props.triggerTarget||e);he.forEach(function(Oe){Oe.addEventListener(W,ie,me),p.push({node:Oe,eventType:W,handler:ie,options:me})})}function Ut(){N()&&(ut("touchstart",gn,{passive:!0}),ut("touchend",Ui,{passive:!0})),LRe(y.props.trigger).forEach(function(W){if(W!=="manual")switch(ut(W,gn),W){case"mouseenter":ut("mouseleave",Ui);break;case"focus":ut(ZRe?"focusout":"blur",ti);break;case"focusin":ut("focusout",ti);break}})}function Qt(){p.forEach(function(W){var ie=W.node,me=W.eventType,he=W.handler,Oe=W.options;ie.removeEventListener(me,he,Oe)}),p=[]}function gn(W){var ie,me=!1;if(!(!y.state.isEnabled||Ro(W)||u)){var he=((ie=l)==null?void 0:ie.type)==="focus";l=W,v=W.currentTarget,$(),!y.state.isVisible&&BRe(W)&&Zb.forEach(function(Oe){return Oe(W)}),W.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||a)&&y.props.hideOnClick!==!1&&y.state.isVisible?me=!0:qi(W),W.type==="click"&&(a=!me),me&&!he&&zi(W)}}function dr(W){var ie=W.target,me=ee().contains(ie)||I.contains(ie);if(!(W.type==="mousemove"&&me)){var he=ni().concat(I).map(function(Oe){var st,Vn=Oe._tippy,Nr=(st=Vn.popperInstance)==null?void 0:st.state;return Nr?{popperRect:Oe.getBoundingClientRect(),popperState:Nr,props:n}:null}).filter(Boolean);VRe(he,W)&&(x(),zi(W))}}function Ui(W){var ie=Ro(W)||y.props.trigger.indexOf("click")>=0&&a;if(!ie){if(y.props.interactive){y.hideWithInteractivity(W);return}zi(W)}}function ti(W){y.props.trigger.indexOf("focusin")<0&&W.target!==ee()||y.props.interactive&&W.relatedTarget&&I.contains(W.relatedTarget)||zi(W)}function Ro(W){return Oo.isTouch?N()!==W.type.indexOf("touch")>=0:!1}function Fa(){Bi();var W=y.props,ie=W.popperOptions,me=W.placement,he=W.offset,Oe=W.getReferenceClientRect,st=W.moveTransition,Vn=Z()?AR(I).arrow:null,Nr=Oe?{getBoundingClientRect:Oe,contextElement:Oe.contextElement||ee()}:e,td={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(rd){var La=rd.state;if(Z()){var fM=ve(),id=fM.box;["placement","reference-hidden","escaped"].forEach(function(kc){kc==="placement"?id.setAttribute("data-placement",La.placement):La.attributes.popper["data-popper-"+kc]?id.setAttribute("data-"+kc,""):id.removeAttribute("data-"+kc)}),La.attributes.popper={}}}},Ki=[{name:"offset",options:{offset:he}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!st}},td];Z()&&Vn&&Ki.push({name:"arrow",options:{element:Vn,padding:3}}),Ki.push.apply(Ki,(ie==null?void 0:ie.modifiers)||[]),y.popperInstance=ARe(Nr,I,Object.assign({},ie,{placement:me,onFirstUpdate:d,modifiers:Ki}))}function Bi(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function pr(){var W=y.props.appendTo,ie,me=ee();y.props.interactive&&W===i5||W==="parent"?ie=me.parentNode:ie=o5(W,[me]),ie.contains(I)||ie.appendChild(I),y.state.isMounted=!0,Fa(),process.env.NODE_ENV!=="production"&&Ma(y.props.interactive&&W===kr.appendTo&&me.nextElementSibling!==I,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
130
126
 
131
127
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
132
128
 
133
129
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
134
130
 
135
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function ei(){return Pb(T.querySelectorAll("[data-tippy-root]"))}function Ui(W){b.clearDelayTimeouts(),W&&k("onTrigger",[b,W]),xe();var ae=we(!0),ge=Y(),ve=ge[0],Ce=ge[1];yo.isTouch&&ve==="hold"&&Ce&&(ae=Ce),ae?r=setTimeout(function(){b.show()},ae):b.show()}function Bi(W){if(b.clearDelayTimeouts(),k("onUntrigger",[b,W]),!b.state.isVisible){ce();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(W.type)>=0&&a)){var ae=we(!1);ae?i=setTimeout(function(){b.state.isVisible&&b.hide()},ae):o=requestAnimationFrame(function(){b.hide()})}}function wa(){b.state.isEnabled=!0}function Ca(){b.hide(),b.state.isEnabled=!1}function Ea(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function ti(W){if(process.env.NODE_ENV!=="production"&&Ta(b.state.isDestroyed,Nf("setProps")),!b.state.isDestroyed){k("onBeforeUpdate",[b,W]),qt();var ae=b.props,ge=cH(e,Object.assign({},ae,eH(W),{ignoreAttributes:!0}));b.props=ge,Ft(),ae.interactiveDebounce!==ge.interactiveDebounce&&(F(),h=X5(xn,ge.interactiveDebounce)),ae.triggerTarget&&!ge.triggerTarget?Af(ae.triggerTarget).forEach(function(ve){ve.removeAttribute("aria-expanded")}):ge.triggerTarget&&e.removeAttribute("aria-expanded"),O(),x(),M&&M(ae,ge),b.popperInstance&&(re(),ei().forEach(function(ve){requestAnimationFrame(ve._tippy.popperInstance.forceUpdate)})),k("onAfterUpdate",[b,W])}}function ju(W){b.setProps({content:W})}function Df(){process.env.NODE_ENV!=="production"&&Ta(b.state.isDestroyed,Nf("show"));var W=b.state.isVisible,ae=b.state.isDestroyed,ge=!b.state.isEnabled,ve=yo.isTouch&&!b.props.touch,Ce=rR(b.props.duration,0,xr.duration);if(!(W||ae||ge||ve)&&!ie().hasAttribute("disabled")&&(k("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,Z()&&(T.style.visibility="visible"),x(),xe(),b.state.isMounted||(T.style.transition="none"),Z()){var ct=ye(),Hn=ct.box,Fr=ct.content;oR([Hn,Fr],0)}d=function(){var zi;if(!(!b.state.isVisible||c)){if(c=!0,T.offsetHeight,T.style.transition=b.props.moveTransition,Z()&&b.props.animation){var Uf=ye(),Bf=Uf.box,Ra=Uf.content;oR([Bf,Ra],Ce),tH([Bf,Ra],"visible")}E(),O(),Q5(lR,b),(zi=b.popperInstance)==null||zi.forceUpdate(),k("onMount",[b]),b.props.animation&&Z()&&ze(Ce,function(){b.state.isShown=!0,k("onShown",[b])})}},Ot()}}function P(){process.env.NODE_ENV!=="production"&&Ta(b.state.isDestroyed,Nf("hide"));var W=!b.state.isVisible,ae=b.state.isDestroyed,ge=!b.state.isEnabled,ve=rR(b.props.duration,1,xr.duration);if(!(W||ae||ge)&&(k("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,a=!1,Z()&&(T.style.visibility="hidden"),F(),ce(),x(!0),Z()){var Ce=ye(),ct=Ce.box,Hn=Ce.content;b.props.animation&&(oR([ct,Hn],ve),tH([ct,Hn],"hidden"))}E(),O(),b.props.animation?Z()&&Ne(ve,b.unmount):b.unmount()}}function A(W){process.env.NODE_ENV!=="production"&&Ta(b.state.isDestroyed,Nf("hideWithInteractivity")),J().addEventListener("mousemove",h),Q5(Wb,h),h(W)}function L(){process.env.NODE_ENV!=="production"&&Ta(b.state.isDestroyed,Nf("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(ke(),ei().forEach(function(W){W._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),lR=lR.filter(function(W){return W!==b}),b.state.isMounted=!1,k("onHidden",[b]))}function Pe(){process.env.NODE_ENV!=="production"&&Ta(b.state.isDestroyed,Nf("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),qt(),delete e._tippy,b.state.isDestroyed=!0,k("onDestroy",[b]))}}function Jh(e,t){t===void 0&&(t={});var n=xr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(LCe(e),lH(t,n)),NCe();var r=Object.assign({},t,{plugins:n}),i=RCe(e);if(process.env.NODE_ENV!=="production"){var o=Gh(r.content),a=i.length>1;Ta(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
131
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function ni(){return Jb(I.querySelectorAll("[data-tippy-root]"))}function qi(W){y.clearDelayTimeouts(),W&&A("onTrigger",[y,W]),xe();var ie=Ie(!0),me=q(),he=me[0],Oe=me[1];Oo.isTouch&&he==="hold"&&Oe&&(ie=Oe),ie?r=setTimeout(function(){y.show()},ie):y.show()}function zi(W){if(y.clearDelayTimeouts(),A("onUntrigger",[y,W]),!y.state.isVisible){se();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(W.type)>=0&&a)){var ie=Ie(!1);ie?i=setTimeout(function(){y.state.isVisible&&y.hide()},ie):o=requestAnimationFrame(function(){y.hide()})}}function Na(){y.state.isEnabled=!0}function Pa(){y.hide(),y.state.isEnabled=!1}function Wa(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function ri(W){if(process.env.NODE_ENV!=="production"&&Ma(y.state.isDestroyed,Vf("setProps")),!y.state.isDestroyed){A("onBeforeUpdate",[y,W]),Qt();var ie=y.props,me=g5(e,Object.assign({},ie,s5(W),{ignoreAttributes:!0}));y.props=me,Ut(),ie.interactiveDebounce!==me.interactiveDebounce&&(x(),h=a5(dr,me.interactiveDebounce)),ie.triggerTarget&&!me.triggerTarget?Kf(ie.triggerTarget).forEach(function(he){he.removeAttribute("aria-expanded")}):me.triggerTarget&&e.removeAttribute("aria-expanded"),$(),k(),M&&M(ie,me),y.popperInstance&&(Fa(),ni().forEach(function(he){requestAnimationFrame(he._tippy.popperInstance.forceUpdate)})),A("onAfterUpdate",[y,W])}}function Hu(W){y.setProps({content:W})}function ed(){process.env.NODE_ENV!=="production"&&Ma(y.state.isDestroyed,Vf("show"));var W=y.state.isVisible,ie=y.state.isDestroyed,me=!y.state.isEnabled,he=Oo.isTouch&&!y.props.touch,Oe=wR(y.props.duration,0,kr.duration);if(!(W||ie||me||he)&&!ee().hasAttribute("disabled")&&(A("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,Z()&&(I.style.visibility="visible"),k(),xe(),y.state.isMounted||(I.style.transition="none"),Z()){var st=ve(),Vn=st.box,Nr=st.content;RR([Vn,Nr],0)}d=function(){var Ki;if(!(!y.state.isVisible||c)){if(c=!0,I.offsetHeight,I.style.transition=y.props.moveTransition,Z()&&y.props.animation){var nd=ve(),rd=nd.box,La=nd.content;RR([rd,La],Oe),c5([rd,La],"visible")}T(),$(),u5(FR,y),(Ki=y.popperInstance)==null||Ki.forceUpdate(),A("onMount",[y]),y.props.animation&&Z()&&ze(Oe,function(){y.state.isShown=!0,A("onShown",[y])})}},pr()}}function P(){process.env.NODE_ENV!=="production"&&Ma(y.state.isDestroyed,Vf("hide"));var W=!y.state.isVisible,ie=y.state.isDestroyed,me=!y.state.isEnabled,he=wR(y.props.duration,1,kr.duration);if(!(W||ie||me)&&(A("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,c=!1,a=!1,Z()&&(I.style.visibility="hidden"),x(),se(),k(!0),Z()){var Oe=ve(),st=Oe.box,Vn=Oe.content;y.props.animation&&(RR([st,Vn],he),c5([st,Vn],"hidden"))}T(),$(),y.props.animation?Z()&&Ae(he,y.unmount):y.unmount()}}function F(W){process.env.NODE_ENV!=="production"&&Ma(y.state.isDestroyed,Vf("hideWithInteractivity")),J().addEventListener("mousemove",h),u5(Zb,h),h(W)}function D(){process.env.NODE_ENV!=="production"&&Ma(y.state.isDestroyed,Vf("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(Bi(),ni().forEach(function(W){W._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),FR=FR.filter(function(W){return W!==y}),y.state.isMounted=!1,A("onHidden",[y]))}function Fe(){process.env.NODE_ENV!=="production"&&Ma(y.state.isDestroyed,Vf("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),Qt(),delete e._tippy,y.state.isDestroyed=!0,A("onDestroy",[y]))}}function am(e,t){t===void 0&&(t={});var n=kr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(eMe(e),y5(t,n)),YRe();var r=Object.assign({},t,{plugins:n}),i=zRe(e);if(process.env.NODE_ENV!=="production"){var o=im(r.content),a=i.length>1;Ma(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
136
132
 
137
133
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
138
134
 
139
135
  `,`1) content: element.innerHTML
140
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&VCe(c,r);return l&&s.push(l),s},[]);return Gh(e)?u[0]:u}Jh.defaultProps=xr,Jh.setDefaultProps=UCe,Jh.currentInput=yo,Object.assign({},R5,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Jh.setDefaultProps({render:pH});var jb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function HCe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var hH=HCe,GCe=typeof jb=="object"&&jb&&jb.Object===Object&&jb,YCe=GCe,JCe=YCe,ZCe=typeof self=="object"&&self&&self.Object===Object&&self,XCe=JCe||ZCe||Function("return this")(),mH=XCe,QCe=mH,eEe=function(){return QCe.Date.now()},tEe=eEe,nEe=/\s/;function rEe(e){for(var t=e.length;t--&&nEe.test(e.charAt(t)););return t}var iEe=rEe,oEe=iEe,aEe=/^\s+/;function uEe(e){return e&&e.slice(0,oEe(e)+1).replace(aEe,"")}var sEe=uEe,cEe=mH,lEe=cEe.Symbol,vH=lEe,gH=vH,yH=Object.prototype,fEe=yH.hasOwnProperty,dEe=yH.toString,Zh=gH?gH.toStringTag:void 0;function pEe(e){var t=fEe.call(e,Zh),n=e[Zh];try{e[Zh]=void 0;var r=!0}catch{}var i=dEe.call(e);return r&&(t?e[Zh]=n:delete e[Zh]),i}var hEe=pEe,mEe=Object.prototype,vEe=mEe.toString;function gEe(e){return vEe.call(e)}var yEe=gEe,bH=vH,bEe=hEe,_Ee=yEe,SEe="[object Null]",$Ee="[object Undefined]",_H=bH?bH.toStringTag:void 0;function TEe(e){return e==null?e===void 0?$Ee:SEe:_H&&_H in Object(e)?bEe(e):_Ee(e)}var IEe=TEe;function OEe(e){return e!=null&&typeof e=="object"}var wEe=OEe,CEe=IEe,EEe=wEe,REe="[object Symbol]";function MEe(e){return typeof e=="symbol"||EEe(e)&&CEe(e)==REe}var xEe=MEe,kEe=sEe,SH=hH,AEe=xEe,$H=0/0,NEe=/^[-+]0x[0-9a-f]+$/i,FEe=/^0b[01]+$/i,PEe=/^0o[0-7]+$/i,WEe=parseInt;function jEe(e){if(typeof e=="number")return e;if(AEe(e))return $H;if(SH(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=SH(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=kEe(e);var n=FEe.test(e);return n||PEe.test(e)?WEe(e.slice(2),n?2:8):NEe.test(e)?$H:+e}var LEe=jEe,DEe=hH,fR=tEe,TH=LEe,qEe="Expected a function",UEe=Math.max,BEe=Math.min;function zEe(e,t,n){var r,i,o,a,u,s,c=0,l=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(qEe);t=TH(t)||0,DEe(n)&&(l=!!n.leading,f="maxWait"in n,o=f?UEe(TH(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d);function p(T){var M=r,R=i;return r=i=void 0,c=T,a=e.apply(R,M),a}function h(T){return c=T,u=setTimeout(_,t),l?p(T):a}function v(T){var M=T-s,R=T-c,q=t-M;return f?BEe(q,o-R):q}function m(T){var M=T-s,R=T-c;return s===void 0||M>=t||M<0||f&&R>=o}function _(){var T=fR();if(m(T))return g(T);u=setTimeout(_,v(T))}function g(T){return u=void 0,d&&r?p(T):(r=i=void 0,a)}function S(){u!==void 0&&clearTimeout(u),c=0,r=s=i=u=void 0}function b(){return u===void 0?a:g(fR())}function $(){var T=fR(),M=m(T);if(r=arguments,i=this,s=T,M){if(u===void 0)return h(s);if(f)return clearTimeout(u),u=setTimeout(_,t),p(s)}return u===void 0&&(u=setTimeout(_,t)),a}return $.cancel=S,$.flush=b,$}var KEe=zEe;class VEe{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:u,state:s,from:c,to:l})=>{const{doc:f,selection:d}=s,{empty:p}=d,h=!f.textBetween(c,l).length&&UE(s.selection),v=this.element.contains(document.activeElement);return!(!(u.hasFocus()||v)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var s;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.updateHandler=(u,s)=>{var c,l,f;const{state:d,composing:p}=u,{doc:h,selection:v}=d,m=s&&s.doc.eq(h)&&s.selection.eq(v);if(p||m)return;this.createTooltip();const{ranges:_}=v,g=Math.min(..._.map($=>$.$from.pos)),S=Math.max(..._.map($=>$.$to.pos));if(!((c=this.shouldShow)===null||c===void 0?void 0:c.call(this,{editor:this.editor,view:u,state:d,oldState:s,from:g,to:S}))){this.hide();return}(l=this.tippy)===null||l===void 0||l.setProps({getReferenceClientRect:((f=this.tippyOptions)===null||f===void 0?void 0:f.getReferenceClientRect)||(()=>{if(BOe(d.selection)){const $=u.nodeDOM(g);if($)return $.getBoundingClientRect()}return zOe(u,g,S)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=Jh(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;this.updateDelay>0&&i?KEe(this.updateHandler,this.updateDelay)(t,n):this.updateHandler(t,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const IH=e=>new Gr({key:typeof e.pluginKey=="string"?new bu(e.pluginKey):e.pluginKey,view:t=>new VEe({view:t,...e})});Rr.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[IH({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const HEe=e=>{const[t,n]=U.useState(null);return U.useEffect(()=>{if(!t||e.editor.isDestroyed)return;const{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=e,s=IH({updateDelay:a,editor:i,element:t,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[e.editor,t]),U.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)};class GEe extends cwe{constructor(){super(...arguments),this.contentComponent=null}}const YEe=({renderers:e})=>U.createElement(U.Fragment,null,Object.entries(e).map(([t,n])=>s_.createPortal(n.reactElement,n.element,t)));class JEe extends U.Component{constructor(t){super(t),this.editorContentRef=U.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?s_.flushSync(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){const{editor:t}=this.props;if(!t||(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,...n}=this.props;return U.createElement(U.Fragment,null,U.createElement("div",{ref:this.editorContentRef,...n}),U.createElement(YEe,{renderers:this.state.renderers}))}}const ZEe=U.memo(JEe),XEe=U.createContext({onDragStart:void 0}),QEe=()=>U.useContext(XEe);U.forwardRef((e,t)=>{const{onDragStart:n}=QEe(),r=e.as||"div";return U.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function eRe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function tRe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class nRe{constructor(t,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.render()}render(){var t,n;const r=this.component,i=this.props;(eRe(r)||tRe(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=U.createElement(r,{...i}),(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}function rRe(){const[,e]=U.useState(0);return()=>e(t=>t+1)}const iRe=(e={},t=[])=>{const[n,r]=U.useState(null),i=rRe();return U.useEffect(()=>{let o=!0;const a=new GEe(e);return r(a),a.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o&&i()})})}),()=>{a.destroy(),o=!1}},t),n};var Ve={},_n={},Li={},OH;function wH(){if(OH)return Li;OH=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.Sections=Li.DynamicSection=Li.StaticSection=Li.sectionReader=void 0;const t=H.__importStar(ee),n=tf(),r=Hz();function i(o){return t.record(n.WidgetKey,o)}return Li.sectionReader=i,Li.StaticSection=i(r.StaticWidget),Li.DynamicSection=i(r.DynamicWidget),Li.Sections={toStatic(o,a){return Object.entries(o).reduce((s,[c,l])=>({...s,[c]:r.Widgets.toStatic(l,a)}),{})}},Li}var CH;function oRe(){if(CH)return _n;CH=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.filterMissingSharedSlices=_n.collectWidgets=_n.validateSlices=_n.toStatic=_n.flattenWidgets=_n.CustomType=_n.StaticCustomType=void 0;const e=H,t=Ln(),n=e.__importStar(ee),r=$w(),i=vt(),o=wH();class a extends Error{constructor(m){super(),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=m,this.message=this._formatError(m)}_formatError(m){return`The following slices doesn't exists in your Prismic repository:
141
- ${m.map(g=>` - ${g}`).join(`
136
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&uMe(c,r);return l&&s.push(l),s},[]);return im(e)?u[0]:u}am.defaultProps=kr,am.setDefaultProps=rMe,am.currentInput=Oo,Object.assign({},j4,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),am.setDefaultProps({render:$5});class sMe{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:u,state:s,from:c,to:l})=>{const{doc:f,selection:d}=s,{empty:p}=d,h=!f.textBetween(c,l).length&&cR(s.selection),v=this.element.contains(document.activeElement);return!(!(u.hasFocus()||v)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var s;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.handleDebouncedUpdate=(u,s)=>{const c=!(s!=null&&s.selection.eq(u.state.selection)),l=!(s!=null&&s.doc.eq(u.state.doc));!c&&!l||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,c,l,s)},this.updateDelay))},this.updateHandler=(u,s,c,l)=>{var f,d,p;const{state:h,composing:v}=u,{selection:g}=h;if(v||!s&&!c)return;this.createTooltip();const{ranges:S}=g,O=Math.min(...S.map(I=>I.$from.pos)),y=Math.max(...S.map(I=>I.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:u,state:h,oldState:l,from:O,to:y}))){this.hide();return}(d=this.tippy)===null||d===void 0||d.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(Xwe(h.selection)){let I=u.nodeDOM(O);const M=I.dataset.nodeViewWrapper?I:I.querySelector("[data-node-view-wrapper]");if(M&&(I=M.firstChild),I)return I.getBoundingClientRect()}return Qwe(u,O,y)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=am(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),a=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const S5=e=>new Er({key:typeof e.pluginKey=="string"?new Fi(e.pluginKey):e.pluginKey,view:t=>new sMe({view:t,...e})});sr.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[S5({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const cMe=e=>{const[t,n]=j.useState(null);return j.useEffect(()=>{if(!t||e.editor.isDestroyed)return;const{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=e,s=S5({updateDelay:a,editor:i,element:t,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[e.editor,t]),j.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)};class lMe extends yEe{constructor(){super(...arguments),this.contentComponent=null}}const fMe=({renderers:e})=>j.createElement(j.Fragment,null,Object.entries(e).map(([t,n])=>O_.createPortal(n.reactElement,n.element,t)));class dMe extends j.Component{constructor(t){super(t),this.editorContentRef=j.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?O_.flushSync(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){const{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,...n}=this.props;return j.createElement(j.Fragment,null,j.createElement("div",{ref:this.editorContentRef,...n}),j.createElement(fMe,{renderers:this.state.renderers}))}}const pMe=j.memo(dMe),hMe=j.createContext({onDragStart:void 0}),mMe=()=>j.useContext(hMe);j.forwardRef((e,t)=>{const{onDragStart:n}=mMe(),r=e.as||"div";return j.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function vMe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function gMe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class yMe{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),a&&Object.keys(a).forEach(u=>{this.element.setAttribute(u,a[u])}),this.render()}render(){var t,n;const r=this.component,i=this.props;(vMe(r)||gMe(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=j.createElement(r,{...i}),(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}function bMe(){const[,e]=j.useState(0);return()=>e(t=>t+1)}const _Me=(e={},t=[])=>{const[n,r]=j.useState(null),i=bMe(),{onBeforeCreate:o,onBlur:a,onCreate:u,onDestroy:s,onFocus:c,onSelectionUpdate:l,onTransaction:f,onUpdate:d}=e,p=j.useRef(o),h=j.useRef(a),v=j.useRef(u),g=j.useRef(s),b=j.useRef(c),S=j.useRef(l),O=j.useRef(f),y=j.useRef(d);return j.useEffect(()=>{n&&(o&&(n.off("beforeCreate",p.current),n.on("beforeCreate",o),p.current=o),a&&(n.off("blur",h.current),n.on("blur",a),h.current=a),u&&(n.off("create",v.current),n.on("create",u),v.current=u),s&&(n.off("destroy",g.current),n.on("destroy",s),g.current=s),c&&(n.off("focus",b.current),n.on("focus",c),b.current=c),l&&(n.off("selectionUpdate",S.current),n.on("selectionUpdate",l),S.current=l),f&&(n.off("transaction",O.current),n.on("transaction",f),O.current=f),d&&(n.off("update",y.current),n.on("update",d),y.current=d))},[o,a,u,s,c,l,f,d,n]),j.useEffect(()=>{let C=!0;const I=new lMe(e);return r(I),I.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{C&&i()})})}),()=>{I.destroy(),C=!1}},t),n};var Be={},T5={},Li={};Object.defineProperty(Li,"__esModule",{value:!0}),Li.Sections=Li.DynamicSection=Li.StaticSection=Li.sectionReader=void 0;const $Me=(0,G.__importStar)(Q),SMe=Gs,NR=Cr;function PR(e){return $Me.record(SMe.WidgetKey,e)}Li.sectionReader=PR,Li.StaticSection=PR(NR.StaticWidget),Li.DynamicSection=PR(NR.DynamicWidget),Li.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:NR.Widgets.toStatic(o,t)}),{})}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.filterMissingSharedSlices=e.collectWidgets=e.validateSlices=e.toStatic=e.flattenWidgets=e.CustomType=e.StaticCustomType=e.CustomTypeFormat=void 0;const t=G,n=In,r=(0,t.__importStar)(Q),i=mf,o=at,a=Li;e.CustomTypeFormat={page:"page",custom:"custom"};class u extends Error{constructor(b){super(),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=b,this.message=this._formatError(b)}_formatError(b){return`The following slices doesn't exists in your Prismic repository:
137
+ ${b.map(O=>` - ${O}`).join(`
142
138
  `)}
143
- `}}function u(v){return n.exact(n.intersection([n.type({id:n.string,label:i.StringOrNull,repeatable:(0,r.withFallback)(n.boolean,!0),json:n.record(n.string,v),status:(0,r.withFallback)(n.boolean,!0)}),n.partial({hash:n.string})]))}_n.StaticCustomType=u(o.StaticSection),_n.CustomType=u(o.DynamicSection);function s(v){return Object.entries(v.json).reduce((m,[,_])=>{const g=Object.entries(_);return m.concat(g)},[])}_n.flattenWidgets=s;function c(v){return s(v).filter(([,g])=>g.type==="Slices").reduce((g,[,S])=>{const b=Object.entries(S.config&&S.config.choices?S.config.choices:{}).filter(([,$])=>$.type==="SharedSlice").map(([$])=>$);return g.concat(b)},[])}function l(v){const m=c(v);return function(_){return m.map(_)}}function f(v,m){const _=Object.entries(v.json).reduce((g,[S,b])=>({...g,[S]:o.Sections.toStatic(b,m)}),{});return{...v,json:_}}_n.toStatic=f;function d(v,m){const _=l(v)(g=>{if(!m.get(g))return g}).filter(Boolean);return _.length>0?(0,t.left)(new a(_)):(0,t.right)(v)}_n.validateSlices=d;function p(v,m){const _=Object.entries(v.json).reduce((g,[S,b])=>{const $=Object.entries(b).reduce((T,[M,R])=>{const q=m(M,R);return q?{...T,[M]:q}:T},{});return{...g,[S]:$}},{});return{...v,json:_}}_n.collectWidgets=p;function h(v,m){return p(v,(_,g)=>{if(g.type==="Slices"){if(!g.config||!g.config.choices)return g;const S=Object.entries(g.config.choices).reduce(($,[T,M])=>M.type==="SharedSlice"&&!m.get(T)?$:{...$,[T]:M},{}),b={...g.config,choices:S};return{...g,config:b}}return g})}return _n.filterMissingSharedSlices=h,_n}var dR={},pR={},EH;function hR(){return EH||(EH=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiffOperation=void 0,function(t){t.Added="added",t.Removed="removed",t.Updated="updated"}(e.DiffOperation||(e.DiffOperation={}))}(pR)),pR}var Xh={},yc={},Qh={},RH;function aRe(){if(RH)return Qh;RH=1,Object.defineProperty(Qh,"__esModule",{value:!0}),Qh.toRecord=void 0;function e(t,n){return t.reduce((r,i)=>{const o=n(i);return{...r,[o]:i}},{})}return Qh.toRecord=e,Qh}var MH;function xH(){if(MH)return yc;MH=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.Objects=yc.Arrays=void 0;const e=H;return yc.Arrays=e.__importStar(aRe()),yc.Objects=e.__importStar(SK()),yc}var em={},kH;function AH(){if(kH)return em;kH=1,Object.defineProperty(em,"__esModule",{value:!0}),em.VariationComparator=void 0;const e=xH(),t=hR();function n(i,o){const a=e.Objects.zipObjects(i,o);return Object.entries(a).reduce((u,[s,c])=>s==="primary"||s==="items"||(c==null?void 0:c.left)===(c==null?void 0:c.right)?u:{...u,[s]:c==null?void 0:c.right},{})}function r(i,o){const a=e.Objects.zipObjects(i,o),u=Object.entries(a).reduce((s,[c,l])=>{if(JSON.stringify(l==null?void 0:l.left)===JSON.stringify(l==null?void 0:l.right))return s;const f=(()=>{if(!(!(l!=null&&l.left)&&!(l!=null&&l.right)))return l!=null&&l.left&&!l.right?{op:t.DiffOperation.Removed}:!(l!=null&&l.left)&&(l!=null&&l.right)?{op:t.DiffOperation.Added,value:l.right}:{op:t.DiffOperation.Updated,value:l.right}})();return f?{...s,[c]:f}:s},{});return e.Objects.isNotEmpty(u)?u:void 0}return em.VariationComparator={compare(i,o){if(i&&!o)return{op:t.DiffOperation.Removed};if(!i&&o)return{op:t.DiffOperation.Added,value:o};const a=n(i,o),u=r(i==null?void 0:i.primary,o==null?void 0:o.primary),s=r(i==null?void 0:i.items,o==null?void 0:o.items),c={...a,...u?{primary:u}:{},...s?{items:s}:{}};if(e.Objects.isNotEmpty(c))return{op:t.DiffOperation.Updated,value:c}}},em}var NH;function uRe(){if(NH)return Xh;NH=1,Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.SliceComparator=void 0;const e=xH(),t=hR(),n=AH();function r(i,o){const a=e.Objects.zipObjects(i,o);return Object.entries(a).reduce((u,[s,c])=>s==="variations"||(c==null?void 0:c.left)===(c==null?void 0:c.right)?u:{...u,[s]:c==null?void 0:c.right},{})}return Xh.SliceComparator={compare(i,o){if(!i&&o)return{op:t.DiffOperation.Added,value:o};if(i&&!o)return{op:t.DiffOperation.Removed};const a=r(i,o),u=e.Objects.zipObjects(i&&e.Arrays.toRecord(i.variations,l=>l.id),o&&e.Arrays.toRecord(o.variations,l=>l.id)),s=Object.entries(u).reduce((l,[f,d])=>{if(!d)return l;const p=n.VariationComparator.compare(d.left,d.right);return p?{...l,[f]:p}:l},{}),c={...a,...e.Objects.isNotEmpty(s)?{variations:s}:{}};if(e.Objects.isNotEmpty(c))return{op:t.DiffOperation.Updated,value:c}}},Xh}var FH;function sRe(){return FH||(FH=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(hR(),e),t.__exportStar(uRe(),e),t.__exportStar(AH(),e)}(dR)),dR}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(oRe(),e),t.__exportStar(sRe(),e),t.__exportStar(wH(),e),t.__exportStar(sa(),e)})(Ve);const cRe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,lRe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,fRe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,dRe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,pRe=HE.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",bn(this.options.HTMLAttributes,e),0]},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[Rb({find:cRe,type:this.type}),Rb({find:fRe,type:this.type})]},addPasteRules(){return[Mb({find:lRe,type:this.type}),Mb({find:dRe,type:this.type})]}});var mR=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(mR||{}),Ff=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(Ff||{});class hRe{constructor(t,n,r){Vf(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class PH{constructor(t,n,r,i){Vf(this,"extType","mark");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class Pf{constructor(t,n,r,i,o,a=!1){Vf(this,"extType","node");Vf(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}class mRe extends Pf{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class vR extends Pf{constructor(t,n,r,i){super(t,n,r,i)}}const gR=pRe.extend({name:"bold"}),vRe={fromPrismic(e){return function(){var t;return(t=e.marks[gR.name])==null?void 0:t.create()}},toPrismic(){}},WH=new PH([Ve.RichTextNodeType.strong],gR.name,gR,vRe),gRe=/^\s*([-+*])\s$/,yRe=Jr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[O5({find:gRe,type:this.type})]}}),jH=Jr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",bn(this.options.HTMLAttributes,e)]},renderText(){return`
144
- `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:u}=r.extensionManager,s=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:l})=>{if(l&&s&&a){const f=s.filter(d=>u.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),bc={isHardBreak(e){return e.type.name===jH.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function bRe(e){if(!e||!e.size)return{defaultTextConverter:void 0,extensions:E6()};const t=E6(e),n=Array.from(e.values()),r=(()=>{const a=li(c=>n.some(l=>c.richTextNodeTypes.includes(l)))(t),u=a.some(c=>c instanceof vR)?[Wu,...a]:a;return u.some(c=>c instanceof Pf)?u:[C6,...u]})(),i=r.find(a=>a instanceof Pf)||C6;function o(a){return u=>i.converter.fromPrismic(a)({...u,type:i.richTextNodeTypes[0]})}return{defaultTextConverter:o,extensions:r}}function _Re(e){if(!(e!=null&&e.single)&&!(e!=null&&e.multi))return;const t=y((e.single||e.multi||"").split(/\s*,\s*/),lv(n=>p0(()=>{})(Ve.RichTextNodeTypeCodec.decode(n))),li(ya));return new Set(t)}function SRe(e){const t=_Re(e);return bRe(t)}const $Re=Jr.create({name:"doc",topNode:!0,content:"block+"}),LH=Jr.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",bn(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),Wf={component:LH,converter:{fromPrismic(e){return function(t){var r;const n=Wu.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[LH.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return bc.children.reduce(e,(n,r)=>{const i=Wu.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},placeholder:"List"};function TRe(e){return e.slice(1,e.length).reduce((t,n)=>t.copy(t.content.append(n.content)),e[0])}const yR="document",IRe=e=>$Re.extend({name:yR,content:e?"block+":"block"}),ORe=e=>({fromPrismic(t,n){function r(i){return function(o=void 0){return!o&&n&&ot.TextBlock.is(i)?n(i):o}}return function(i){var a;const o=i.value.reduce((u,s)=>{const c=e.find(h=>h.richTextNodeTypes.includes(s.type)),l=(()=>{if(c)switch(c.nodeType){case Ff.Embed:return ot.EmbedBlock.is(s)&&c.converter.fromPrismic(t)(s);case Ff.Text:return ot.TextBlock.is(s)&&c.converter.fromPrismic(t)(s);case Ff.Image:return ot.ImageBlock.is(s)&&c.converter.fromPrismic(t)(s);default:return}})(),[f,d]=y(u,jS(u.length-1),([h,v])=>[h,WS(v)]),p=(()=>l?y(d,Ao(()=>({merged:!1,node:l}),h=>l.type.name===h.type.name&&(l.type.name===n_.name||l.type.name===o_.name)?{merged:!0,node:TRe([h,l])}:{merged:!1,node:l}),({merged:h,node:v})=>({merged:h,node:r(s)(v)})):{merged:!1,node:r(s)()})();return p.node?[...p.merged?f:u,p.node]:u},[]);return(a=t.nodes[yR])==null?void 0:a.create({},o)}},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...bc.children.reduce(t,(r,i)=>{const o=Object.values(e).find(u=>i.type.name===u.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[])]}}}),bR=new hRe(yR,IRe,ORe),Lb=jH.extend({name:"hard_break"}),Db=`
145
- `,DH={fromPrismic(e){return function(t){var n;if(t===Db)return(n=e.nodes[Lb.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===Lb.name)return Db}},_R={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function wRe(e,t){return function(n){const r=DH.fromPrismic(e)(Db);if(!r)return[n(t)];const i=t.split(Db);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>_R.isFirst(u)?_R.isEmptyLine(a)?o:[...o,n(a)]:_R.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const qb={name:Lb.name,component:Lb,converter:DH,splitTextToNodes:wRe},CRe=Rr.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Gr({props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=e.type.createAndFill(),a=(o==null?void 0:o.sameMarkup(e))&&o.content.findDiffStart(e.content)===null;return e.descendants((u,s)=>{const c=r>=s&&r<=s+u.nodeSize,l=!u.isLeaf&&!u.childCount;if((c||!this.options.showOnlyCurrent)&&l){const f=[this.options.emptyNodeClass];a&&f.push(this.options.emptyEditorClass);const d=Er.node(s,s+u.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:u,pos:s,hasAnchor:c}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Dt.create(e,i)}}})]}}),ERe=e=>CRe.configure({includeChildren:!0,placeholder:({editor:t,hasAnchor:n,node:r})=>{const i=!bc.children.exists(t.state.doc,u=>u===r),o=(()=>{const u=t.isEditable,s=t.isFocused&&n,c=r.type.name!==Wu.name;return u&&(s||c||i)})(),a=(()=>{if(i)return Wf.placeholder;const u=e[r.type.name];return typeof u=="string"?u:u==null?void 0:u(r.attrs)})();return o&&a||""},showOnlyCurrent:!1,showOnlyWhenEditable:!1});function Ub(e){return e.split("-")[1]}function qH(e){return e==="y"?"height":"width"}function ku(e){return e.split("-")[0]}function tm(e){return["top","bottom"].includes(ku(e))?"x":"y"}function UH(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,u=tm(t),s=qH(u),c=r[s]/2-i[s]/2,l=ku(t),f=u==="x";let d;switch(l){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(Ub(t)){case"start":d[u]-=c*(n&&f?-1:1);break;case"end":d[u]+=c*(n&&f?-1:1);break}return d}const RRe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=o.filter(Boolean),s=await(a.isRTL==null?void 0:a.isRTL(t));if(process.env.NODE_ENV!=="production"){if(a==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),u.filter(v=>{let{name:m}=v;return m==="autoPlacement"||m==="flip"}).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));(!e||!t)&&console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=UH(c,r,s),d=r,p={},h=0;for(let v=0;v<u.length;v++){const{name:m,fn:_}=u[v],{x:g,y:S,data:b,reset:$}=await _({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});if(l=g??l,f=S??f,p={...p,[m]:{...p[m],...b}},process.env.NODE_ENV!=="production"&&h>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),$&&h<=50){h++,typeof $=="object"&&($.placement&&(d=$.placement),$.rects&&(c=$.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):$.rects),{x:l,y:f}=UH(c,d,s)),v=-1;continue}}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};function MRe(e){return{top:0,right:0,bottom:0,left:0,...e}}function xRe(e){return typeof e!="number"?MRe(e):{top:e,right:e,bottom:e,left:e}}function SR(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function BH(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:u,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=xRe(p),m=u[d?f==="floating"?"reference":"floating":f],_=SR(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),g=f==="floating"?{...a.floating,x:r,y:i}:a.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),b=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},$=SR(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:S,strategy:s}):g);return process.env.NODE_ENV,{top:(_.top-$.top+h.top)/b.y,bottom:($.bottom-_.bottom+h.bottom)/b.y,left:(_.left-$.left+h.left)/b.x,right:($.right-_.right+h.right)/b.x}}const kRe=Math.min,ARe=Math.max;function zH(e,t,n){return ARe(e,kRe(t,n))}const NRe={left:"right",right:"left",bottom:"top",top:"bottom"};function Bb(e){return e.replace(/left|right|bottom|top/g,t=>NRe[t])}function FRe(e,t,n){n===void 0&&(n=!1);const r=Ub(e),i=tm(e),o=qH(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Bb(a)),{main:a,cross:Bb(a)}}const PRe={start:"end",end:"start"};function $R(e){return e.replace(/start|end/g,t=>PRe[t])}function WRe(e){const t=Bb(e);return[$R(e),t,$R(t)]}function jRe(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function LRe(e,t,n,r){const i=Ub(e);let o=jRe(ku(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map($R)))),o}const DRe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:u,elements:s}=t,{mainAxis:c=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...v}=e,m=ku(r),_=ku(a)===a,g=await(u.isRTL==null?void 0:u.isRTL(s.floating)),S=f||(_||!h?[Bb(a)]:WRe(a));!f&&p!=="none"&&S.push(...LRe(a,h,p,g));const b=[a,...S],$=await BH(t,v),T=[];let M=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&T.push($[m]),l){const{main:N,cross:Z}=FRe(r,o,g);T.push($[N],$[Z])}if(M=[...M,{placement:r,overflows:T}],!T.every(N=>N<=0)){var R,q;const N=(((R=i.flip)==null?void 0:R.index)||0)+1,Z=b[N];if(Z)return{data:{index:N,overflows:M},reset:{placement:Z}};let ie=(q=M.filter(J=>J.overflows[0]<=0).sort((J,ye)=>J.overflows[1]-ye.overflows[1])[0])==null?void 0:q.placement;if(!ie)switch(d){case"bestFit":{var Y;const J=(Y=M.map(ye=>[ye.placement,ye.overflows.filter(we=>we>0).reduce((we,x)=>we+x,0)]).sort((ye,we)=>ye[1]-we[1])[0])==null?void 0:Y[0];J&&(ie=J);break}case"initialPlacement":ie=a;break}if(r!==ie)return{reset:{placement:ie}}}return{}}}};async function qRe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ku(n),u=Ub(n),s=tm(n)==="x",c=["left","top"].includes(a)?-1:1,l=o&&s?-1:1,f=typeof t=="function"?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return u&&typeof h=="number"&&(p=u==="end"?h*-1:h),s?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const URe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await qRe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function KH(e){return e==="x"?"y":"x"}const BRe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:m=>{let{x:_,y:g}=m;return{x:_,y:g}}},...s}=e,c={x:n,y:r},l=await BH(t,s),f=tm(ku(i)),d=KH(f);let p=c[f],h=c[d];if(o){const m=f==="y"?"top":"left",_=f==="y"?"bottom":"right",g=p+l[m],S=p-l[_];p=zH(g,p,S)}if(a){const m=d==="y"?"top":"left",_=d==="y"?"bottom":"right",g=h+l[m],S=h-l[_];h=zH(g,h,S)}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},zRe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=e,l={x:n,y:r},f=tm(i),d=KH(f);let p=l[f],h=l[d];const v=typeof u=="function"?u(t):u,m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const S=f==="y"?"height":"width",b=o.reference[f]-o.floating[S]+m.mainAxis,$=o.reference[f]+o.reference[S]-m.mainAxis;p<b?p=b:p>$&&(p=$)}if(c){var _,g;const S=f==="y"?"width":"height",b=["top","left"].includes(ku(i)),$=o.reference[d]-o.floating[S]+(b&&((_=a.offset)==null?void 0:_[d])||0)+(b?0:m.crossAxis),T=o.reference[d]+o.reference[S]+(b?0:((g=a.offset)==null?void 0:g[d])||0)-(b?m.crossAxis:0);h<$?h=$:h>T&&(h=T)}return{[f]:p,[d]:h}}}};function kr(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bo(e){return kr(e).getComputedStyle(e)}const VH=Math.min,nm=Math.max,zb=Math.round;function HH(e){const t=bo(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=zb(n)!==i||zb(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Au(e){return YH(e)?(e.nodeName||"").toLowerCase():""}let Kb;function GH(){if(Kb)return Kb;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Kb=e.brands.map(t=>t.brand+"/"+t.version).join(" "),Kb):navigator.userAgent}function _o(e){return e instanceof kr(e).HTMLElement}function Di(e){return e instanceof kr(e).Element}function YH(e){return e instanceof kr(e).Node}function JH(e){if(typeof ShadowRoot>"u")return!1;const t=kr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Vb(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=bo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function KRe(e){return["table","td","th"].includes(Au(e))}function TR(e){const t=/firefox/i.test(GH()),n=bo(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||(r?r!=="none":!1)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null?o.includes(i):!1})}function IR(){return/^((?!chrome|android).)*safari/i.test(GH())}function OR(e){return["html","body","#document"].includes(Au(e))}function ZH(e){return Di(e)?e:e.contextElement}const XH={x:1,y:1};function jf(e){const t=ZH(e);if(!_o(t))return XH;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=HH(t);let a=(o?zb(n.width):n.width)/r,u=(o?zb(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}function _c(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=ZH(e);let s=XH;t&&(r?Di(r)&&(s=jf(r)):s=jf(e));const c=u?kr(u):window,l=IR()&&n;let f=(a.left+(l&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/s.x,d=(a.top+(l&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/s.y,p=a.width/s.x,h=a.height/s.y;if(u){const v=kr(u),m=r&&Di(r)?kr(r):r;let _=v.frameElement;for(;_&&r&&m!==v;){const g=jf(_),S=_.getBoundingClientRect(),b=getComputedStyle(_);S.x+=(_.clientLeft+parseFloat(b.paddingLeft))*g.x,S.y+=(_.clientTop+parseFloat(b.paddingTop))*g.y,f*=g.x,d*=g.y,p*=g.x,h*=g.y,f+=S.x,d+=S.y,_=kr(_).frameElement}}return{width:p,height:h,top:d,right:f+p,bottom:d+h,left:f,x:f,y:d}}function Nu(e){return((YH(e)?e.ownerDocument:e.document)||window.document).documentElement}function Hb(e){return Di(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function VRe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=_o(n),o=Nu(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},u={x:1,y:1};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Au(n)!=="body"||Vb(o))&&(a=Hb(n)),_o(n))){const c=_c(n);u=jf(n),s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-a.scrollLeft*u.x+s.x,y:t.y*u.y-a.scrollTop*u.y+s.y}}function QH(e){return _c(Nu(e)).left+Hb(e).scrollLeft}function HRe(e){const t=Nu(e),n=Hb(e),r=e.ownerDocument.body,i=nm(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=nm(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+QH(e);const u=-n.scrollTop;return bo(r).direction==="rtl"&&(a+=nm(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:u}}function rm(e){if(Au(e)==="html")return e;const t=e.assignedSlot||e.parentNode||JH(e)&&e.host||Nu(e);return JH(t)?t.host:t}function e6(e){const t=rm(e);return OR(t)?t.ownerDocument.body:_o(t)&&Vb(t)?t:e6(t)}function Sc(e,t){var n;t===void 0&&(t=[]);const r=e6(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=kr(r);return i?t.concat(o,o.visualViewport||[],Vb(r)?r:[]):t.concat(r,Sc(r))}function GRe(e,t){const n=kr(e),r=Nu(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;const c=IR();(!c||c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}function YRe(e,t){const n=_c(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=_o(e)?jf(e):{x:1,y:1},a=e.clientWidth*o.x,u=e.clientHeight*o.y,s=i*o.x,c=r*o.y;return{width:a,height:u,x:s,y:c}}function t6(e,t,n){let r;if(t==="viewport")r=GRe(e,n);else if(t==="document")r=HRe(Nu(e));else if(Di(t))r=YRe(t,n);else{const a={...t};if(IR()){var i,o;const u=kr(e);a.x-=((i=u.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=u.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return SR(r)}function JRe(e,t){const n=t.get(e);if(n)return n;let r=Sc(e).filter(u=>Di(u)&&Au(u)!=="body"),i=null;const o=bo(e).position==="fixed";let a=o?rm(e):e;for(;Di(a)&&!OR(a);){const u=bo(a),s=TR(a);u.position==="fixed"?i=null:(o?!s&&!i:!s&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position))?r=r.filter(f=>f!==a):i=u,a=rm(a)}return t.set(e,r),r}function ZRe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?JRe(t,this._c):[].concat(n),r],u=a[0],s=a.reduce((c,l)=>{const f=t6(t,l,i);return c.top=nm(f.top,c.top),c.right=VH(f.right,c.right),c.bottom=VH(f.bottom,c.bottom),c.left=nm(f.left,c.left),c},t6(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function XRe(e){return _o(e)?HH(e):e.getBoundingClientRect()}function n6(e,t){return!_o(e)||bo(e).position==="fixed"?null:t?t(e):e.offsetParent}function QRe(e){let t=rm(e);for(;_o(t)&&!OR(t);){if(TR(t))return t;t=rm(t)}return null}function r6(e,t){const n=kr(e);let r=n6(e,t);for(;r&&KRe(r)&&bo(r).position==="static";)r=n6(r,t);return r&&(Au(r)==="html"||Au(r)==="body"&&bo(r).position==="static"&&!TR(r))?n:r||QRe(e)||n}function eMe(e,t,n){const r=_o(t),i=Nu(t),o=_c(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((Au(t)!=="body"||Vb(i))&&(a=Hb(t)),_o(t)){const s=_c(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=QH(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}const tMe={getClippingRect:ZRe,convertOffsetParentRelativeRectToViewportRelativeRect:VRe,isElement:Di,getDimensions:XRe,getOffsetParent:r6,getDocumentElement:Nu,getScale:jf,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||r6,o=this.getDimensions;return{reference:eMe(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>bo(e).direction==="rtl"};function nMe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,c=s||o?[...Di(e)?Sc(e):e.contextElement?Sc(e.contextElement):[],...Sc(t)]:[];c.forEach(h=>{s&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let l=null;if(a){let h=!0;l=new ResizeObserver(()=>{h||n(),h=!1}),Di(e)&&!u&&l.observe(e),!Di(e)&&e.contextElement&&!u&&l.observe(e.contextElement),l.observe(t)}let f,d=u?_c(e):null;u&&p();function p(){const h=_c(e);d&&(h.x!==d.x||h.y!==d.y||h.width!==d.width||h.height!==d.height)&&n(),d=h,f=requestAnimationFrame(p)}return n(),()=>{var h;c.forEach(v=>{s&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),(h=l)==null||h.disconnect(),l=null,u&&cancelAnimationFrame(f)}}const rMe=(e,t,n)=>{const r=new Map,i={platform:tMe,...n},o={...i.platform,_c:r};return RRe(e,t,{...i,platform:o})};var Gb=typeof document<"u"?U.useLayoutEffect:U.useEffect;function Yb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Yb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Yb(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function i6(e){const t=$e.useRef(e);return Gb(()=>{t.current=e}),t}function iMe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[u,s]=$e.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,l]=$e.useState(r);Yb(c,r)||l(r);const f=$e.useRef(null),d=$e.useRef(null),p=$e.useRef(u),h=i6(o),v=i6(i),[m,_]=$e.useState(null),[g,S]=$e.useState(null),b=$e.useCallback(Y=>{f.current!==Y&&(f.current=Y,_(Y))},[]),$=$e.useCallback(Y=>{d.current!==Y&&(d.current=Y,S(Y))},[]),T=$e.useCallback(()=>{if(!f.current||!d.current)return;const Y={placement:t,strategy:n,middleware:c};v.current&&(Y.platform=v.current),rMe(f.current,d.current,Y).then(N=>{const Z={...N,isPositioned:!0};M.current&&!Yb(p.current,Z)&&(p.current=Z,D6.flushSync(()=>{s(Z)}))})},[c,t,n,v]);Gb(()=>{a===!1&&p.current.isPositioned&&(p.current.isPositioned=!1,s(Y=>({...Y,isPositioned:!1})))},[a]);const M=$e.useRef(!1);Gb(()=>(M.current=!0,()=>{M.current=!1}),[]),Gb(()=>{if(m&&g){if(h.current)return h.current(m,g,T);T()}},[m,g,T,h]);const R=$e.useMemo(()=>({reference:f,floating:d,setReference:b,setFloating:$}),[b,$]),q=$e.useMemo(()=>({reference:m,floating:g}),[m,g]);return $e.useMemo(()=>({...u,update:T,refs:R,elements:q,reference:b,floating:$}),[u,T,R,q,b,$])}var Fu=typeof document<"u"?U.useLayoutEffect:U.useEffect;function oMe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let wR=!1,aMe=0;const o6=()=>"floating-ui-"+aMe++;function uMe(){const[e,t]=$e.useState(()=>wR?o6():void 0);return Fu(()=>{e==null&&t(o6())},[]),$e.useEffect(()=>{wR||(wR=!0)},[]),e}const a6=$e["useId".toString()],u6=a6??uMe,sMe=$e.createContext(null),cMe=$e.createContext(null),s6=()=>{var e,t;return(e=(t=$e.useContext(sMe))==null?void 0:t.id)!=null?e:null},CR=()=>$e.useContext(cMe);function ER(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function c6(e){var t;return(t=ER(e).defaultView)!=null?t:window}function Jb(e){return e?e instanceof c6(e).Element:!1}function lMe(e){return e?e instanceof c6(e).HTMLElement:!1}const l6=$e["useInsertionEffect".toString()];function RR(e){const t=$e.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return l6?l6(()=>{t.current=e}):t.current=e,$e.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function fMe(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=$e.useState(null),l=CR(),f=$e.useRef(null),d=$e.useRef({}),p=$e.useState(()=>oMe())[0],h=iMe({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=RR(n),m=$e.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),_=$e.useMemo(()=>({...h,refs:m,dataRef:d,nodeId:u,events:p,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,p,t,v,m,s]);Fu(()=>{const b=l==null?void 0:l.nodesRef.current.find($=>$.id===u);b&&(b.context=_)});const{reference:g}=h,S=$e.useCallback(b=>{(Jb(b)||b===null)&&(_.refs.domReference.current=b,c(b)),g(b)},[g,_.refs]);return $e.useMemo(()=>({...h,context:_,refs:m,reference:S}),[h,m,_,S])}function MR(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[u,s]=a;if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof s=="function"){var c;(c=r.get(u))==null||c.push(s),i[u]=function(){for(var l,f=arguments.length,d=new Array(f),p=0;p<f;p++)d[p]=arguments[p];(l=r.get(u))==null||l.forEach(h=>h(...d))}}}else i[u]=s}),i),{})}}const dMe=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>MR(t,e,"reference"),getFloatingProps:t=>MR(t,e,"floating"),getItemProps:t=>MR(t,e,"item")}};function xR(e,t){var n;let r=(n=e.filter(a=>{var u;return a.parentId===t&&((u=a.context)==null?void 0:u.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var u;return(u=i)==null?void 0:u.some(s=>{var c;return a.parentId===s.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function f6(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function pMe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pu(e){e.preventDefault(),e.stopPropagation()}function hMe(e){const t=U.useRef(e);return Fu(()=>{t.current=e}),t}function d6(e){const t=U.useRef();return Fu(()=>{t.current=e},[e]),t.current}const mMe=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=u6(),a=u6(),u={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:u}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...u,...i==="menu"&&{"aria-labelledby":a}}}:{}};function kR(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const vMe=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:u=!0,escapeKey:s=!0,outsidePointerDown:c=!0,referencePointerDown:l=!1,ancestorScroll:f=!1,bubbles:d=!0}=t===void 0?{}:t;const p=CR(),h=s6()!=null,v=$e.useRef(!1);return $e.useEffect(()=>{if(!n||!u)return;function m($){if($.key==="Escape"){if(!d&&p&&xR(p.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function _($){const T=v.current;if(v.current=!1,T)return;const M=pMe($);if(Jb(M)&&i.floating.current){var R;const Y=(R=i.floating.current.ownerDocument.defaultView)!=null?R:window,N=M.scrollWidth>M.clientWidth,Z=M.scrollHeight>M.clientHeight;let ie=Z&&$.offsetX>M.clientWidth;if(Z&&Y.getComputedStyle(M).direction==="rtl"&&(ie=$.offsetX<=M.offsetWidth-M.clientWidth),ie||N&&$.offsetY>M.clientHeight)return}const q=p&&xR(p.nodesRef.current,a).some(Y=>{var N;return kR($,(N=Y.context)==null?void 0:N.refs.floating.current)});kR($,i.floating.current)||kR($,i.domReference.current)||q||!d&&p&&xR(p.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function g(){r(!1)}const S=ER(i.floating.current);s&&S.addEventListener("keydown",m),c&&S.addEventListener("pointerdown",_);const b=(f?[...Jb(i.reference.current)?Sc(i.reference.current):[],...Jb(i.floating.current)?Sc(i.floating.current):[]]:[]).filter($=>{var T;return $!==((T=S.defaultView)==null?void 0:T.visualViewport)});return b.forEach($=>$.addEventListener("scroll",g,{passive:!0})),()=>{s&&S.removeEventListener("keydown",m),c&&S.removeEventListener("pointerdown",_),b.forEach($=>$.removeEventListener("scroll",g))}},[s,c,o,p,a,n,r,f,u,d,i,h]),u?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},AR="ArrowUp",Zb="ArrowDown",Lf="ArrowLeft",im="ArrowRight";function Xb(e,t,n){return Math.floor(e/t)!==n}function om(e,t){return t<0||t>=e.current.length}function Mn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let u=n;do{var s,c;u=u+(r?-o:o)}while(u>=0&&u<=a.length-1&&(i?i.includes(u):a[u]==null||(s=a[u])!=null&&s.hasAttribute("disabled")||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function Qb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function p6(e,t){return Qb(t,e===AR||e===Zb,e===Lf||e===im)}function NR(e,t,n){return Qb(t,e===Zb,n?e===Lf:e===im)||e==="Enter"||e==" "||e===""}function gMe(e,t,n){return Qb(t,n?e===Lf:e===im,e===Zb)}function yMe(e,t,n){return Qb(t,n?e===im:e===Lf,e===AR)}function FR(e,t){return Mn(e,{disabledIndices:t})}function h6(e,t){return Mn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const bMe=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:u=()=>{},enabled:s=!0,selectedIndex:c=null,allowEscape:l=!1,loop:f=!1,nested:d=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:v="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:_=!0,disabledIndices:g=void 0,orientation:S="vertical",cols:b=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(l&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),h||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),S==="vertical"&&b>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const $=s6(),T=CR(),M=d6(n),R=RR(u),q=RR(d6(u)),Y=$e.useRef(v),N=$e.useRef(c??-1),Z=$e.useRef(null),ie=hMe(g),J=$e.useRef(!1),ye=$e.useRef(-1),[we,x]=$e.useState(),k=$e.useCallback((O,F)=>{ye.current=requestAnimationFrame(()=>{if(h){var j;x((j=O.current[F.current])==null?void 0:j.id)}else{var X;(X=O.current[F.current])==null||X.focus({preventScroll:!0})}})},[h]);Fu(()=>{s&&(!M&&n&&Y.current&&c!=null&&R(c),M&&!n&&(cancelAnimationFrame(ye.current),N.current=-1,q(null)))},[n,M,c,o,k,s,R,q]),Fu(()=>{if(s&&n)if(a==null){if(c!=null)return;M&&(N.current=-1,k(o,N)),!M&&Y.current&&(Z.current!=null||Y.current===!0&&Z.current==null)&&(N.current=Z.current==null||NR(Z.current,S,p)||d?FR(o,ie.current):h6(o,ie.current),R(N.current),k(o,N))}else om(o,a)||(N.current=a,k(o,N))},[n,M,a,c,d,o,R,k,s,l,S,p,h,ie]),Fu(()=>{if(s&&!n&&M){var O,F;const j=T==null||(O=T.nodesRef.current.find(X=>X.id===$))==null||(F=O.context)==null?void 0:F.refs.floating.current;j&&!j.contains(f6(ER(j)))&&j.focus({preventScroll:!0})}},[s,n,M,T,$]),Fu(()=>{Z.current=null});function E(O){if(J.current=!0,d&&yMe(O.key,S,p)){Pu(O),r(!1),lMe(i.domReference.current)&&i.domReference.current.focus();return}const F=N.current,j=FR(o,g),X=h6(o,g);if(O.key==="Home"&&(N.current=j,R(N.current)),O.key==="End"&&(N.current=X,R(N.current)),b>1){const te=N.current;if(O.key===AR){if(Pu(O),te===-1)N.current=X;else if(N.current=Mn(o,{startingIndex:te,amount:b,decrement:!0,disabledIndices:g}),f&&(te-b<j||N.current<0)){const xe=te%b,ce=X%b,Ne=X-(ce-xe);ce===xe?N.current=X:N.current=ce>xe?Ne:Ne-b}om(o,N.current)&&(N.current=te),R(N.current)}if(O.key===Zb&&(Pu(O),te===-1?N.current=j:(N.current=Mn(o,{startingIndex:te,amount:b,disabledIndices:g}),f&&te+b>X&&(N.current=Mn(o,{startingIndex:te%b-b,amount:b,disabledIndices:g}))),om(o,N.current)&&(N.current=te),R(N.current)),S==="both"){const xe=Math.floor(te/b);O.key===im&&(Pu(O),te%b!==b-1?(N.current=Mn(o,{startingIndex:te,disabledIndices:g}),f&&Xb(N.current,b,xe)&&(N.current=Mn(o,{startingIndex:te-te%b-1,disabledIndices:g}))):f&&(N.current=Mn(o,{startingIndex:te-te%b-1,disabledIndices:g})),Xb(N.current,b,xe)&&(N.current=te)),O.key===Lf&&(Pu(O),te%b!==0?(N.current=Mn(o,{startingIndex:te,disabledIndices:g,decrement:!0}),f&&Xb(N.current,b,xe)&&(N.current=Mn(o,{startingIndex:te+(b-te%b),decrement:!0,disabledIndices:g}))):f&&(N.current=Mn(o,{startingIndex:te+(b-te%b),decrement:!0,disabledIndices:g})),Xb(N.current,b,xe)&&(N.current=te));const ce=Math.floor(X/b)===xe;om(o,N.current)&&(f&&ce?N.current=O.key===Lf?X:Mn(o,{startingIndex:te-te%b-1,disabledIndices:g}):N.current=te),R(N.current);return}}if(p6(O.key,S)){if(Pu(O),n&&!h&&f6(O.currentTarget.ownerDocument)===O.currentTarget){N.current=NR(O.key,S,p)?j:X,R(N.current);return}NR(O.key,S,p)?f?N.current=F>=X?l&&F!==o.current.length?-1:j:Mn(o,{startingIndex:F,disabledIndices:g}):N.current=Math.min(X,Mn(o,{startingIndex:F,disabledIndices:g})):f?N.current=F<=j?l&&F!==-1?o.current.length:X:Mn(o,{startingIndex:F,decrement:!0,disabledIndices:g}):N.current=Math.max(j,Mn(o,{startingIndex:F,decrement:!0,disabledIndices:g})),om(o,N.current)?R(null):R(N.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":we},onKeyDown(O){if(J.current=!0,h&&n)return E(O);if((O.key.indexOf("Arrow")===0||O.key==="Enter"||O.key===" "||O.key==="")&&(Z.current=O.key),d){gMe(O.key,S,p)&&(Pu(O),n?(N.current=FR(o,g),R(N.current)):r(!0));return}p6(O.key,S)&&(c!=null&&(N.current=c),Pu(O),!n&&_?r(!0):E(O),n&&R(N.current))}},floating:{"aria-orientation":S==="both"?void 0:S,...h&&a!=null&&{"aria-activedescendant":we},onKeyDown:E,onPointerMove(){J.current=!1}},item:{onFocus(O){let{currentTarget:F}=O;const j=o.current.indexOf(F);j!==-1&&R(j)},onClick:O=>{let{currentTarget:F}=O;return F.focus({preventScroll:!0})},...m&&{onMouseMove(O){let{currentTarget:F}=O;const j=F;if(j){const X=o.current.indexOf(j);X!==-1&&R(X)}},onPointerLeave(){if(!J.current&&(N.current=-1,k(o,N),R(null),!h)){var O;(O=i.floating.current)==null||O.focus({preventScroll:!0})}}}}}:{}};function _Me(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=lwe(n),s=new RegExp(`\\s${u}$`),c=o?"^":"",l=r?new RegExp(`${c}${u}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${c}(?:^)?${u}[^\\s${u}]*`,"gm"),f=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!f)return null;const d=a.pos-f.length,p=Array.from(f.matchAll(l)).pop();if(!p||p.input===void 0||p.index===void 0)return null;const h=p.input.slice(Math.max(0,p.index-1),p.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!v)return null;const m=d+p.index;let _=m+p[0].length;return r&&s.test(f.slice(_-1,_+1))&&(p[0]+=" ",_+=1),m<a.pos&&_>=a.pos?{range:{from:m,to:_},query:p[0].slice(n.length),text:p[0]}:null}const SMe=new bu("suggestion");function $Me({pluginKey:e=SMe,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:u="suggestion",command:s=()=>null,items:c=()=>[],render:l=()=>({}),allow:f=()=>!0}){let d;const p=l==null?void 0:l(),h=new Gr({key:e,view(){return{update:async(v,m)=>{var _,g,S,b,$,T,M;const R=(_=this.key)===null||_===void 0?void 0:_.getState(m),q=(g=this.key)===null||g===void 0?void 0:g.getState(v.state),Y=R.active&&q.active&&R.range.from!==q.range.from,N=!R.active&&q.active,Z=R.active&&!q.active,ie=!N&&!Z&&R.query!==q.query,J=N||Y,ye=ie&&!Y,we=Z||Y;if(!J&&!ye&&!we)return;const x=we&&!J?R:q,k=v.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);d={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:E=>{s({editor:t,range:x.range,props:E})},decorationNode:k,clientRect:k?()=>{var E;const{decorationId:O}=(E=this.key)===null||E===void 0?void 0:E.getState(t.state),F=v.dom.querySelector(`[data-decoration-id="${O}"]`);return(F==null?void 0:F.getBoundingClientRect())||null}:null},J&&((S=p==null?void 0:p.onBeforeStart)===null||S===void 0||S.call(p,d)),ye&&((b=p==null?void 0:p.onBeforeUpdate)===null||b===void 0||b.call(p,d)),(ye||J)&&(d.items=await c({editor:t,query:x.query})),we&&(($=p==null?void 0:p.onExit)===null||$===void 0||$.call(p,d)),ye&&((T=p==null?void 0:p.onUpdate)===null||T===void 0||T.call(p,d)),J&&((M=p==null?void 0:p.onStart)===null||M===void 0||M.call(p,d))},destroy:()=>{var v;d&&((v=p==null?void 0:p.onExit)===null||v===void 0||v.call(p,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(v,m,_,g){const{isEditable:S}=t,{composing:b}=t.view,{selection:$}=v,{empty:T,from:M}=$,R={...m};if(R.composing=b,S&&(T||t.view.composing)){(M<m.range.from||M>m.range.to)&&!b&&!m.composing&&(R.active=!1);const q=_Me({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:$.$from}),Y=`id_${Math.floor(Math.random()*4294967295)}`;q&&f({editor:t,state:g,range:q.range})?(R.active=!0,R.decorationId=m.decorationId?m.decorationId:Y,R.range=q.range,R.query=q.query,R.text=q.text):R.active=!1}else R.active=!1;return R.active||(R.decorationId=null,R.range={from:0,to:0},R.query=null,R.text=null),R}},props:{handleKeyDown(v,m){var _;const{active:g,range:S}=h.getState(v.state);return g&&((_=p==null?void 0:p.onKeyDown)===null||_===void 0?void 0:_.call(p,{view:v,event:m,range:S}))||!1},decorations(v){const{active:m,range:_,decorationId:g}=h.getState(v);return m?Dt.create(v.doc,[Er.inline(_.from,_.to,{nodeName:a,class:u,"data-decoration-id":g})]):null}}});return h}function m6(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=m6(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function TMe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=m6(e))&&(r&&(r+=" "),r+=t);return r}const IMe=Jr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),So={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",preformatted:"preformatted",strong:"strong",em:"em",listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",image:"image",embed:"embed",hyperlink:"hyperlink",label:"label",span:"span"},e_=()=>(++e_.i).toString();e_.i=0;const OMe=e=>{const t=wMe(e),n=[];for(let r=0;r<t.length;r++)n.push(v6(t[r]));return{key:e_(),children:n}},am=(e,t=[])=>({key:e_(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),PR=e=>am({type:So.span,text:e,spans:[]}),wMe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===So.listItem||r.type===So.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===So.listItem?t[n]={type:So.list,items:i}:t[n]={type:So.oList,items:i}}}return t},v6=e=>{if("text"in e)return am(e,g6(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(v6(e.items[n]));return am(e,t)}return am(e)},g6=(e,t,n)=>{if(!e.length)return[PR(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],u=n&&n.start||0,s=a.start-u,c=a.end-u,l=t.text.slice(s,c),f=[];for(let p=o;p<r.length;p++){const h=r[p];h!==a&&h.start>=a.start&&h.end<=a.end&&(f.push(h),r.splice(p,1),p--)}o===0&&s>0&&i.push(PR(t.text.slice(0,s)));const d={...a,text:l};i.push(am(d,g6(f,{...t,text:l},a))),c<t.text.length&&i.push(PR(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},CMe=(e,t)=>y6(OMe(e).children,t),y6=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,y6(i.children,t),i.key);o!=null&&n.push(o)}return n};So.listItem+"",So.oListItem+"",So.list+"",So.oList+"";const EMe=Jr.create({name:"text",group:"inline"}),RMe={groupBy(e,t){return e.reduce((n,r)=>{const i=t(r),o=(n.get(i)||[]).concat(r);return n.set(i,o)},new Map)},sort(e){return[...e].sort((t,n)=>t.start-n.start)},mergeOverlap(e){const t=this.groupBy(e,r=>r.type),n=Array.from(t.entries()).map(([r,i])=>(this.sort(i).reduce((o,a)=>{if(!o.length)return[a];const u=o.length-1,s=o[u];return s.end>=a.start?[...o.slice(0,u),{...s,end:a.end}]:[...o,a]},[]),i)).reduce((r,i)=>[...r,...i],[]);return this.sort(n)}},b6={fromPrismic(e){return t=>{var n;return(n=DR.find(r=>r.richTextNodeTypes[0]===t.type))==null?void 0:n.converter.fromPrismic(e)(t)}},toPrismic(e,t,n){const[r,i]=(()=>{const o=DR.find(a=>e.type.name===a.name);if(!o)throw new Error(`Invalid mark extension '${e.type.name}'.`);return[o.richTextNodeTypes[0],o.converter.toPrismic(e)]})();return{type:r,start:t,end:n,...i?{data:i}:{}}}},_6=EMe.extend({name:"text"}),MMe={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return CMe([i],xMe(e,r))[0]}},toPrismic(e,t,n){const r=bc.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===qb.name?qb.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?bc.marks.map(o,d=>b6.toPrismic(d,s,c)):void 0)();return{...i,text:u,spans:l?[...i.spans,...l]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...RMe.mergeOverlap(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function xMe(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:qb.splitTextToNodes(e,i)(a=>e.text(a));{const a=b6.fromPrismic(e)(r);return a?S$(o).map(s=>s.mark([...s.marks,a].sort((c,l)=>c.type.name.localeCompare(l.type.name)))):S$(o)}}}const $c={name:_6.name,component:_6,converter:MMe};var S6=(e=>(e.LeftToRight="ltr",e.RightToLeft="rtl",e))(S6||{});const Tc="text-direction",kMe=Ve.RichTextNodeType.rtl,AMe=Rr.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Tc]:{default:"ltr",parseHTML:e=>e.attributes.dir?"rtl":"ltr",renderHTML:e=>e[Tc]==="rtl"?{dir:"rtl"}:{dir:"ltr"}}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case"rtl":return t.setRightToLeft();default:return t.setLeftToRight()}},toggleDirection:e=>({commands:t})=>{const n=e==="rtl"?"ltr":"rtl";return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Tc]:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Tc))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ia={parseNodeAttrsDirection(e){switch(e[Tc]){case"rtl":return"rtl";default:return"ltr"}},fromPrismic(e){const t=(()=>{switch(e.direction){case"rtl":return"rtl";default:return"ltr"}})();return{[Tc]:t}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}},t_=IMe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",bn(this.options.HTMLAttributes,e),0]}}),NMe={fromPrismic(e){return function(t){var r;const n=$c.converter.fromPrismic(e)(t_.name,t);return(r=e.nodes[t_.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return $c.converter.toPrismic(e,Ve.RichTextNodeType.paragraph,Ia.toPrismic(e))}},Wu=new Pf([Ve.RichTextNodeType.paragraph],t_.name,t_,NMe,"Type '/' for commands"),$6=["ArrowDown","ArrowUp","End","Home"],T6=["Enter"],FMe=["Escape",...$6,...T6],PMe=Rr.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=a_(R6,this.options.nodeTypes);return e.length>1?[$Me({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Wu.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new nRe(WMe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return FMe.includes(n.key)&&((r=t==null?void 0:t.ref)==null?void 0:r.handleKeyDown(n))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),WMe=U.forwardRef(function({command:t,decorationNode:n,editor:r,items:i},o){const[a,u]=U.useState(!0),s=parseFloat(C.tokens.space[0]),{context:c,floating:l,reference:f,strategy:d,x:p,y:h}=fMe({middleware:[URe(s),DRe(),BRe({limiter:zRe()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:nMe});U.useLayoutEffect(()=>{f(n)},[f,n]),U.useEffect(()=>{let N;const Z=()=>{N=window.setTimeout(()=>{u(!0)})},ie=()=>{u(!1)};return r.on("focus",Z).on("blur",ie),()=>{r.off("focus",Z).off("blur",ie),clearTimeout(N)}},[r]);const[v,m]=U.useState(0),_=U.useRef([]),[g,S]=U.useState();i!==g&&(m(0),_.current=[],S(i));const{getFloatingProps:b,getItemProps:$,getReferenceProps:T}=dMe([vMe(c,{outsidePointerDown:!1}),bMe(c,{activeIndex:v,listRef:_,onNavigate:N=>{m(Z=>N??Z)},openOnArrowKeyDown:!1,virtual:!0}),mMe(c,{role:"menu"})]),R=T().onKeyDown;U.useImperativeHandle(o,()=>({handleKeyDown:N=>{if(a){if($6.includes(N.key)&&R(N),T6.includes(N.key)){const Z=i[v];Z!==void 0&&t(Z)}return!0}else return!1}}),[v,t,i,R,a]);const q=p!==null&&h!==null,Y=U.useId();return a?I.jsxs("div",{...b(),className:C.dropdownMenuStyles.content,ref:l,style:{top:parseFloat(C.tokens.space[0]),left:parseFloat(C.tokens.space[0]),minWidth:256,position:d,transform:q?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((N,Z)=>U.createElement(I6,{...$({onClick:()=>{t(N)},onPointerDown:ie=>{ie.preventDefault()}}),"data-highlighted":Z===v?"":void 0,id:`${Y}[${Z}]`,key:N.nodeType,ref:ie=>{_.current[Z]=ie},shortcut:`/${N.shortText??""}`,startIcon:N.icon},N.text)),i.length===0?I.jsx(I6,{...$({onPointerDown:N=>{N.preventDefault()}}),disabled:!0,id:`${Y}[0]`,ref:N=>{_.current[0]=N},children:"No results"}):null]}):null}),I6=U.forwardRef(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return I.jsxs("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:C.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[U.isValidElement(i)?U.cloneElement(i,{className:TMe(i.props.className,C.dropdownMenuStyles.itemStartIcon)}):null,I.jsx(C.Text,{className:C.dropdownMenuStyles.itemText,component:"span",children:t}),r?I.jsx(C.Text,{className:C.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})});function jMe(e,t){var o;const n=t.map(a=>a.richTextNodeTypes).flat(),r=y(t,li(a=>a.nodeType===Ff.Text),dv({},(a,u)=>({...a,[u.name]:u.placeholder}))),i=n.includes(Ve.RichTextNodeType.orderedList)||n.includes(Ve.RichTextNodeType.list);return li(a=>a!==void 0)([bR.component(((o=e.config)==null?void 0:o.single)===void 0),$c.component,qb.component,ERe(r),i?Wf.component:void 0,PMe.configure({nodeTypes:n})])}const WR=yRe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",bn(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),LMe={fromPrismic(e){return function(t){var r;const n=Wf.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[WR.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return GS(bc.children.map(e,t=>li(n=>n!==void 0)(Wf.converter.toPrismic(t,Ve.RichTextNodeType.list))))}},n_=new vR([Ve.RichTextNodeType.list],WR.name,WR,LMe),DMe=/^```([a-z]+)?[\s\n]$/,qMe=/^~~~([a-z]+)?[\s\n]$/,r_=Jr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",bn(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},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:()=>{const{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},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
139
+ `}}function s(g){return r.exact(r.intersection([r.type({id:r.string,label:o.StringOrNull,repeatable:(0,i.withFallback)(r.boolean,!0),json:r.record(r.string,g),status:(0,i.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,i.withFallback)(r.keyof(e.CustomTypeFormat),"custom")})]))}e.StaticCustomType=s(a.StaticSection),e.CustomType=s(a.DynamicSection);function c(g){return Object.entries(g.json).reduce((b,[,S])=>{const O=Object.entries(S);return b.concat(O)},[])}e.flattenWidgets=c;function l(g){return c(g).filter(([,O])=>O.type==="Slices").reduce((O,[,y])=>{const C=Object.entries(y.config&&y.config.choices?y.config.choices:{}).filter(([,I])=>I.type==="SharedSlice").map(([I])=>I);return O.concat(C)},[])}function f(g){const b=l(g);return function(S){return b.map(S)}}function d(g,b){const S=Object.entries(g.json).reduce((O,[y,C])=>({...O,[y]:a.Sections.toStatic(C,b)}),{});return{...g,json:S}}e.toStatic=d;function p(g,b){const S=f(g)(O=>{if(!b.get(O))return O}).filter(Boolean);return S.length>0?(0,n.left)(new u(S)):(0,n.right)(g)}e.validateSlices=p;function h(g,b){const S=Object.entries(g.json).reduce((O,[y,C])=>{const I=Object.entries(C).reduce((M,[R,U])=>{const q=b(R,U);return q?{...M,[R]:q}:M},{});return{...O,[y]:I}},{});return{...g,json:S}}e.collectWidgets=h;function v(g,b){return h(g,(S,O)=>{if(O.type==="Slices"){if(!O.config||!O.config.choices)return O;const y=Object.entries(O.config.choices).reduce((I,[M,R])=>R.type==="SharedSlice"&&!b.get(M)?I:{...I,[M]:R},{}),C={...O.config,choices:y};return{...O,config:C}}return O})}e.filterMissingSharedSlices=v}(T5);var I5={},Xb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiffOperation=void 0,function(t){t.Added="added",t.Removed="removed",t.Updated="updated"}(e.DiffOperation||(e.DiffOperation={}))})(Xb);var Qb={},Cc={},e_={};Object.defineProperty(e_,"__esModule",{value:!0}),e_.toRecord=void 0;function TMe(e,t){return e.reduce((n,r)=>{const i=t(r);return{...n,[i]:r}},{})}e_.toRecord=TMe,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.Objects=Cc.Arrays=void 0;const O5=G;Cc.Arrays=(0,O5.__importStar)(e_),Cc.Objects=(0,O5.__importStar)(ya);var um={};Object.defineProperty(um,"__esModule",{value:!0}),um.VariationComparator=void 0;const t_=Cc,Hf=Xb;function IMe(e,t){const n=t_.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="primary"||i==="items"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}function C5(e,t){const n=t_.Objects.zipObjects(e,t),r=Object.entries(n).reduce((i,[o,a])=>{if(JSON.stringify(a==null?void 0:a.left)===JSON.stringify(a==null?void 0:a.right))return i;const u=(()=>{if(!(!(a!=null&&a.left)&&!(a!=null&&a.right)))return a!=null&&a.left&&!a.right?{op:Hf.DiffOperation.Removed}:!(a!=null&&a.left)&&(a!=null&&a.right)?{op:Hf.DiffOperation.Added,value:a.right}:{op:Hf.DiffOperation.Updated,value:a.right}})();return u?{...i,[o]:u}:i},{});return t_.Objects.isNotEmpty(r)?r:void 0}um.VariationComparator={compare(e,t){if(e&&!t)return{op:Hf.DiffOperation.Removed};if(!e&&t)return{op:Hf.DiffOperation.Added,value:t};const n=IMe(e,t),r=C5(e==null?void 0:e.primary,t==null?void 0:t.primary),i=C5(e==null?void 0:e.items,t==null?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(t_.Objects.isNotEmpty(o))return{op:Hf.DiffOperation.Updated,value:o}}},Object.defineProperty(Qb,"__esModule",{value:!0}),Qb.SliceComparator=void 0;const Gf=Cc,WR=Xb,OMe=um;function CMe(e,t){const n=Gf.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="variations"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}Qb.SliceComparator={compare(e,t){if(!e&&t)return{op:WR.DiffOperation.Added,value:t};if(e&&!t)return{op:WR.DiffOperation.Removed};const n=CMe(e,t),r=Gf.Objects.zipObjects(e&&Gf.Arrays.toRecord(e.variations,a=>a.id),t&&Gf.Arrays.toRecord(t.variations,a=>a.id)),i=Object.entries(r).reduce((a,[u,s])=>{if(!s)return a;const c=OMe.VariationComparator.compare(s.left,s.right);return c?{...a,[u]:c}:a},{}),o={...n,...Gf.Objects.isNotEmpty(i)?{variations:i}:{}};if(Gf.Objects.isNotEmpty(o))return{op:WR.DiffOperation.Updated,value:o}}},function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(Xb,e),(0,t.__exportStar)(Qb,e),(0,t.__exportStar)(um,e)}(I5),function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=G;(0,t.__exportStar)(T5,e),(0,t.__exportStar)(I5,e),(0,t.__exportStar)(Li,e),(0,t.__exportStar)(fo,e)}(Be);const wMe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,EMe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,RMe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,MMe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,xMe=Yh.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",xt(this.options.HTMLAttributes,e),0]},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[Ub({find:wMe,type:this.type}),Ub({find:RMe,type:this.type})]},addPasteRules(){return[qb({find:EMe,type:this.type}),qb({find:MMe,type:this.type})]}});var LR=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(LR||{}),Yf=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(Yf||{});class kMe{constructor(t,n,r){ad(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class w5{constructor(t,n,r,i){ad(this,"extType","mark");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class Jf{constructor(t,n,r,i,o,a=!1){ad(this,"extType","node");ad(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}class AMe extends Jf{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class jR extends Jf{constructor(t,n,r,i){super(t,n,r,i)}}const DR=xMe.extend({name:"bold"}),FMe={fromPrismic(e){return function(){var t;return(t=e.marks[DR.name])==null?void 0:t.create()}},toPrismic(){}},E5=new w5([Be.RichTextNodeType.strong],DR.name,DR,FMe),NMe=cr.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",xt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),R5=Yh.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",xt(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=jb(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),M5=/^\s*([-+*])\s$/,PMe=cr.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",xt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(NMe.name,this.editor.getAttributes(R5.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Bb({find:M5,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Bb({find:M5,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(R5.name),editor:this.editor})),[e]}}),x5=cr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",xt(this.options.HTMLAttributes,e)]},renderText(){return`
140
+ `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:u}=r.extensionManager,s=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:l})=>{if(l&&s&&a){const f=s.filter(d=>u.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),wc={isHardBreak(e){return e.type.name===x5.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function WMe(e){if(!e||!e.size)return{defaultTextConverter:void 0,extensions:IH()};const t=IH(e),n=Array.from(e.values()),r=(()=>{const a=di(c=>n.some(l=>c.richTextNodeTypes.includes(l)))(t),u=a.some(c=>c instanceof jR)?[Vu,...a]:a;return u.some(c=>c instanceof Jf)?u:[TH,...u]})(),i=r.find(a=>a instanceof Jf)||TH;function o(a){return u=>i.converter.fromPrismic(a)({...u,type:i.richTextNodeTypes[0]})}return{defaultTextConverter:o,extensions:r}}function LMe(e){if(!(e!=null&&e.single)&&!(e!=null&&e.multi))return;const t=m((e.single||e.multi||"").split(/\s*,\s*/),gv(n=>xS(()=>{})(Be.RichTextNodeTypeCodec.decode(n))),di(bu));return new Set(t)}function jMe(e){const t=LMe(e);return WMe(t)}const DMe=cr.create({name:"doc",topNode:!0,content:"block+"}),k5=cr.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",xt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),Zf={component:k5,converter:{fromPrismic(e){return function(t){var r;const n=Vu.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[k5.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return wc.children.reduce(e,(n,r)=>{const i=Vu.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},placeholder:"List"};function UMe(e){return e.slice(1,e.length).reduce((t,n)=>t.copy(t.content.append(n.content)),e[0])}const UR="document",BMe=e=>DMe.extend({name:UR,content:e?"block+":"block"}),qMe=e=>({fromPrismic(t,n){function r(i){return function(o=void 0){return!o&&n&&Qe.TextBlock.is(i)?n(i):o}}return function(i){var a;const o=i.value.reduce((u,s)=>{const c=e.find(h=>h.richTextNodeTypes.includes(s.type)),l=(()=>{if(c)switch(c.nodeType){case Yf.Embed:return Qe.EmbedBlock.is(s)&&c.converter.fromPrismic(t)(s);case Yf.Text:return Qe.TextBlock.is(s)&&c.converter.fromPrismic(t)(s);case Yf.Image:return Qe.ImageBlock.is(s)&&c.converter.fromPrismic(t)(s);default:return}})(),[f,d]=m(u,n$(u.length-1),([h,v])=>[h,t$(v)]),p=(()=>l?m(d,Uo(()=>({merged:!1,node:l}),h=>l.type.name===h.type.name&&(l.type.name===b_.name||l.type.name===S_.name)?{merged:!0,node:UMe([h,l])}:{merged:!1,node:l}),({merged:h,node:v})=>({merged:h,node:r(s)(v)})):{merged:!1,node:r(s)()})();return p.node?[...p.merged?f:u,p.node]:u},[]);return(a=t.nodes[UR])==null?void 0:a.create({},o)}},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...wc.children.reduce(t,(r,i)=>{const o=Object.values(e).find(u=>i.type.name===u.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[])]}}}),BR=new kMe(UR,BMe,qMe),n_=x5.extend({name:"hard_break"}),r_=`
141
+ `,A5={fromPrismic(e){return function(t){var n;if(t===r_)return(n=e.nodes[n_.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===n_.name)return r_}},qR={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function zMe(e,t){return function(n){const r=A5.fromPrismic(e)(r_);if(!r)return[n(t)];const i=t.split(r_);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>qR.isFirst(u)?qR.isEmptyLine(a)?o:[...o,n(a)]:qR.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const i_={name:n_.name,component:n_,converter:A5,splitTextToNodes:zMe},KMe=sr.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Er({key:new Fi("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=e.type.createAndFill(),a=(o==null?void 0:o.sameMarkup(e))&&o.content.findDiffStart(e.content)===null;return e.descendants((u,s)=>{const c=r>=s&&r<=s+u.nodeSize,l=!u.isLeaf&&!u.childCount;if((c||!this.options.showOnlyCurrent)&&l){const f=[this.options.emptyNodeClass];a&&f.push(this.options.emptyEditorClass);const d=Mr.node(s,s+u.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:u,pos:s,hasAnchor:c}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Pt.create(e,i)}}})]}}),VMe="Type '/' for commands",HMe=e=>KMe.configure({includeChildren:!0,placeholder:t=>GMe({props:t,params:e}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function GMe({props:e,params:t}){const{editor:n,hasAnchor:r,node:i}=e,{placeholderByNodeType:o,unfocusedPlaceholder:a,nodeExtensions:u}=t,s=!wc.children.exists(n.state.doc,S=>S===i),c=n.isEditable,l=n.isFocused&&r,f=i.type.name!==Vu.name,d=l||f||s,p=u.length>1;function h(S){return S===VMe?c&&d&&p:c&&d}function v(){if(s)return Zf.placeholder;const S=o[i.type.name];return typeof S=="string"?S:S==null?void 0:S(i.attrs)}const g=v(),b=h(g);return a&&!l&&n.isEmpty?a:b&&g||""}function o_(e){return e.split("-")[1]}function F5(e){return e==="y"?"height":"width"}function Uu(e){return e.split("-")[0]}function sm(e){return["top","bottom"].includes(Uu(e))?"x":"y"}function N5(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,u=sm(t),s=F5(u),c=r[s]/2-i[s]/2,l=Uu(t),f=u==="x";let d;switch(l){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(o_(t)){case"start":d[u]-=c*(n&&f?-1:1);break;case"end":d[u]+=c*(n&&f?-1:1);break}return d}const YMe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=o.filter(Boolean),s=await(a.isRTL==null?void 0:a.isRTL(t));if(process.env.NODE_ENV!=="production"){if(a==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),u.filter(v=>{let{name:g}=v;return g==="autoPlacement"||g==="flip"}).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));(!e||!t)&&console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=N5(c,r,s),d=r,p={},h=0;for(let v=0;v<u.length;v++){const{name:g,fn:b}=u[v],{x:S,y:O,data:y,reset:C}=await b({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});if(l=S??l,f=O??f,p={...p,[g]:{...p[g],...y}},process.env.NODE_ENV!=="production"&&h>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),C&&h<=50){h++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:l,y:f}=N5(c,d,s)),v=-1;continue}}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};function JMe(e){return{top:0,right:0,bottom:0,left:0,...e}}function ZMe(e){return typeof e!="number"?JMe(e):{top:e,right:e,bottom:e,left:e}}function zR(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function P5(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:u,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=ZMe(p),g=u[d?f==="floating"?"reference":"floating":f],b=zR(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),S=f==="floating"?{...a.floating,x:r,y:i}:a.reference,O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),y=await(o.isElement==null?void 0:o.isElement(O))?await(o.getScale==null?void 0:o.getScale(O))||{x:1,y:1}:{x:1,y:1},C=zR(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:O,strategy:s}):S);return process.env.NODE_ENV,{top:(b.top-C.top+h.top)/y.y,bottom:(C.bottom-b.bottom+h.bottom)/y.y,left:(b.left-C.left+h.left)/y.x,right:(C.right-b.right+h.right)/y.x}}const XMe=Math.min,QMe=Math.max;function W5(e,t,n){return QMe(e,XMe(t,n))}const exe={left:"right",right:"left",bottom:"top",top:"bottom"};function a_(e){return e.replace(/left|right|bottom|top/g,t=>exe[t])}function txe(e,t,n){n===void 0&&(n=!1);const r=o_(e),i=sm(e),o=F5(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=a_(a)),{main:a,cross:a_(a)}}const nxe={start:"end",end:"start"};function KR(e){return e.replace(/start|end/g,t=>nxe[t])}function rxe(e){const t=a_(e);return[KR(e),t,KR(t)]}function ixe(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function oxe(e,t,n,r){const i=o_(e);let o=ixe(Uu(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(KR)))),o}const axe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:u,elements:s}=t,{mainAxis:c=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...v}=e,g=Uu(r),b=Uu(a)===a,S=await(u.isRTL==null?void 0:u.isRTL(s.floating)),O=f||(b||!h?[a_(a)]:rxe(a));!f&&p!=="none"&&O.push(...oxe(a,h,p,S));const y=[a,...O],C=await P5(t,v),I=[];let M=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&I.push(C[g]),l){const{main:N,cross:Z}=txe(r,o,S);I.push(C[N],C[Z])}if(M=[...M,{placement:r,overflows:I}],!I.every(N=>N<=0)){var R,U;const N=(((R=i.flip)==null?void 0:R.index)||0)+1,Z=y[N];if(Z)return{data:{index:N,overflows:M},reset:{placement:Z}};let ee=(U=M.filter(J=>J.overflows[0]<=0).sort((J,ve)=>J.overflows[1]-ve.overflows[1])[0])==null?void 0:U.placement;if(!ee)switch(d){case"bestFit":{var q;const J=(q=M.map(ve=>[ve.placement,ve.overflows.filter(Ie=>Ie>0).reduce((Ie,k)=>Ie+k,0)]).sort((ve,Ie)=>ve[1]-Ie[1])[0])==null?void 0:q[0];J&&(ee=J);break}case"initialPlacement":ee=a;break}if(r!==ee)return{reset:{placement:ee}}}return{}}}};async function uxe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Uu(n),u=o_(n),s=sm(n)==="x",c=["left","top"].includes(a)?-1:1,l=o&&s?-1:1,f=typeof t=="function"?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return u&&typeof h=="number"&&(p=u==="end"?h*-1:h),s?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const sxe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await uxe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function L5(e){return e==="x"?"y":"x"}const cxe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:g=>{let{x:b,y:S}=g;return{x:b,y:S}}},...s}=e,c={x:n,y:r},l=await P5(t,s),f=sm(Uu(i)),d=L5(f);let p=c[f],h=c[d];if(o){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",S=p+l[g],O=p-l[b];p=W5(S,p,O)}if(a){const g=d==="y"?"top":"left",b=d==="y"?"bottom":"right",S=h+l[g],O=h-l[b];h=W5(S,h,O)}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},lxe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=e,l={x:n,y:r},f=sm(i),d=L5(f);let p=l[f],h=l[d];const v=typeof u=="function"?u(t):u,g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const O=f==="y"?"height":"width",y=o.reference[f]-o.floating[O]+g.mainAxis,C=o.reference[f]+o.reference[O]-g.mainAxis;p<y?p=y:p>C&&(p=C)}if(c){var b,S;const O=f==="y"?"width":"height",y=["top","left"].includes(Uu(i)),C=o.reference[d]-o.floating[O]+(y&&((b=a.offset)==null?void 0:b[d])||0)+(y?0:g.crossAxis),I=o.reference[d]+o.reference[O]+(y?0:((S=a.offset)==null?void 0:S[d])||0)-(y?g.crossAxis:0);h<C?h=C:h>I&&(h=I)}return{[f]:p,[d]:h}}}};function Ar(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Co(e){return Ar(e).getComputedStyle(e)}const j5=Math.min,cm=Math.max,u_=Math.round;function D5(e){const t=Co(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=u_(n)!==i||u_(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Bu(e){return B5(e)?(e.nodeName||"").toLowerCase():""}let s_;function U5(){if(s_)return s_;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(s_=e.brands.map(t=>t.brand+"/"+t.version).join(" "),s_):navigator.userAgent}function wo(e){return e instanceof Ar(e).HTMLElement}function ji(e){return e instanceof Ar(e).Element}function B5(e){return e instanceof Ar(e).Node}function q5(e){if(typeof ShadowRoot>"u")return!1;const t=Ar(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function c_(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Co(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function fxe(e){return["table","td","th"].includes(Bu(e))}function VR(e){const t=/firefox/i.test(U5()),n=Co(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||(r?r!=="none":!1)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null?o.includes(i):!1})}function HR(){return/^((?!chrome|android).)*safari/i.test(U5())}function GR(e){return["html","body","#document"].includes(Bu(e))}function z5(e){return ji(e)?e:e.contextElement}const K5={x:1,y:1};function Xf(e){const t=z5(e);if(!wo(t))return K5;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=D5(t);let a=(o?u_(n.width):n.width)/r,u=(o?u_(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}function Ec(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=z5(e);let s=K5;t&&(r?ji(r)&&(s=Xf(r)):s=Xf(e));const c=u?Ar(u):window,l=HR()&&n;let f=(a.left+(l&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/s.x,d=(a.top+(l&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/s.y,p=a.width/s.x,h=a.height/s.y;if(u){const v=Ar(u),g=r&&ji(r)?Ar(r):r;let b=v.frameElement;for(;b&&r&&g!==v;){const S=Xf(b),O=b.getBoundingClientRect(),y=getComputedStyle(b);O.x+=(b.clientLeft+parseFloat(y.paddingLeft))*S.x,O.y+=(b.clientTop+parseFloat(y.paddingTop))*S.y,f*=S.x,d*=S.y,p*=S.x,h*=S.y,f+=O.x,d+=O.y,b=Ar(b).frameElement}}return{width:p,height:h,top:d,right:f+p,bottom:d+h,left:f,x:f,y:d}}function qu(e){return((B5(e)?e.ownerDocument:e.document)||window.document).documentElement}function l_(e){return ji(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dxe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=wo(n),o=qu(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},u={x:1,y:1};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Bu(n)!=="body"||c_(o))&&(a=l_(n)),wo(n))){const c=Ec(n);u=Xf(n),s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-a.scrollLeft*u.x+s.x,y:t.y*u.y-a.scrollTop*u.y+s.y}}function V5(e){return Ec(qu(e)).left+l_(e).scrollLeft}function pxe(e){const t=qu(e),n=l_(e),r=e.ownerDocument.body,i=cm(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=cm(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+V5(e);const u=-n.scrollTop;return Co(r).direction==="rtl"&&(a+=cm(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:u}}function lm(e){if(Bu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||q5(e)&&e.host||qu(e);return q5(t)?t.host:t}function H5(e){const t=lm(e);return GR(t)?t.ownerDocument.body:wo(t)&&c_(t)?t:H5(t)}function Rc(e,t){var n;t===void 0&&(t=[]);const r=H5(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Ar(r);return i?t.concat(o,o.visualViewport||[],c_(r)?r:[]):t.concat(r,Rc(r))}function hxe(e,t){const n=Ar(e),r=qu(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;const c=HR();(!c||c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}function mxe(e,t){const n=Ec(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=wo(e)?Xf(e):{x:1,y:1},a=e.clientWidth*o.x,u=e.clientHeight*o.y,s=i*o.x,c=r*o.y;return{width:a,height:u,x:s,y:c}}function G5(e,t,n){let r;if(t==="viewport")r=hxe(e,n);else if(t==="document")r=pxe(qu(e));else if(ji(t))r=mxe(t,n);else{const a={...t};if(HR()){var i,o;const u=Ar(e);a.x-=((i=u.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=u.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return zR(r)}function vxe(e,t){const n=t.get(e);if(n)return n;let r=Rc(e).filter(u=>ji(u)&&Bu(u)!=="body"),i=null;const o=Co(e).position==="fixed";let a=o?lm(e):e;for(;ji(a)&&!GR(a);){const u=Co(a),s=VR(a);u.position==="fixed"?i=null:(o?!s&&!i:!s&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position))?r=r.filter(f=>f!==a):i=u,a=lm(a)}return t.set(e,r),r}function gxe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?vxe(t,this._c):[].concat(n),r],u=a[0],s=a.reduce((c,l)=>{const f=G5(t,l,i);return c.top=cm(f.top,c.top),c.right=j5(f.right,c.right),c.bottom=j5(f.bottom,c.bottom),c.left=cm(f.left,c.left),c},G5(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function yxe(e){return wo(e)?D5(e):e.getBoundingClientRect()}function Y5(e,t){return!wo(e)||Co(e).position==="fixed"?null:t?t(e):e.offsetParent}function bxe(e){let t=lm(e);for(;wo(t)&&!GR(t);){if(VR(t))return t;t=lm(t)}return null}function J5(e,t){const n=Ar(e);let r=Y5(e,t);for(;r&&fxe(r)&&Co(r).position==="static";)r=Y5(r,t);return r&&(Bu(r)==="html"||Bu(r)==="body"&&Co(r).position==="static"&&!VR(r))?n:r||bxe(e)||n}function _xe(e,t,n){const r=wo(t),i=qu(t),o=Ec(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((Bu(t)!=="body"||c_(i))&&(a=l_(t)),wo(t)){const s=Ec(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=V5(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}const $xe={getClippingRect:gxe,convertOffsetParentRelativeRectToViewportRelativeRect:dxe,isElement:ji,getDimensions:yxe,getOffsetParent:J5,getDocumentElement:qu,getScale:Xf,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||J5,o=this.getDimensions;return{reference:_xe(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Co(e).direction==="rtl"};function Sxe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,c=s||o?[...ji(e)?Rc(e):e.contextElement?Rc(e.contextElement):[],...Rc(t)]:[];c.forEach(h=>{s&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let l=null;if(a){let h=!0;l=new ResizeObserver(()=>{h||n(),h=!1}),ji(e)&&!u&&l.observe(e),!ji(e)&&e.contextElement&&!u&&l.observe(e.contextElement),l.observe(t)}let f,d=u?Ec(e):null;u&&p();function p(){const h=Ec(e);d&&(h.x!==d.x||h.y!==d.y||h.width!==d.width||h.height!==d.height)&&n(),d=h,f=requestAnimationFrame(p)}return n(),()=>{var h;c.forEach(v=>{s&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),(h=l)==null||h.disconnect(),l=null,u&&cancelAnimationFrame(f)}}const Txe=(e,t,n)=>{const r=new Map,i={platform:$xe,...n},o={...i.platform,_c:r};return YMe(e,t,{...i,platform:o})};var f_=typeof document<"u"?j.useLayoutEffect:j.useEffect;function d_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!d_(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!d_(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Z5(e){const t=_e.useRef(e);return f_(()=>{t.current=e}),t}function Ixe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[u,s]=_e.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,l]=_e.useState(r);d_(c,r)||l(r);const f=_e.useRef(null),d=_e.useRef(null),p=_e.useRef(u),h=Z5(o),v=Z5(i),[g,b]=_e.useState(null),[S,O]=_e.useState(null),y=_e.useCallback(q=>{f.current!==q&&(f.current=q,b(q))},[]),C=_e.useCallback(q=>{d.current!==q&&(d.current=q,O(q))},[]),I=_e.useCallback(()=>{if(!f.current||!d.current)return;const q={placement:t,strategy:n,middleware:c};v.current&&(q.platform=v.current),Txe(f.current,d.current,q).then(N=>{const Z={...N,isPositioned:!0};M.current&&!d_(p.current,Z)&&(p.current=Z,PH.flushSync(()=>{s(Z)}))})},[c,t,n,v]);f_(()=>{a===!1&&p.current.isPositioned&&(p.current.isPositioned=!1,s(q=>({...q,isPositioned:!1})))},[a]);const M=_e.useRef(!1);f_(()=>(M.current=!0,()=>{M.current=!1}),[]),f_(()=>{if(g&&S){if(h.current)return h.current(g,S,I);I()}},[g,S,I,h]);const R=_e.useMemo(()=>({reference:f,floating:d,setReference:y,setFloating:C}),[y,C]),U=_e.useMemo(()=>({reference:g,floating:S}),[g,S]);return _e.useMemo(()=>({...u,update:I,refs:R,elements:U,reference:y,floating:C}),[u,I,R,U,y,C])}var zu=typeof document<"u"?j.useLayoutEffect:j.useEffect;function Oxe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let YR=!1,Cxe=0;const X5=()=>"floating-ui-"+Cxe++;function wxe(){const[e,t]=_e.useState(()=>YR?X5():void 0);return zu(()=>{e==null&&t(X5())},[]),_e.useEffect(()=>{YR||(YR=!0)},[]),e}const Q5=_e["useId".toString()],eH=Q5??wxe,Exe=_e.createContext(null),Rxe=_e.createContext(null),tH=()=>{var e,t;return(e=(t=_e.useContext(Exe))==null?void 0:t.id)!=null?e:null},JR=()=>_e.useContext(Rxe);function ZR(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function nH(e){var t;return(t=ZR(e).defaultView)!=null?t:window}function p_(e){return e?e instanceof nH(e).Element:!1}function Mxe(e){return e?e instanceof nH(e).HTMLElement:!1}const rH=_e["useInsertionEffect".toString()];function XR(e){const t=_e.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return rH?rH(()=>{t.current=e}):t.current=e,_e.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function xxe(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=_e.useState(null),l=JR(),f=_e.useRef(null),d=_e.useRef({}),p=_e.useState(()=>Oxe())[0],h=Ixe({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=XR(n),g=_e.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),b=_e.useMemo(()=>({...h,refs:g,dataRef:d,nodeId:u,events:p,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,p,t,v,g,s]);zu(()=>{const y=l==null?void 0:l.nodesRef.current.find(C=>C.id===u);y&&(y.context=b)});const{reference:S}=h,O=_e.useCallback(y=>{(p_(y)||y===null)&&(b.refs.domReference.current=y,c(y)),S(y)},[S,b.refs]);return _e.useMemo(()=>({...h,context:b,refs:g,reference:O}),[h,g,b,O])}function QR(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[u,s]=a;if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof s=="function"){var c;(c=r.get(u))==null||c.push(s),i[u]=function(){for(var l,f=arguments.length,d=new Array(f),p=0;p<f;p++)d[p]=arguments[p];(l=r.get(u))==null||l.forEach(h=>h(...d))}}}else i[u]=s}),i),{})}}const kxe=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>QR(t,e,"reference"),getFloatingProps:t=>QR(t,e,"floating"),getItemProps:t=>QR(t,e,"item")}};function eM(e,t){var n;let r=(n=e.filter(a=>{var u;return a.parentId===t&&((u=a.context)==null?void 0:u.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var u;return(u=i)==null?void 0:u.some(s=>{var c;return a.parentId===s.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function iH(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Axe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ku(e){e.preventDefault(),e.stopPropagation()}function Fxe(e){const t=j.useRef(e);return zu(()=>{t.current=e}),t}function oH(e){const t=j.useRef();return zu(()=>{t.current=e},[e]),t.current}const Nxe=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=eH(),a=eH(),u={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:u}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...u,...i==="menu"&&{"aria-labelledby":a}}}:{}};function tM(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const Pxe=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:u=!0,escapeKey:s=!0,outsidePointerDown:c=!0,referencePointerDown:l=!1,ancestorScroll:f=!1,bubbles:d=!0}=t===void 0?{}:t;const p=JR(),h=tH()!=null,v=_e.useRef(!1);return _e.useEffect(()=>{if(!n||!u)return;function g(C){if(C.key==="Escape"){if(!d&&p&&eM(p.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function b(C){const I=v.current;if(v.current=!1,I)return;const M=Axe(C);if(p_(M)&&i.floating.current){var R;const q=(R=i.floating.current.ownerDocument.defaultView)!=null?R:window,N=M.scrollWidth>M.clientWidth,Z=M.scrollHeight>M.clientHeight;let ee=Z&&C.offsetX>M.clientWidth;if(Z&&q.getComputedStyle(M).direction==="rtl"&&(ee=C.offsetX<=M.offsetWidth-M.clientWidth),ee||N&&C.offsetY>M.clientHeight)return}const U=p&&eM(p.nodesRef.current,a).some(q=>{var N;return tM(C,(N=q.context)==null?void 0:N.refs.floating.current)});tM(C,i.floating.current)||tM(C,i.domReference.current)||U||!d&&p&&eM(p.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function S(){r(!1)}const O=ZR(i.floating.current);s&&O.addEventListener("keydown",g),c&&O.addEventListener("pointerdown",b);const y=(f?[...p_(i.reference.current)?Rc(i.reference.current):[],...p_(i.floating.current)?Rc(i.floating.current):[]]:[]).filter(C=>{var I;return C!==((I=O.defaultView)==null?void 0:I.visualViewport)});return y.forEach(C=>C.addEventListener("scroll",S,{passive:!0})),()=>{s&&O.removeEventListener("keydown",g),c&&O.removeEventListener("pointerdown",b),y.forEach(C=>C.removeEventListener("scroll",S))}},[s,c,o,p,a,n,r,f,u,d,i,h]),u?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},nM="ArrowUp",h_="ArrowDown",Qf="ArrowLeft",fm="ArrowRight";function m_(e,t,n){return Math.floor(e/t)!==n}function dm(e,t){return t<0||t>=e.current.length}function Rn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let u=n;do{var s,c;u=u+(r?-o:o)}while(u>=0&&u<=a.length-1&&(i?i.includes(u):a[u]==null||(s=a[u])!=null&&s.hasAttribute("disabled")||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function v_(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function aH(e,t){return v_(t,e===nM||e===h_,e===Qf||e===fm)}function rM(e,t,n){return v_(t,e===h_,n?e===Qf:e===fm)||e==="Enter"||e==" "||e===""}function Wxe(e,t,n){return v_(t,n?e===Qf:e===fm,e===h_)}function Lxe(e,t,n){return v_(t,n?e===fm:e===Qf,e===nM)}function iM(e,t){return Rn(e,{disabledIndices:t})}function uH(e,t){return Rn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const jxe=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:u=()=>{},enabled:s=!0,selectedIndex:c=null,allowEscape:l=!1,loop:f=!1,nested:d=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:v="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:b=!0,disabledIndices:S=void 0,orientation:O="vertical",cols:y=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(l&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),h||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),O==="vertical"&&y>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const C=tH(),I=JR(),M=oH(n),R=XR(u),U=XR(oH(u)),q=_e.useRef(v),N=_e.useRef(c??-1),Z=_e.useRef(null),ee=Fxe(S),J=_e.useRef(!1),ve=_e.useRef(-1),[Ie,k]=_e.useState(),A=_e.useCallback(($,x)=>{ve.current=requestAnimationFrame(()=>{if(h){var L;k((L=$.current[x.current])==null?void 0:L.id)}else{var X;(X=$.current[x.current])==null||X.focus({preventScroll:!0})}})},[h]);zu(()=>{s&&(!M&&n&&q.current&&c!=null&&R(c),M&&!n&&(cancelAnimationFrame(ve.current),N.current=-1,U(null)))},[n,M,c,o,A,s,R,U]),zu(()=>{if(s&&n)if(a==null){if(c!=null)return;M&&(N.current=-1,A(o,N)),!M&&q.current&&(Z.current!=null||q.current===!0&&Z.current==null)&&(N.current=Z.current==null||rM(Z.current,O,p)||d?iM(o,ee.current):uH(o,ee.current),R(N.current),A(o,N))}else dm(o,a)||(N.current=a,A(o,N))},[n,M,a,c,d,o,R,A,s,l,O,p,h,ee]),zu(()=>{if(s&&!n&&M){var $,x;const L=I==null||($=I.nodesRef.current.find(X=>X.id===C))==null||(x=$.context)==null?void 0:x.refs.floating.current;L&&!L.contains(iH(ZR(L)))&&L.focus({preventScroll:!0})}},[s,n,M,I,C]),zu(()=>{Z.current=null});function T($){if(J.current=!0,d&&Lxe($.key,O,p)){Ku($),r(!1),Mxe(i.domReference.current)&&i.domReference.current.focus();return}const x=N.current,L=iM(o,S),X=uH(o,S);if($.key==="Home"&&(N.current=L,R(N.current)),$.key==="End"&&(N.current=X,R(N.current)),y>1){const ne=N.current;if($.key===nM){if(Ku($),ne===-1)N.current=X;else if(N.current=Rn(o,{startingIndex:ne,amount:y,decrement:!0,disabledIndices:S}),f&&(ne-y<L||N.current<0)){const xe=ne%y,se=X%y,Ae=X-(se-xe);se===xe?N.current=X:N.current=se>xe?Ae:Ae-y}dm(o,N.current)&&(N.current=ne),R(N.current)}if($.key===h_&&(Ku($),ne===-1?N.current=L:(N.current=Rn(o,{startingIndex:ne,amount:y,disabledIndices:S}),f&&ne+y>X&&(N.current=Rn(o,{startingIndex:ne%y-y,amount:y,disabledIndices:S}))),dm(o,N.current)&&(N.current=ne),R(N.current)),O==="both"){const xe=Math.floor(ne/y);$.key===fm&&(Ku($),ne%y!==y-1?(N.current=Rn(o,{startingIndex:ne,disabledIndices:S}),f&&m_(N.current,y,xe)&&(N.current=Rn(o,{startingIndex:ne-ne%y-1,disabledIndices:S}))):f&&(N.current=Rn(o,{startingIndex:ne-ne%y-1,disabledIndices:S})),m_(N.current,y,xe)&&(N.current=ne)),$.key===Qf&&(Ku($),ne%y!==0?(N.current=Rn(o,{startingIndex:ne,disabledIndices:S,decrement:!0}),f&&m_(N.current,y,xe)&&(N.current=Rn(o,{startingIndex:ne+(y-ne%y),decrement:!0,disabledIndices:S}))):f&&(N.current=Rn(o,{startingIndex:ne+(y-ne%y),decrement:!0,disabledIndices:S})),m_(N.current,y,xe)&&(N.current=ne));const se=Math.floor(X/y)===xe;dm(o,N.current)&&(f&&se?N.current=$.key===Qf?X:Rn(o,{startingIndex:ne-ne%y-1,disabledIndices:S}):N.current=ne),R(N.current);return}}if(aH($.key,O)){if(Ku($),n&&!h&&iH($.currentTarget.ownerDocument)===$.currentTarget){N.current=rM($.key,O,p)?L:X,R(N.current);return}rM($.key,O,p)?f?N.current=x>=X?l&&x!==o.current.length?-1:L:Rn(o,{startingIndex:x,disabledIndices:S}):N.current=Math.min(X,Rn(o,{startingIndex:x,disabledIndices:S})):f?N.current=x<=L?l&&x!==-1?o.current.length:X:Rn(o,{startingIndex:x,decrement:!0,disabledIndices:S}):N.current=Math.max(L,Rn(o,{startingIndex:x,decrement:!0,disabledIndices:S})),dm(o,N.current)?R(null):R(N.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":Ie},onKeyDown($){if(J.current=!0,h&&n)return T($);if(($.key.indexOf("Arrow")===0||$.key==="Enter"||$.key===" "||$.key==="")&&(Z.current=$.key),d){Wxe($.key,O,p)&&(Ku($),n?(N.current=iM(o,S),R(N.current)):r(!0));return}aH($.key,O)&&(c!=null&&(N.current=c),Ku($),!n&&b?r(!0):T($),n&&R(N.current))}},floating:{"aria-orientation":O==="both"?void 0:O,...h&&a!=null&&{"aria-activedescendant":Ie},onKeyDown:T,onPointerMove(){J.current=!1}},item:{onFocus($){let{currentTarget:x}=$;const L=o.current.indexOf(x);L!==-1&&R(L)},onClick:$=>{let{currentTarget:x}=$;return x.focus({preventScroll:!0})},...g&&{onMouseMove($){let{currentTarget:x}=$;const L=x;if(L){const X=o.current.indexOf(L);X!==-1&&R(X)}},onPointerLeave(){if(!J.current&&(N.current=-1,A(o,N),R(null),!h)){var $;($=i.floating.current)==null||$.focus({preventScroll:!0})}}}}}:{}};function Dxe(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=bEe(n),s=new RegExp(`\\s${u}$`),c=o?"^":"",l=r?new RegExp(`${c}${u}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${c}(?:^)?${u}[^\\s${u}]*`,"gm"),f=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!f)return null;const d=a.pos-f.length,p=Array.from(f.matchAll(l)).pop();if(!p||p.input===void 0||p.index===void 0)return null;const h=p.input.slice(Math.max(0,p.index-1),p.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!v)return null;const g=d+p.index;let b=g+p[0].length;return r&&s.test(f.slice(b-1,b+1))&&(p[0]+=" ",b+=1),g<a.pos&&b>=a.pos?{range:{from:g,to:b},query:p[0].slice(n.length),text:p[0]}:null}const Uxe=new Fi("suggestion");function Bxe({pluginKey:e=Uxe,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:u="suggestion",command:s=()=>null,items:c=()=>[],render:l=()=>({}),allow:f=()=>!0}){let d;const p=l==null?void 0:l(),h=new Er({key:e,view(){return{update:async(v,g)=>{var b,S,O,y,C,I,M;const R=(b=this.key)===null||b===void 0?void 0:b.getState(g),U=(S=this.key)===null||S===void 0?void 0:S.getState(v.state),q=R.active&&U.active&&R.range.from!==U.range.from,N=!R.active&&U.active,Z=R.active&&!U.active,ee=!N&&!Z&&R.query!==U.query,J=N||q,ve=ee&&!q,Ie=Z||q;if(!J&&!ve&&!Ie)return;const k=Ie&&!J?R:U,A=v.dom.querySelector(`[data-decoration-id="${k.decorationId}"]`);d={editor:t,range:k.range,query:k.query,text:k.text,items:[],command:T=>{s({editor:t,range:k.range,props:T})},decorationNode:A,clientRect:A?()=>{var T;const{decorationId:$}=(T=this.key)===null||T===void 0?void 0:T.getState(t.state),x=v.dom.querySelector(`[data-decoration-id="${$}"]`);return(x==null?void 0:x.getBoundingClientRect())||null}:null},J&&((O=p==null?void 0:p.onBeforeStart)===null||O===void 0||O.call(p,d)),ve&&((y=p==null?void 0:p.onBeforeUpdate)===null||y===void 0||y.call(p,d)),(ve||J)&&(d.items=await c({editor:t,query:k.query})),Ie&&((C=p==null?void 0:p.onExit)===null||C===void 0||C.call(p,d)),ve&&((I=p==null?void 0:p.onUpdate)===null||I===void 0||I.call(p,d)),J&&((M=p==null?void 0:p.onStart)===null||M===void 0||M.call(p,d))},destroy:()=>{var v;d&&((v=p==null?void 0:p.onExit)===null||v===void 0||v.call(p,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(v,g,b,S){const{isEditable:O}=t,{composing:y}=t.view,{selection:C}=v,{empty:I,from:M}=C,R={...g};if(R.composing=y,O&&(I||t.view.composing)){(M<g.range.from||M>g.range.to)&&!y&&!g.composing&&(R.active=!1);const U=Dxe({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:C.$from}),q=`id_${Math.floor(Math.random()*4294967295)}`;U&&f({editor:t,state:S,range:U.range})?(R.active=!0,R.decorationId=g.decorationId?g.decorationId:q,R.range=U.range,R.query=U.query,R.text=U.text):R.active=!1}else R.active=!1;return R.active||(R.decorationId=null,R.range={from:0,to:0},R.query=null,R.text=null),R}},props:{handleKeyDown(v,g){var b;const{active:S,range:O}=h.getState(v.state);return S&&((b=p==null?void 0:p.onKeyDown)===null||b===void 0?void 0:b.call(p,{view:v,event:g,range:O}))||!1},decorations(v){const{active:g,range:b,decorationId:S}=h.getState(v);return g?Pt.create(v.doc,[Mr.inline(b.from,b.to,{nodeName:a,class:u,"data-decoration-id":S})]):null}}});return h}function sH(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=sH(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function cH(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=sH(e))&&(r&&(r+=" "),r+=t);return r}const qxe=cr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",xt(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Eo={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",preformatted:"preformatted",strong:"strong",em:"em",listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",image:"image",embed:"embed",hyperlink:"hyperlink",label:"label",span:"span"},g_=()=>(++g_.i).toString();g_.i=0;const zxe=e=>{const t=Kxe(e),n=[];for(let r=0;r<t.length;r++)n.push(lH(t[r]));return{key:g_(),children:n}},pm=(e,t=[])=>({key:g_(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),oM=e=>pm({type:Eo.span,text:e,spans:[]}),Kxe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===Eo.listItem||r.type===Eo.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===Eo.listItem?t[n]={type:Eo.list,items:i}:t[n]={type:Eo.oList,items:i}}}return t},lH=e=>{if("text"in e)return pm(e,fH(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(lH(e.items[n]));return pm(e,t)}return pm(e)},fH=(e,t,n)=>{if(!e.length)return[oM(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],u=n&&n.start||0,s=a.start-u,c=a.end-u,l=t.text.slice(s,c),f=[];for(let p=o;p<r.length;p++){const h=r[p];h!==a&&h.start>=a.start&&h.end<=a.end&&(f.push(h),r.splice(p,1),p--)}o===0&&s>0&&i.push(oM(t.text.slice(0,s)));const d={...a,text:l};i.push(pm(d,fH(f,{...t,text:l},a))),c<t.text.length&&i.push(oM(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},Vxe=(e,t)=>dH(zxe(e).children,t),dH=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,dH(i.children,t),i.key);o!=null&&n.push(o)}return n};Eo.listItem+"",Eo.oListItem+"",Eo.list+"",Eo.oList+"";const Hxe=cr.create({name:"text",group:"inline"}),Gxe={groupBy(e,t){return e.reduce((n,r)=>{const i=t(r),o=(n.get(i)||[]).concat(r);return n.set(i,o)},new Map)},sort(e){return[...e].sort((t,n)=>t.start-n.start)},mergeOverlap(e){const t=this.groupBy(e,r=>r.type),n=Array.from(t.entries()).map(([r,i])=>(this.sort(i).reduce((o,a)=>{if(!o.length)return[a];const u=o.length-1,s=o[u];return s.end>=a.start?[...o.slice(0,u),{...s,end:a.end}]:[...o,a]},[]),i)).reduce((r,i)=>[...r,...i],[]);return this.sort(n)}},pH={fromPrismic(e){return t=>{var n;return(n=cM.find(r=>r.richTextNodeTypes[0]===t.type))==null?void 0:n.converter.fromPrismic(e)(t)}},toPrismic(e,t,n){const[r,i]=(()=>{const o=cM.find(a=>e.type.name===a.name);if(!o)throw new Error(`Invalid mark extension '${e.type.name}'.`);return[o.richTextNodeTypes[0],o.converter.toPrismic(e)]})();return{type:r,start:t,end:n,...i?{data:i}:{}}}},hH=Hxe.extend({name:"text"}),Yxe={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return Vxe([i],Jxe(e,r))[0]}},toPrismic(e,t,n){const r=wc.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===i_.name?i_.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?wc.marks.map(o,d=>pH.toPrismic(d,s,c)):void 0)();return{...i,text:u,spans:l?[...i.spans,...l]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...Gxe.mergeOverlap(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function Jxe(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:i_.splitTextToNodes(e,i)(a=>e.text(a));{const a=pH.fromPrismic(e)(r);return a?j$(o).map(s=>s.mark([...s.marks,a].sort((c,l)=>c.type.name.localeCompare(l.type.name)))):j$(o)}}}const Mc={name:hH.name,component:hH,converter:Yxe};var mH=(e=>(e.LeftToRight="ltr",e.RightToLeft="rtl",e))(mH||{});const xa="dir",Zxe=Be.RichTextNodeType.rtl,Xxe=sr.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[xa]:{default:"ltr",parseHTML:e=>e.getAttribute(xa),renderHTML:e=>({[xa]:e[xa]==="ltr"?"ltr":"rtl"})}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case"rtl":return t.setRightToLeft();default:return t.setLeftToRight()}},toggleDirection:e=>({commands:t})=>{const n=e==="rtl"?"ltr":"rtl";return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[xa]:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,xa))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),ka={parseNodeAttrsDirection(e){switch(e[xa]){case"rtl":return"rtl";default:return"ltr"}},fromPrismic(e){const t=(()=>{switch(e.direction){case"rtl":return"rtl";default:return"ltr"}})();return{[xa]:t}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}},y_=qxe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",xt(this.options.HTMLAttributes,e),0]}}),Qxe={fromPrismic(e){return function(t){var r;const n=Mc.converter.fromPrismic(e)(y_.name,t);return(r=e.nodes[y_.name])==null?void 0:r.create(ka.fromPrismic(t),n)}},toPrismic(e){return Mc.converter.toPrismic(e,Be.RichTextNodeType.paragraph,ka.toPrismic(e))}},Vu=new Jf([Be.RichTextNodeType.paragraph],y_.name,y_,Qxe,"Type '/' for commands"),vH=["ArrowDown","ArrowUp","End","Home"],gH=["Enter"],eke=["Escape",...vH,...gH],tke=sr.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=T_(OH,this.options.nodeTypes);return e.length>1?[Bxe({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Vu.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new yMe(nke,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return eke.includes(n.key)&&((r=t==null?void 0:t.ref)==null?void 0:r.handleKeyDown(n))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),nke=j.forwardRef(function({command:t,decorationNode:n,editor:r,items:i},o){const[a,u]=j.useState(!0),s=parseFloat(w.tokens.space[0]),{context:c,floating:l,reference:f,strategy:d,x:p,y:h}=xxe({middleware:[sxe(s),axe(),cxe({limiter:lxe()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:Sxe});j.useLayoutEffect(()=>{f(n)},[f,n]),j.useEffect(()=>{let N;const Z=()=>{N=window.setTimeout(()=>{u(!0)})},ee=()=>{u(!1)};return r.on("focus",Z).on("blur",ee),()=>{r.off("focus",Z).off("blur",ee),clearTimeout(N)}},[r]);const[v,g]=j.useState(0),b=j.useRef([]),[S,O]=j.useState();i!==S&&(g(0),b.current=[],O(i));const{getFloatingProps:y,getItemProps:C,getReferenceProps:I}=kxe([Pxe(c,{outsidePointerDown:!1}),jxe(c,{activeIndex:v,listRef:b,onNavigate:N=>{g(Z=>N??Z)},openOnArrowKeyDown:!1,virtual:!0}),Nxe(c,{role:"menu"})]),R=I().onKeyDown;j.useImperativeHandle(o,()=>({handleKeyDown:N=>{if(a){if(vH.includes(N.key)&&R(N),gH.includes(N.key)){const Z=i[v];Z!==void 0&&t(Z)}return!0}else return!1}}),[v,t,i,R,a]);const U=p!==null&&h!==null,q=j.useId();return a?_.jsxs("div",{...y(),className:w.dropdownMenuStyles.content,ref:l,style:{top:parseFloat(w.tokens.space[0]),left:parseFloat(w.tokens.space[0]),minWidth:256,position:d,transform:U?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((N,Z)=>j.createElement(yH,{...C({onClick:()=>{t(N)},onPointerDown:ee=>{ee.preventDefault()}}),"data-highlighted":Z===v?"":void 0,id:`${q}[${Z}]`,key:N.nodeType,ref:ee=>{b.current[Z]=ee},shortcut:`/${N.shortText??""}`,startIcon:N.icon},N.text)),i.length===0?_.jsx(yH,{...C({onPointerDown:N=>{N.preventDefault()}}),disabled:!0,id:`${q}[0]`,ref:N=>{b.current[0]=N},children:"No results"}):null]}):null}),yH=j.forwardRef(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return _.jsxs("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:w.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[j.isValidElement(i)?j.cloneElement(i,{className:cH(i.props.className,w.dropdownMenuStyles.itemStartIcon)}):null,_.jsx(w.Text,{className:cH(w.dropdownMenuStyles.itemText,w.dropdownMenuStyles.itemTextColor.grey),component:"span",children:t}),r?_.jsx(w.Text,{className:w.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})});function rke(e,t){var a,u;const n=t.map(s=>s.richTextNodeTypes).flat(),i={placeholderByNodeType:m(t,di(s=>s.nodeType===Yf.Text),bv({},(s,c)=>({...s,[c.name]:c.placeholder}))),unfocusedPlaceholder:(a=e.config)==null?void 0:a.placeholder,nodeExtensions:t},o=n.includes(Be.RichTextNodeType.orderedList)||n.includes(Be.RichTextNodeType.list);return di(s=>s!==void 0)([BR.component(((u=e.config)==null?void 0:u.single)===void 0),Mc.component,i_.component,HMe(i),o?Zf.component:void 0,tke.configure({nodeTypes:n})])}const aM=PMe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",xt(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),ike={fromPrismic(e){return function(t){var r;const n=Zf.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[aM.name])==null?void 0:r.create(ka.fromPrismic(t),n)}},toPrismic(e){return d$(wc.children.map(e,t=>di(n=>n!==void 0)(Zf.converter.toPrismic(t,Be.RichTextNodeType.list))))}},b_=new jR([Be.RichTextNodeType.list],aM.name,aM,ike),oke=/^```([a-z]+)?[\s\n]$/,ake=/^~~~([a-z]+)?[\s\n]$/,__=cr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",xt(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},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:()=>{const{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},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
146
142
 
147
- `);return!o||!a?!1:e.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const u=i.after();return u===void 0||r.nodeAt(u)?!1:e.commands.exitCode()}}},addInputRules(){return[VE({find:DMe,type:this.type,getAttributes:e=>({language:e[1]})}),VE({find:qMe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Gr({key:new bu("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a}=e.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(Be.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,`
148
- `)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}).extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",bn(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),UMe={fromPrismic(e){return function(t){var r;const n=$c.converter.fromPrismic(e)(r_.name,t,!0);return(r=e.nodes[r_.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return $c.converter.toPrismic(e,Ve.RichTextNodeType.preformatted,Ia.toPrismic(e))}},O6=new Pf([Ve.RichTextNodeType.preformatted],r_.name,r_,UMe,"",!0),BMe=Jr.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]}`,bn(this.options.HTMLAttributes,t),0]},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=>VE({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),i_="heading",Oa={byLevel(e){switch(e){case 1:return Ve.RichTextNodeType.heading1;case 2:return Ve.RichTextNodeType.heading2;case 3:return Ve.RichTextNodeType.heading3;case 4:return Ve.RichTextNodeType.heading4;case 5:return Ve.RichTextNodeType.heading5;case 6:return Ve.RichTextNodeType.heading6}},default(e){return{fullName:this.byLevel(e),level:e}},fromPrismic(e,t=[1,2,3,4,5,6]){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:Oa.byLevel(i),level:i}},fromProsemirror(e,t){const n=e.level;if(t.includes(n))return{fullName:Oa.byLevel(n),level:n}}},zMe=e=>BMe.extend({name:i_,addAttributes(){return{level:{default:e[0]},label:{default:null}}},addOptions(){return{levels:[...e],HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){const r=t.attrs.level,o={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,bn(this.options.HTMLAttributes,n,o),0]}}),KMe=e=>{const t=e[0];return{fromPrismic(n){return function(r){var a;const i=$c.converter.fromPrismic(n)(i_,r),o=Oa.fromPrismic(r.type,e)||Oa.default(t);return(a=n.nodes[i_])==null?void 0:a.create({level:o.level,...Ia.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=Oa.fromProsemirror(n.attrs,e)||Oa.default(t);return $c.converter.toPrismic(n,r,Ia.toPrismic(n))}}};function VMe(e){if(!e)return[1,2,3,4,5,6];if(!e.size)return;const t=Array.from(e.values()).reduce((n,r)=>{const i=Oa.fromPrismic(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r);return y(ed(t),Z$(()=>{}))}const Ic={name:i_,build:e=>{const t=VMe(e);if(!t)return;const n=ed(t.map(r=>Oa.byLevel(r)));if(!Le(n))return new mRe(n.value,zMe(t),t,KMe(t),r=>{const i=Oa.fromProsemirror(r,t);return i&&`Heading ${i.level}`})}},HMe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,GMe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,YMe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,JMe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,jR=HE.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",bn(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)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Rb({find:HMe,type:this.type}),Rb({find:YMe,type:this.type})]},addPasteRules(){return[Mb({find:GMe,type:this.type}),Mb({find:JMe,type:this.type})]}}).extend({name:"em"}),ZMe={fromPrismic(e){return function(){var t;return(t=e.marks[jR.name])==null?void 0:t.create()}},toPrismic(){}},w6=new PH([Ve.RichTextNodeType.em],jR.name,jR,ZMe),XMe=/^(\d+)\.\s$/,LR=Jr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",bn(this.options.HTMLAttributes,n),0]:["ol",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[O5({find:XMe,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}).extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",bn(this.options.HTMLAttributes,n),0]:["ol",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),QMe={fromPrismic(e){return function(t){var r;const n=Wf.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[LR.name])==null?void 0:r.create(Ia.fromPrismic(t),n)}},toPrismic(e){return GS(bc.children.map(e,t=>li(n=>n!==void 0)(Wf.converter.toPrismic(t,Ve.RichTextNodeType.orderedList))))}},o_=new vR([Ve.RichTextNodeType.orderedList],LR.name,LR,QMe),C6=Wu,exe=e=>y([Wu,n_,o_,Ic.build(e),O6],li(ya)),DR=[WH,w6],E6=e=>[...exe(e),...DR],R6=[{nodeType:Ve.RichTextNodeType.paragraph,icon:I.jsx(C.Icon,{name:"textFields"}),isActive:e=>e.isActive(Wu.name)&&!e.isActive(n_.name)&&!e.isActive(o_.name),runCommands:Ar((e,t)=>e.clearNodes().setDirection(qi(t))),shortText:"par",text:"Paragraph"},{nodeType:Ve.RichTextNodeType.heading1,icon:I.jsx(C.Icon,{name:"looks1"}),isActive:e=>e.isActive(Ic.name,{level:1}),runCommands:Ar((e,t)=>e.setHeading({level:1}).setDirection(qi(t))),shortText:"h1",text:"Heading 1"},{nodeType:Ve.RichTextNodeType.heading2,icon:I.jsx(C.Icon,{name:"looks2"}),isActive:e=>e.isActive(Ic.name,{level:2}),runCommands:Ar((e,t)=>e.setHeading({level:2}).setDirection(qi(t))),shortText:"h2",text:"Heading 2"},{nodeType:Ve.RichTextNodeType.heading3,icon:I.jsx(C.Icon,{name:"looks3"}),isActive:e=>e.isActive(Ic.name,{level:3}),runCommands:Ar((e,t)=>e.setHeading({level:3}).setDirection(qi(t))),shortText:"h3",text:"Heading 3"},{nodeType:Ve.RichTextNodeType.heading4,icon:I.jsx(C.Icon,{name:"looks4"}),isActive:e=>e.isActive(Ic.name,{level:4}),runCommands:Ar((e,t)=>e.setHeading({level:4}).setDirection(qi(t))),shortText:"h4",text:"Heading 4"},{nodeType:Ve.RichTextNodeType.heading5,icon:I.jsx(C.Icon,{name:"looks5"}),isActive:e=>e.isActive(Ic.name,{level:5}),runCommands:Ar((e,t)=>e.setHeading({level:5}).setDirection(qi(t))),shortText:"h5",text:"Heading 5"},{nodeType:Ve.RichTextNodeType.heading6,icon:I.jsx(C.Icon,{name:"looks6"}),isActive:e=>e.isActive(Ic.name,{level:6}),runCommands:Ar((e,t)=>e.setHeading({level:6}).setDirection(qi(t))),shortText:"h6",text:"Heading 6"},{nodeType:Ve.RichTextNodeType.list,icon:I.jsx(C.Icon,{name:"formatListBulleted"}),isActive:e=>e.isActive(n_.name),runCommands:Ar((e,t)=>e.toggleBulletList().setDirection(qi(t))),shortText:"bull",text:"Bulleted list"},{nodeType:Ve.RichTextNodeType.orderedList,icon:I.jsx(C.Icon,{name:"formatListNumbered"}),isActive:e=>e.isActive(o_.name),runCommands:Ar((e,t)=>e.toggleOrderedList().setDirection(qi(t))),shortText:"num",text:"Numbered list"},{nodeType:Ve.RichTextNodeType.preformatted,icon:I.jsx(C.Icon,{name:"dataObject"}),isActive:e=>e.isActive(O6.name),runCommands:Ar((e,t)=>e.setCodeBlock().setDirection(qi(t))),shortText:"code",text:"Code"}],txe=[{nodeType:Ve.RichTextNodeType.strong,icon:I.jsx(C.Icon,{name:"formatBold"}),isActive:e=>e.isActive(WH.name),runCommands:Ar(e=>e.toggleBold())},{nodeType:Ve.RichTextNodeType.em,icon:I.jsx(C.Icon,{name:"formatItalic"}),isActive:e=>e.isActive(w6.name),runCommands:Ar(e=>e.toggleItalic())}],nxe=[{nodeType:Ve.RichTextNodeType.rtl,icon:I.jsx(C.Icon,{name:"formatTextDirectionRToL"}),isActive:e=>e.isActive({[Tc]:S6.RightToLeft}),runCommands:Ar((e,t)=>e.toggleDirection(qi(t)))}];function Ar(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),e(r,t).run()}}function qi(e){const t=e.state.selection.$from.parent.attrs;return Ia.parseNodeAttrsDirection(t)}function a_(e,t){return e.filter(n=>t.includes(n.nodeType))}const rxe={duration:100,hideOnClick:!0,offset:[-48,parseFloat(C.tokens.space[8])],placement:"top-start",zIndex:parseFloat(C.tokens.zIndex.toolbar)},ixe=({editor:e,nodeTypes:t})=>{var a;const n=a_(R6,t),r=a_(txe,t),i=a_(nxe,t),o=[n.length>1?I.jsx(C.ToolbarSelect,{onValueChange:u=>{var s;(s=n.find(c=>c.nodeType===u))==null||s.runCommands(e)},value:((a=n.find(u=>u.isActive(e)))==null?void 0:a.nodeType)??"",children:n.map(u=>I.jsx(C.ToolbarSelectItem,{value:u.nodeType,children:u.text},u.nodeType))},"node"):null,r.length>0?I.jsx(C.ToolbarToggleButtonGroup,{onValueChange:u=>{r.forEach(s=>{(s.isActive(e)&&!u.includes(s.nodeType)||!s.isActive(e)&&u.includes(s.nodeType))&&s.runCommands(e)})},type:"multiple",value:r.filter(u=>u.isActive(e)).map(u=>u.nodeType),children:r.map(u=>I.jsx(C.ToolbarToggleButtonGroupItem,{disabled:!u.runCommands(e,{can:!0}),startIcon:u.icon,value:u.nodeType},u.nodeType))},"mark"):null,i.length>0?I.jsx(U.Fragment,{children:i.map(u=>I.jsx(C.ToolbarToggleButton,{disabled:!u.runCommands(e,{can:!0}),onPressedChange:()=>{u.runCommands(e)},pressed:u.isActive(e),startIcon:u.icon},u.nodeType))},"extra"):null,n.length+r.length+i.length>1?I.jsx(C.ToolbarButton,{onClick:()=>{e.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:I.jsx(C.Icon,{name:"formatClear"})},"clear"):null].filter(ya).map((u,s)=>I.jsxs(U.Fragment,{children:[s===0?null:I.jsx(C.ToolbarSeparator,{}),u]},u.key));return o.length>0?I.jsx(HEe,{editor:e,tippyOptions:rxe,children:I.jsx(C.Toolbar,{children:o})}):null},oxe=e=>{var c;const{content:t,field:n,id:r,readOnly:i,config:o}=e,a=t&&bR.converter(o.nodeExtensions).fromPrismic(o.schema,(c=o.defaultTextConverter)==null?void 0:c.call(o,o.schema))(t),u=qV(e.onContentChange),s=iRe({...a?{content:a.toJSON()}:{},editable:!i,editorProps:{attributes:{class:C.contentEditableClass,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:l}){const f=bR.converter(o.nodeExtensions).toPrismic(l.state.doc);u(f)}},[r,i,u]);return I.jsxs(C.Field,{children:[I.jsx(C.FieldLabel,{htmlFor:r,children:wr(n)}),I.jsx(C.FieldControl,{children:I.jsxs(I.Fragment,{children:[I.jsx(ZEe,{editor:s,style:{flex:1}}),(s==null?void 0:s.isEditable)&&I.jsx(ixe,{editor:s,nodeTypes:o.names.concat(kMe)})]})})]})},axe=e=>{const{field:t}=e,n=U.useMemo(()=>{const{extensions:r,defaultTextConverter:i}=SRe(t.config),o=li(f=>f.extType===mR.Node)(r),a=r.flatMap(f=>f.richTextNodeTypes),u=r.map(f=>f.component),s=[...jMe(t,o),AMe.configure({supportedExtensionNames:li(f=>f.extType===mR.Node&&f.nodeType===Ff.Text&&!f.lockedFormat)(r).map(f=>f.name)}),...u],c=s.map(f=>f.name),l=WOe(s);return{allComponents:s,extensionsNames:c,defaultTextConverter:i,nodeExtensions:o,names:a,schema:l}},[t]);return I.jsx(oxe,{...e,config:n},n.extensionsNames.join("-"))},uxe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c;const o=lu(t),a=sxe(t),u=(e==null?void 0:e.value)??a;return I.jsxs(C.Field,{children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"arrowDropDownCircle"})}),I.jsx(C.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsx(C.FieldControl,{children:I.jsxs(C.Select,{id:n,onValueChange:l=>{i||r(cxe(l))},placeholder:o,...u===void 0?{}:{value:u},children:[u===void 0||a!==void 0?null:I.jsx(C.SelectItem,{value:"",children:o}),(c=(s=t.config)==null?void 0:s.options)==null?void 0:c.map(l=>I.jsx(C.SelectItem,{value:l,children:l},l))]})})]},u)};function sxe(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}function cxe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Select",value:e}}const lxe=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>I.jsxs(C.Field,{children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"event"})}),I.jsx(C.FieldLabel,{id:e,children:wr(n)}),I.jsx(C.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(C.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:I.jsx(C.DateInput,{mode:"date-time","aria-labelledby":e,readOnly:t,value:r==null?void 0:r.value,onValueChange:o=>i(fxe(o))})})})})]}),fxe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Timestamp",value:e},u_=({content:e,nestableWidget:t,...n})=>t.type==="Boolean"?I.jsx(kSe,{...n,field:t,content:ot.isBooleanContent(e)?e:void 0}):t.type==="Date"?I.jsx(WSe,{...n,field:t,content:ot.isDateContent(e)?e:void 0}):t.type==="Timestamp"?I.jsx(lxe,{...n,field:t,content:ot.isTimestampContent(e)?e:void 0}):t.type==="Image"?I.jsx(_0e,{...n,field:t,content:ot.isImageContent(e)?e:void 0}):t.type==="Link"?I.jsx(R0e,{...n,field:t,content:ot.isLinkContent(e)?e:void 0}):t.type==="Number"?I.jsx(k0e,{...n,field:t,content:ot.isNumberContent(e)?e:void 0}):t.type==="StructuredText"?I.jsx(axe,{...n,field:t,content:ot.isRichTextContent(e)?e:void 0}):t.type==="Select"?I.jsx(uxe,{...n,field:t,content:ot.isSelectContent(e)?e:void 0}):t.type==="Text"?I.jsx(O0e,{...n,field:t,content:ot.isTextContent(e)?e:void 0}):t.type==="Embed"?I.jsx(j$e,{...n,field:t,content:ot.isEmbedContent(e)?e:void 0}):t.type==="Color"?I.jsx(FSe,{...n,field:t,content:ot.isColorContent(e)?e:void 0}):null,M6=({content:e,id:t,nonRepeatableZone:n,onContentChange:r,readOnly:i})=>{const o=U.useMemo(()=>Object.entries(n),[n]);return I.jsx(I.Fragment,{children:o.map(([a,u])=>{const s=e[a];return I.jsx(u_,{id:`${t}.${a}`,readOnly:i,nestableWidget:u,content:ot.isNestableContent(s)?s:void 0,onContentChange:c=>{r(dxe(e,a,c))}},a)})})};function dxe(e,t,n){return n===void 0?xm(t)(e):{...e,[t]:n}}function pxe(e,t){return e.filter((n,r)=>r!==t)}function hxe(e,t,n){const r=e.length;if(x6(t,r)||x6(n,r))return e;const i=[...e],o=i[t],a=i[n];return i[t]=a,i[n]=o,i}function x6(e,t){return e<0||e>=t}let mxe=0;function vxe(){return mxe++}const qR=({id:e,title:t,content:n,onContentChange:r,readOnly:i,repeatableZone:o})=>{const a=U.useMemo(()=>Object.entries(o),[o]),u=_xe(n),s=U.useRef(new Map);return Object.keys(o).length===0?null:(gxe(s.current,u),I.jsx(C.Group,{title:"Repeatable zone"+(t?` • ${t}`:""),addItemButtonTitle:"Add item in group",items:u,getItemKey:c=>s.current.get(c)??"",onAddItem:()=>r(u.concat(k6())),children:(c,l)=>{const f=new Map(c.value);return I.jsx(C.GroupItem,{index:l,title:"Item",onMove:({index:d,offset:p})=>{r(hxe(u,d,d+p))},onDelete:({index:d})=>r(pxe(u,d)),children:a.map(([d,p])=>{const h=f.get(d);return I.jsx(u_,{content:ot.isNestableContent(h)?h:void 0,id:`${e}[${l}].${d}`,nestableWidget:p,onContentChange:v=>{const m=$xe(c,[d,v]),_=Sxe(u,[l,m]);yxe(s.current,c,m),r(_)},readOnly:i},d)})})}}))};function gxe(e,t){const n=new Set(t);t.forEach(r=>{e.has(r)||e.set(r,vxe())});for(const[r]of e)n.has(r)||e.delete(r)}function yxe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const bxe={__TYPE__:"GroupItemContent",value:[]};function _xe(e){return e??[bxe]}function Sxe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function $xe(e,t){const[n,r]=t,i=(()=>r?Array.from(new Map(e.value).set(n,r)):e.value.filter(([o])=>o!==n))();return k6(i)}const k6=(e=[])=>({__TYPE__:"GroupItemContent",value:e}),Txe=({compositeSlice:e,content:t,onContentChange:n,...r})=>I.jsxs(C.FieldSet,{children:[I.jsx(C.FieldSetLegend,{children:Ixe(e)}),I.jsx(M6,{...r,nonRepeatableZone:e["non-repeat"]??{},content:t.nonRepeat,onContentChange:i=>{n({...t,nonRepeat:i})}}),I.jsx(qR,{...r,repeatableZone:e.repeat??{},content:t.repeat,onContentChange:i=>{n({...t,repeat:i})}})]});function Ixe(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const A6=({group:e,content:t,onContentChange:n,...r})=>{var i;return I.jsx(qR,{...r,title:N6(e),repeatableZone:((i=e.config)==null?void 0:i.fields)??{},content:t==null?void 0:t.value,onContentChange:o=>{n({__TYPE__:"GroupContentType",value:o})}})};function N6(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const Oxe=({content:e,legacySlice:t,...n})=>I.jsxs(C.FieldSet,{children:[I.jsx(C.FieldSetLegend,{children:t.type==="Group"?N6(t):wr(t)}),t.type==="Group"?I.jsx(A6,{...n,group:t,content:ot.isGroupContent(e)?e:void 0}):I.jsx(u_,{...n,nestableWidget:t,content:ot.isNestableContent(e)?e:void 0,onContentChange:r=>{r&&n.onContentChange(r)}})]}),F6=({config:e,content:t,sliceKey:n,onContentChange:r,selected:i=!1,readOnly:o=!1,sharedSlice:a,...u})=>{const s=wxe(a,t.variation),c=U.useId();if(s===void 0)return null;const f={id:u.id??c,readOnly:o};return I.jsx(fS.Provider,{value:e,children:I.jsxs(C.FieldSet,{id:n,selected:i,children:[I.jsx(C.FieldSetLegend,{children:Cxe(a,s)}),I.jsx(M6,{...f,nonRepeatableZone:s.primary??{},content:t.primary,onContentChange:d=>{r({...t,primary:d})}}),I.jsx(qR,{...f,repeatableZone:s.items??{},content:t.items,onContentChange:d=>{r({...t,items:d})}})]})})};function wxe(e,t){return U.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function Cxe(e,t){return[e.name,t.name].join(" • ")}const Exe=({selectionId:e,content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o})=>{const a=pd();return I.jsx(I.Fragment,{children:t==null?void 0:t.value.map((u,s)=>{var p,h;const c=(h=(p=o.config)==null?void 0:p.choices)==null?void 0:h[u.name];if(c===void 0)return null;const l=e===u.key,f=u.widget,d={id:`${n}[${s}]`,key:u.key,sliceKey:u.key,onContentChange:v=>{const m={...u,widget:v},_=Rxe(t,[s,m]);r(_)},readOnly:i};if(c.type==="SharedSlice")return ot.isSharedSliceContent(f)?I.jsx(F6,{...d,config:a,sharedSlice:c,content:f,selected:l}):null;if(c.type==="Slice")return ot.isCompositeSliceContent(f)?I.jsx(Txe,{...d,compositeSlice:c,content:f}):null;{const v={...d,legacySlice:c};return ot.isSimpleSliceContent(f)?I.jsx(Oxe,{...v,content:f}):null}})})};function Rxe(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}const Mxe=e=>{const n=e.replace(/ /g,"-").normalize("NFD").replace(/\p{M}/g,""),r=new RegExp("[^-_.\\w\\u0080-\\uFFFF]","g");return n.replace(r,"").replace(/[\u0300-\u036f]/g,"").toLowerCase()||""},xxe=e=>{const t=Mxe(e);return t===""?void 0:{__TYPE__:"UIDContent",value:t}},kxe=({id:e,field:t,content:n,onContentChange:r})=>I.jsxs(C.Field,{children:[I.jsx(C.FieldIcon,{children:I.jsx(C.Icon,{name:"tag"})}),I.jsx(C.FieldLabel,{htmlFor:e,children:wr(t)}),I.jsx(C.FieldControl,{children:I.jsx(C.TextInput,{id:e,variant:"success",placeholder:lu(t),value:(n==null?void 0:n.value)??"",onValueChange:i=>{r(xxe(i))},endAdornment:I.jsx(C.AnimatedElement,{animationDuration:150,children:!(n!=null&&n.value)&&I.jsx(C.Badge,{color:"tomato",children:"Required"})})})})]}),Axe=({content:e,id:t,onContentChange:n,readOnly:r,staticZone:i})=>{const o=U.useMemo(()=>Object.entries(i),[i]);return I.jsxs(C.FieldSet,{children:[I.jsx(C.FieldSetLegend,{children:"Static Zone"}),o.map(([a,u])=>{const s={id:`${t}.${a}`,onContentChange:l=>{const{[a]:f,...d}=e;n({...d,...l!==void 0&&{[a]:l}})},readOnly:r},c=e[a];return u.type==="UID"?U.createElement(kxe,{...s,content:ot.isUIDContent(c)?c:void 0,key:a,field:u}):u.type==="Group"?U.createElement(A6,{...s,content:ot.isGroupContent(c)?c:void 0,group:u,key:a}):U.createElement(u_,{...s,content:ot.isNestableContent(c)?c:void 0,key:a,nestableWidget:u})})]})},Nxe=({id:e,readOnly:t,selection:n,section:r,content:i,onContentChange:o})=>{const[a,u]=Pxe(r),[s,c]=Wxe(i);return jxe(n),I.jsxs(C.Box,{display:"flex",flexDirection:"column",children:[I.jsx(Axe,{id:e,readOnly:t,staticZone:a,content:s,onContentChange:l=>o({...c,...l})}),u.map(([l,f])=>{const d=c[l];return I.jsx(Exe,{id:`${e}.${l}`,readOnly:t,selectionId:n==null?void 0:n.id,sliceZone:f,content:d,onContentChange:p=>o({...s,...c,[l]:p})},l)})]})};function Fxe(e){return e.type==="Choice"||e.type==="Slices"}function Pxe(e){return U.useMemo(()=>{const t=y(e,Bm(Fxe),h_(Mm));return[Jf(t),Zf(t)]},[e])}function Wxe(e){return U.useMemo(()=>Object.entries(e).reduce(([t,n],[r,i])=>{const o=ot.isSlicesContent(i),a={[r]:i};return[{...t,...o?{}:a},{...n,...o?a:{}}]},[{},{}]),[e])}function jxe(e){const{id:t,key:n,offset:r=0}=e??{};U.useLayoutEffect(()=>{if(!t)return;const i=setTimeout(()=>{const o=document.getElementById(t);if(!o)return;const a=o.getBoundingClientRect().y+window.scrollY;window.scrollTo({top:a-r,behavior:"smooth"})},100);return()=>clearTimeout(i)},[t,n,r])}const Lxe=({config:e,readOnly:t=!1,customType:n,sectionName:r,selection:i,content:o,onContentChange:a})=>{const u=U.useId();if(ui(n.json))return null;const s=Dxe(n,r),[c,l]=qxe(s,o);return I.jsx(fS.Provider,{value:e,children:I.jsx(Nxe,{id:u,readOnly:t,selection:i,section:s,content:c,onContentChange:f=>a({...l,...f})})})};function Dxe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function qxe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,u={[i]:o};return[{...n,...a?u:{}},{...r,...a?{}:u}]},[{},{}])}Sn.DocumentEditor=Lxe,Sn.SharedSliceEditor=F6,Object.defineProperty(Sn,Symbol.toStringTag,{value:"Module"})});
143
+ `);return!o||!a?!1:e.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const u=i.after();return u===void 0||r.nodeAt(u)?!1:e.commands.exitCode()}}},addInputRules(){return[mR({find:oke,type:this.type,getAttributes:e=>({language:e[1]})}),mR({find:ake,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Er({key:new Fi("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a}=e.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(De.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,`
144
+ `)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}).extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",xt(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),uke={fromPrismic(e){return function(t){var r;const n=Mc.converter.fromPrismic(e)(__.name,t,!0);return(r=e.nodes[__.name])==null?void 0:r.create(ka.fromPrismic(t),n)}},toPrismic(e){return Mc.converter.toPrismic(e,Be.RichTextNodeType.preformatted,ka.toPrismic(e))}},bH=new Jf([Be.RichTextNodeType.preformatted],__.name,__,uke,"",!0),ske=cr.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]}`,xt(this.options.HTMLAttributes,t),0]},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=>mR({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),$_="heading",Aa={byLevel(e){switch(e){case 1:return Be.RichTextNodeType.heading1;case 2:return Be.RichTextNodeType.heading2;case 3:return Be.RichTextNodeType.heading3;case 4:return Be.RichTextNodeType.heading4;case 5:return Be.RichTextNodeType.heading5;case 6:return Be.RichTextNodeType.heading6}},default(e){return{fullName:this.byLevel(e),level:e}},fromPrismic(e,t=[1,2,3,4,5,6]){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:Aa.byLevel(i),level:i}},fromProsemirror(e,t){const n=e.level;if(t.includes(n))return{fullName:Aa.byLevel(n),level:n}}},cke=e=>ske.extend({name:$_,addAttributes(){return{level:{default:e[0]},label:{default:null}}},addOptions(){return{levels:[...e],HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){const r=t.attrs.level,o={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,xt(this.options.HTMLAttributes,n,o),0]}}),lke=e=>{const t=e[0];return{fromPrismic(n){return function(r){var a;const i=Mc.converter.fromPrismic(n)($_,r),o=Aa.fromPrismic(r.type,e)||Aa.default(t);return(a=n.nodes[$_])==null?void 0:a.create({level:o.level,...ka.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=Aa.fromProsemirror(n.attrs,e)||Aa.default(t);return Mc.converter.toPrismic(n,r,ka.toPrismic(n))}}};function fke(e){if(!e)return[1,2,3,4,5,6];if(!e.size)return;const t=Array.from(e.values()).reduce((n,r)=>{const i=Aa.fromPrismic(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r);return m(dd(t),mS(()=>{}))}const xc={name:$_,build:e=>{const t=fke(e);if(!t)return;const n=dd(t.map(r=>Aa.byLevel(r)));if(!We(n))return new AMe(n.value,cke(t),t,lke(t),r=>{const i=Aa.fromProsemirror(r,t);return i&&`Heading ${i.level}`})}},dke=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,pke=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,hke=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,mke=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,uM=Yh.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",xt(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)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Ub({find:dke,type:this.type}),Ub({find:hke,type:this.type})]},addPasteRules(){return[qb({find:pke,type:this.type}),qb({find:mke,type:this.type})]}}).extend({name:"em"}),vke={fromPrismic(e){return function(){var t;return(t=e.marks[uM.name])==null?void 0:t.create()}},toPrismic(){}},_H=new w5([Be.RichTextNodeType.em],uM.name,uM,vke),gke=cr.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",xt(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),$H=Yh.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["span",xt(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=jb(e,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:t.unsetMark(this.name)}}}}),SH=/^(\d+)\.\s$/,sM=cr.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}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",xt(this.options.HTMLAttributes,n),0]:["ol",xt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(gke.name,this.editor.getAttributes($H.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Bb({find:SH,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Bb({find:SH,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes($H.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}).extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",xt(this.options.HTMLAttributes,n),0]:["ol",xt(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),yke={fromPrismic(e){return function(t){var r;const n=Zf.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[sM.name])==null?void 0:r.create(ka.fromPrismic(t),n)}},toPrismic(e){return d$(wc.children.map(e,t=>di(n=>n!==void 0)(Zf.converter.toPrismic(t,Be.RichTextNodeType.orderedList))))}},S_=new jR([Be.RichTextNodeType.orderedList],sM.name,sM,yke),TH=Vu,bke=e=>m([Vu,b_,S_,xc.build(e),bH],di(bu)),cM=[E5,_H],IH=e=>[...bke(e),...cM],OH=[{nodeType:Be.RichTextNodeType.paragraph,icon:_.jsx(w.Icon,{name:"textFields"}),isActive:e=>e.isActive(Vu.name)&&!e.isActive(b_.name)&&!e.isActive(S_.name),runCommands:Fr((e,t)=>e.clearNodes().setDirection(Di(t))),shortText:"par",text:"Paragraph"},{nodeType:Be.RichTextNodeType.heading1,icon:_.jsx(w.Icon,{name:"looks1"}),isActive:e=>e.isActive(xc.name,{level:1}),runCommands:Fr((e,t)=>e.setHeading({level:1}).setDirection(Di(t))),shortText:"h1",text:"Heading 1"},{nodeType:Be.RichTextNodeType.heading2,icon:_.jsx(w.Icon,{name:"looks2"}),isActive:e=>e.isActive(xc.name,{level:2}),runCommands:Fr((e,t)=>e.setHeading({level:2}).setDirection(Di(t))),shortText:"h2",text:"Heading 2"},{nodeType:Be.RichTextNodeType.heading3,icon:_.jsx(w.Icon,{name:"looks3"}),isActive:e=>e.isActive(xc.name,{level:3}),runCommands:Fr((e,t)=>e.setHeading({level:3}).setDirection(Di(t))),shortText:"h3",text:"Heading 3"},{nodeType:Be.RichTextNodeType.heading4,icon:_.jsx(w.Icon,{name:"looks4"}),isActive:e=>e.isActive(xc.name,{level:4}),runCommands:Fr((e,t)=>e.setHeading({level:4}).setDirection(Di(t))),shortText:"h4",text:"Heading 4"},{nodeType:Be.RichTextNodeType.heading5,icon:_.jsx(w.Icon,{name:"looks5"}),isActive:e=>e.isActive(xc.name,{level:5}),runCommands:Fr((e,t)=>e.setHeading({level:5}).setDirection(Di(t))),shortText:"h5",text:"Heading 5"},{nodeType:Be.RichTextNodeType.heading6,icon:_.jsx(w.Icon,{name:"looks6"}),isActive:e=>e.isActive(xc.name,{level:6}),runCommands:Fr((e,t)=>e.setHeading({level:6}).setDirection(Di(t))),shortText:"h6",text:"Heading 6"},{nodeType:Be.RichTextNodeType.list,icon:_.jsx(w.Icon,{name:"formatListBulleted"}),isActive:e=>e.isActive(b_.name),runCommands:Fr((e,t)=>e.toggleBulletList().setDirection(Di(t))),shortText:"bull",text:"Bulleted list"},{nodeType:Be.RichTextNodeType.orderedList,icon:_.jsx(w.Icon,{name:"formatListNumbered"}),isActive:e=>e.isActive(S_.name),runCommands:Fr((e,t)=>e.toggleOrderedList().setDirection(Di(t))),shortText:"num",text:"Numbered list"},{nodeType:Be.RichTextNodeType.preformatted,icon:_.jsx(w.Icon,{name:"dataObject"}),isActive:e=>e.isActive(bH.name),runCommands:Fr((e,t)=>e.setCodeBlock().setDirection(Di(t))),shortText:"code",text:"Code"}],_ke=[{nodeType:Be.RichTextNodeType.strong,icon:_.jsx(w.Icon,{name:"formatBold"}),isActive:e=>e.isActive(E5.name),runCommands:Fr(e=>e.toggleBold())},{nodeType:Be.RichTextNodeType.em,icon:_.jsx(w.Icon,{name:"formatItalic"}),isActive:e=>e.isActive(_H.name),runCommands:Fr(e=>e.toggleItalic())}],$ke=[{nodeType:Be.RichTextNodeType.rtl,icon:_.jsx(w.Icon,{name:"formatTextDirectionRToL"}),isActive:e=>e.isActive({[xa]:mH.RightToLeft}),runCommands:Fr((e,t)=>e.toggleDirection(Di(t)))}];function Fr(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),e(r,t).run()}}function Di(e){const t=e.state.selection.$from.parent.attrs;return ka.parseNodeAttrsDirection(t)}function T_(e,t){return e.filter(n=>t.includes(n.nodeType))}const Ske={duration:100,hideOnClick:!0,offset:[-48,parseFloat(w.tokens.space[8])],placement:"top-start",zIndex:parseFloat(w.tokens.zIndex.toolbar)},Tke=({editor:e,nodeTypes:t})=>{var a;const n=T_(OH,t),r=T_(_ke,t),i=T_($ke,t),o=[n.length>1?_.jsx(w.ToolbarSelect,{onValueChange:u=>{var s;(s=n.find(c=>c.nodeType===u))==null||s.runCommands(e)},value:((a=n.find(u=>u.isActive(e)))==null?void 0:a.nodeType)??"",children:n.map(u=>_.jsx(w.ToolbarSelectItem,{value:u.nodeType,children:u.text},u.nodeType))},"node"):null,r.length>0?_.jsx(w.ToolbarToggleButtonGroup,{onValueChange:u=>{r.forEach(s=>{(s.isActive(e)&&!u.includes(s.nodeType)||!s.isActive(e)&&u.includes(s.nodeType))&&s.runCommands(e)})},type:"multiple",value:r.filter(u=>u.isActive(e)).map(u=>u.nodeType),children:r.map(u=>_.jsx(w.ToolbarToggleButtonGroupItem,{disabled:!u.runCommands(e,{can:!0}),startIcon:u.icon,value:u.nodeType},u.nodeType))},"mark"):null,i.length>0?_.jsx(j.Fragment,{children:i.map(u=>_.jsx(w.ToolbarToggleButton,{disabled:!u.runCommands(e,{can:!0}),onPressedChange:()=>{u.runCommands(e)},pressed:u.isActive(e),startIcon:u.icon},u.nodeType))},"extra"):null,n.length+r.length+i.length>1?_.jsx(w.ToolbarButton,{onClick:()=>{e.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:_.jsx(w.Icon,{name:"formatClear"})},"clear"):null].filter(bu).map((u,s)=>_.jsxs(j.Fragment,{children:[s===0?null:_.jsx(w.ToolbarSeparator,{}),u]},u.key));return o.length>0?_.jsx(cMe,{editor:e,tippyOptions:Ske,children:_.jsx(w.Toolbar,{children:o})}):null},Ike=e=>{var c;const{content:t,field:n,id:r,readOnly:i,config:o}=e,a=t&&BR.converter(o.nodeExtensions).fromPrismic(o.schema,(c=o.defaultTextConverter)==null?void 0:c.call(o,o.schema))(t),u=rE(e.onContentChange),s=_Me({...a?{content:a.toJSON()}:{},editable:!i,editorProps:{attributes:{class:w.contentEditableClass,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:l}){if(l.isEmpty)return u(void 0);const f=BR.converter(o.nodeExtensions).toPrismic(l.state.doc);u(f)}},[r,i,u]);return _.jsxs(w.Field,{children:[_.jsx(w.FieldLabel,{htmlFor:r,children:Dn(n)}),_.jsx(w.FieldControl,{children:_.jsxs(_.Fragment,{children:[_.jsx(pMe,{editor:s,style:{flex:1}}),(s==null?void 0:s.isEditable)&&_.jsx(Tke,{editor:s,nodeTypes:o.names.concat(Zxe)})]})})]})},Oke=e=>{const{field:t}=e,n=j.useMemo(()=>{const{extensions:r,defaultTextConverter:i}=jMe(t.config),o=di(f=>f.extType===LR.Node)(r),a=r.flatMap(f=>f.richTextNodeTypes),u=r.map(f=>f.component),s=[...rke(t,o),Xxe.configure({supportedExtensionNames:di(f=>f.extType===LR.Node&&f.nodeType===Yf.Text&&!f.lockedFormat)(r).map(f=>f.name)}),...u,EEe],c=s.map(f=>f.name),l=Vwe(s);return{allComponents:s,extensionsNames:c,defaultTextConverter:i,nodeExtensions:o,names:a,schema:l}},[t]);return _.jsx(Ike,{...e,config:n},n.extensionsNames.join("-"))},Cke=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c;const o=po(t),a=wke(t),u=(e==null?void 0:e.value)??a;return _.jsxs(w.Field,{children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"arrowDropDownCircle"})}),_.jsx(w.FieldLabel,{htmlFor:n,children:Dn(t)}),_.jsx(w.FieldControl,{children:_.jsxs(w.Select,{id:n,onValueChange:l=>{i||r(Eke(l))},placeholder:o,...u===void 0?{}:{value:u},children:[u===void 0||a!==void 0?null:_.jsx(w.SelectItem,{value:"",children:o}),(c=(s=t.config)==null?void 0:s.options)==null?void 0:c.map(l=>_.jsx(w.SelectItem,{value:l,children:l},l))]})})]},u)};function wke(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}function Eke(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Select",value:e}}const Rke=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>_.jsxs(w.Field,{children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"event"})}),_.jsx(w.FieldLabel,{id:e,children:Dn(n)}),_.jsx(w.FieldControl,{children:_.jsx(_.Fragment,{children:_.jsx(w.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:_.jsx(w.DateInput,{mode:"date-time","aria-labelledby":e,readOnly:t,value:r==null?void 0:r.value,onValueChange:o=>i(Mke(o))})})})})]}),Mke=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Timestamp",value:e};function I_(e){const{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=rE(e.onContentChange);return j.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Boolean"?_.jsx(OSe,{...a,field:i,content:Qe.isBooleanContent(r)?r:void 0}):i.type==="Date"?_.jsx(MSe,{...a,field:i,content:Qe.isDateContent(r)?r:void 0}):i.type==="Timestamp"?_.jsx(Rke,{...a,field:i,content:Qe.isTimestampContent(r)?r:void 0}):i.type==="Image"?_.jsx(SIe,{...a,field:i,content:Qe.isImageContent(r)?r:void 0}):i.type==="Link"?_.jsx(FIe,{...a,field:i,content:Qe.isLinkContent(r)?r:void 0}):i.type==="Number"?_.jsx(LIe,{...a,field:i,content:Qe.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?_.jsx(Oke,{...a,field:i,content:Qe.isRichTextContent(r)?r:void 0}):i.type==="Select"?_.jsx(Cke,{...a,field:i,content:Qe.isSelectContent(r)?r:void 0}):i.type==="Text"?_.jsx(wIe,{...a,field:i,content:Qe.isTextContent(r)?r:void 0}):i.type==="Embed"?_.jsx(MTe,{...a,field:i,content:Qe.isEmbedContent(r)?r:void 0}):i.type==="Color"?_.jsx(ESe,{...a,field:i,content:Qe.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?_.jsx(WTe,{...a,field:i,content:Qe.isGeoPointContent(r)?r:void 0}):null},[r,t,i,o,n])}const CH=({content:e,id:t,nonRepeatableZone:n,onContentChange:r,readOnly:i})=>{const o=j.useMemo(()=>Object.entries(n),[n]);return _.jsx(_.Fragment,{children:o.map(([a,u])=>{const s=e[a];return _.jsx(I_,{id:`${t}.${a}`,readOnly:i,nestableWidget:u,content:Qe.isNestableContent(s)?s:void 0,onContentChange:c=>{r(xke(e,a,c))}},a)})})};function xke(e,t,n){return n===void 0?jm(t)(e):{...e,[t]:n}}function kke(e,t){return e.filter((n,r)=>r!==t)}function Ake(e,t,n){const r=e.length;if(wH(t,r)||wH(n,r))return e;const i=[...e],o=i[t],a=i[n];return i[t]=a,i[n]=o,i}function wH(e,t){return e<0||e>=t}let Fke=0;function Nke(){return Fke++}const lM=({id:e,title:t,content:n,onContentChange:r,readOnly:i,repeatableZone:o})=>{const a=j.useMemo(()=>Object.entries(o),[o]),u=jke(n),s=j.useRef(new Map);return Pke(s.current,u),Object.keys(o).length===0?null:_.jsx(w.Group,{title:"Repeatable zone"+(t?` • ${t}`:""),addItemButtonTitle:"Add item in group",items:u,getItemKey:c=>s.current.get(c)??"bugged",onAddItem:()=>r(u.concat(EH())),children:(c,l)=>{const f=new Map(c.value);return _.jsx(w.GroupItem,{index:l,title:"Item",onMove:({index:d,offset:p})=>{r(Ake(u,d,d+p))},onDelete:({index:d})=>r(kke(u,d)),children:a.map(([d,p])=>{const h=f.get(d);return _.jsx(I_,{content:Qe.isNestableContent(h)?h:void 0,id:`${e}[${l}].${d}`,nestableWidget:p,onContentChange:v=>{const g=Uke(c,[d,v]),b=Dke(u,[l,g]);Wke(s.current,c,g),r(b)},readOnly:i},d)})})}})};function Pke(e,t){const n=new Set(t);t.forEach(r=>{e.has(r)||e.set(r,Nke())}),j.useLayoutEffect(()=>{for(const[r]of e)n.has(r)||e.delete(r)})}function Wke(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const Lke={__TYPE__:"GroupItemContent",value:[]};function jke(e){return e??[Lke]}function Dke(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function Uke(e,t){const[n,r]=t,i=(()=>r?Array.from(new Map(e.value).set(n,r)):e.value.filter(([o])=>o!==n))();return EH(i)}const EH=(e=[])=>({__TYPE__:"GroupItemContent",value:e}),Bke=({compositeSlice:e,content:t,onContentChange:n,...r})=>_.jsxs(w.FieldSet,{children:[_.jsx(w.FieldSetLegend,{children:qke(e)}),_.jsx(CH,{...r,nonRepeatableZone:e["non-repeat"]??{},content:t.nonRepeat,onContentChange:i=>{n({...t,nonRepeat:i})}}),_.jsx(lM,{...r,repeatableZone:e.repeat??{},content:t.repeat,onContentChange:i=>{n({...t,repeat:i})}})]});function qke(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const RH=({group:e,content:t,onContentChange:n,...r})=>{var i;return _.jsx(lM,{...r,title:MH(e),repeatableZone:((i=e.config)==null?void 0:i.fields)??{},content:t==null?void 0:t.value,onContentChange:o=>{n({__TYPE__:"GroupContentType",value:o})}})};function MH(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const zke=({content:e,legacySlice:t,...n})=>_.jsxs(w.FieldSet,{children:[_.jsx(w.FieldSetLegend,{children:t.type==="Group"?MH(t):Dn(t)}),t.type==="Group"?_.jsx(RH,{...n,group:t,content:Qe.isGroupContent(e)?e:void 0}):_.jsx(I_,{...n,nestableWidget:t,content:Qe.isNestableContent(e)?e:void 0,onContentChange:r=>{r&&n.onContentChange(r)}})]});function xH(e){const{config:t,content:n,sliceKey:r,selected:i=!1,readOnly:o=!1,sharedSlice:a,onContentChange:u,...s}=e,c=Kke(a,n.variation),l=j.useId();if(c===void 0)return null;const d={id:s.id??l,readOnly:o};return _.jsx(R0.Provider,{value:t,children:_.jsxs(w.FieldSet,{id:r,selected:i,children:[_.jsx(w.FieldSetLegend,{children:Vke(a,c)}),_.jsx(CH,{...d,nonRepeatableZone:c.primary??{},content:n.primary,onContentChange:p=>{u({...n,primary:p})}}),_.jsx(lM,{...d,repeatableZone:c.items??{},content:n.items,onContentChange:p=>{u({...n,items:p})}})]})})}function Kke(e,t){return j.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function Vke(e,t){return[e.name,t.name].join(" • ")}function Hke(e){const{selectionId:t,content:n,id:r,onContentChange:i,readOnly:o,sliceZone:a}=e,u=Od();return _.jsx(_.Fragment,{children:n==null?void 0:n.value.map((s,c)=>{var h,v;const l=(v=(h=a.config)==null?void 0:h.choices)==null?void 0:v[s.name];if(l===void 0)return null;const f=t===s.key,d=s.widget,p={id:`${r}[${c}]`,key:s.key,sliceKey:s.key,onContentChange:g=>{const b={...s,widget:g},S=Gke(n,[c,b]);i(S)},readOnly:o};if(l.type==="SharedSlice")return Qe.isSharedSliceContent(d)?_.jsx(xH,{...p,config:u,sharedSlice:l,content:d,selected:f}):null;if(l.type==="Slice")return Qe.isCompositeSliceContent(d)?_.jsx(Bke,{...p,compositeSlice:l,content:d}):null;{const g={...p,legacySlice:l};return Qe.isSimpleSliceContent(d)?_.jsx(zke,{...g,content:d}):null}})})}function Gke(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}const Yke=e=>{const n=e.replace(/ /g,"-").normalize("NFD").replace(/\p{M}/g,""),r=new RegExp("[^-_.\\w\\u0080-\\uFFFF]","g");return n.replace(r,"").replace(/[\u0300-\u036f]/g,"").toLowerCase()||""},Jke=e=>{const t=Yke(e);return t===""?void 0:{__TYPE__:"UIDContent",value:t}},Zke=({id:e,field:t,content:n,onContentChange:r})=>_.jsxs(w.Field,{children:[_.jsx(w.FieldIcon,{children:_.jsx(w.Icon,{name:"tag"})}),_.jsx(w.FieldLabel,{htmlFor:e,children:Dn(t)}),_.jsx(w.FieldControl,{children:_.jsx(w.TextInput,{id:e,variant:"success",placeholder:po(t),value:(n==null?void 0:n.value)??"",onValueChange:i=>{r(Jke(i))},endAdornment:_.jsx(w.AnimatedElement,{enterDuration:150,children:!(n!=null&&n.value)&&_.jsx(w.Badge,{color:"tomato",title:"Required"})})})})]});function Xke(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o}=e,a=j.useMemo(()=>Object.entries(r),[r]);return a.length===0?null:_.jsxs(w.FieldSet,{children:[_.jsx(w.FieldSetLegend,{children:"Page data"}),a.map(([u,s])=>{const c={id:`${t}.${u}`,onContentChange:f=>{const{[u]:d,...p}=i;o({...p,...f!==void 0&&{[u]:f}})},readOnly:n},l=i[u];return s.type==="UID"?j.createElement(Zke,{...c,content:Qe.isUIDContent(l)?l:void 0,key:u,field:s}):s.type==="Group"?j.createElement(RH,{...c,content:Qe.isGroupContent(l)?l:void 0,group:s,key:u}):j.createElement(I_,{...c,content:Qe.isNestableContent(l)?l:void 0,key:u,nestableWidget:s})})]})}function Qke(e){const{id:t,readOnly:n,selection:r,section:i,content:o,onContentChange:a}=e,[u,s]=tAe(i),[c,l]=nAe(o);return rAe(r),_.jsxs(w.Box,{display:"flex",flexDirection:"column",children:[_.jsx(Xke,{id:t,readOnly:n,staticZone:u,content:c,onContentChange:f=>a({...l,...f})}),s.map(([f,d])=>{const p=l[f];return _.jsx(Hke,{id:`${t}.${f}`,readOnly:n,selectionId:r==null?void 0:r.id,sliceZone:d,content:p,onContentChange:h=>a({...c,...l,[f]:h})},f)})]})}function eAe(e){return e.type==="Choice"||e.type==="Slices"}function tAe(e){return Object.entries(e).reduce(([t,n],[r,i])=>(eAe(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function nAe(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(Qe.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function rAe(e){const{id:t,key:n,offset:r=0}=e??{};j.useLayoutEffect(()=>{if(!t)return;const i=setTimeout(()=>{const o=document.getElementById(t);if(!o)return;const a=o.getBoundingClientRect().y+window.scrollY;window.scrollTo({top:a-r,behavior:"smooth"})},100);return()=>clearTimeout(i)},[t,n,r])}const iAe=({config:e,readOnly:t=!1,customType:n,sectionName:r,selection:i,content:o,onContentChange:a})=>{const u=j.useId();if(ci(n.json))return null;const s=oAe(n,r),[c,l]=aAe(s,o);return _.jsx(R0.Provider,{value:e,children:_.jsx(Qke,{id:u,readOnly:t,selection:i,section:s,content:c,onContentChange:f=>a({...l,...f})})})};function oAe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function aAe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,u={[i]:o};return[{...n,...a?u:{}},{...r,...a?{}:u}]},[{},{}])}yn.DocumentEditor=iAe,yn.SharedSliceEditor=xH,Object.defineProperty(yn,Symbol.toStringTag,{value:"Module"})});